Closed frankthoeny closed 8 years ago
You're using inline directions? Can you post all the settings you're using?
I forgot to mention after entering your Postal(zip code) in the address field and submit, then directions links work fine. The problem is on initial load of the defaultLoc where this issue happens.
Yes, I would like to use Inline directions. Yes or No change the error?
My Settings
$(function() {
$('#map-container').storeLocator({
'autoGeocode' : false,
'sessionStorage' : true,
'mapID' : 'map',
'locationList' : 'loc-list',
'formContainer' : 'form-container',
'formID' : 'user-location',
'addressID' : 'address',
'regionID' : 'region',
'querystringParams' : true,
'dataType' : 'json',
'dataLocation' : "//spreadsheets.google.com/feeds/list/xxxxx/od6/public/values?&alt=json",
'defaultLoc' : true,
'defaultLat' : 33.987701,
'defaultLng' : -118.4602367,
'slideMap' : false,
'fullMapStart' : true,
'mapSettings' : {
'zoom' : 5,
'mapTypeId' : google.maps.MapTypeId.ROADMAP
},
'storeLimit' : 300,
'distanceAlert' : 2500,
'maxDistanceID' : 'maxdistance',
'maxDistance' : true,
'loading' : true,
'loadingContainer' : 'loading',
'listColor1' : 'fff',
'listColor2' : 'fff',
'inlineDirections' : true,
'infowindowTemplatePath': "{{ 'infowindow-description.html' | asset_url }}",
'listTemplatePath': "{{ 'location-list-description.html' | asset_url }}",
'KMLinfowindowTemplatePath': "{{ 'kml-infowindow-description.html' | asset_url }}",
'KMLlistTemplatePath': "{{ 'kml-location-list-description.html' | asset_url }}"
});
});
If you do a console.log on the origin, orig_lat and orig_lng before _this.locationsSetup are they all set? Do the distances show up in the location list?
@frank909 Ran into the same error on a project I'm working on. I'm pretty sure I've tracked down the bug. If you can confirm this is working on your end that would be great. Update the clearMarkers method around line 1260 so that the loop uses the limit from the settings:
for (var i = 0; i < this.settings.storeLimit; i++) {
Fixed in v2.2.2 - see updated clearMarkers method.
If defaultLoc is False(default), directions links and distances are not displaying. When defaultLoc is True with a defaultLat and defaultLng, the addresses are showing directions links and distances. But there is an issue with the distances links, a JavaScript error.
Shopify Assets My infowindow-description.html
My location-list-description.html
JSON Processing Code