Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markers not display with JSON and when clicked getting undefined error #51

Closed
davemerwin opened this issue Mar 12, 2015 · 1 comment
Closed

Comments

@davemerwin
Copy link

I'm using JSON for my data. The data comes up in the list no problem. However, there are no markers on the page. When I click on an item in the list, I get the following error:

Uncaught TypeError: Cannot read property 'getPosition' of undefined

And this is in reference to line 721 which is: map.panTo(selectedMarker.getPosition());

My setup is:

$('#map-container').storeLocator({
        'infowindowTemplatePath': '/static/html/infowindow-description.html',
        'listTemplatePath': '/static/html/location-list-description.html',
        'dataType': 'json',
        'querystringParams' : true,
        //'dataLocation': '/static/json/locations.json'
        'dataLocation': '/api/locations?postal=97401&format=json'
      });

Any help is much appreciated

@davemerwin
Copy link
Author

I figured it out, and this will be a good not for those doing this kind of project in the future. Unless or until the data structure is rebuilt for this plugin (not saying it should) your data model MOST match what is listed on line 449. You can remap a bunch, but if that is how your data starts you'll have a much easier time of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant