Markers don't reset when sorting
Permalink Browser Info Environment
I was wondering if there was a way to get the markers on the map to reset and show only the locations that the form is sorted on.
For example, this particular company has five subsidiaries, we want to be able to sort results by the subsidiary and have the markers on the map show only those locations. Currently, the map shows all of the markers regardless.
You can view the site here -http://www.corporateprdev.com/udg/locations/dealer-test...
For example, this particular company has five subsidiaries, we want to be able to sort results by the subsidiary and have the markers on the map show only those locations. Currently, the map shows all of the markers regardless.
You can view the site here -http://www.corporateprdev.com/udg/locations/dealer-test...
Type: | Discussion |
---|---|
Status: | New |
Sorry, I'm so used to typing addresses with pretty URLs and I haven't implemented them yet.
http://www.corporateprdev.com/udg/index.php/locations/dealer-test...
http://www.corporateprdev.com/udg/index.php/locations/dealer-test...
Although I have found a script that will clear all markers on the map. I just haven't had the chance to give it a try yet.
Ok I have it now. Could you give me a Zip Code/Location to get in the general area or the locations that have been added?
Best Wishes,
Mike
Best Wishes,
Mike
They're all over North America, but I've been using 250 for the radius and 37620 for the zip.
I'm thinking of putting something like this in just before the search function on the click so that the markers clear before the search happens
function clearOverlays() { if (markersArray) { for (i in markersArray) { markersArray[i].setMap(null); } } }
Hello,
Indeed, one of the issues was that Dealer Locator is that it was designed to try and allow multiple blocks per page
That said, I worked out a fix and hopefully we'll get this pushed out in an update soon.
If you go to the file
/dealer_locator/block/dealer_search/view.php
After line #10 where it has
Add
Then just after (around line #70-ish) where there is
Add right below that
And then lastly above(Line #120-ish) above
add
Hopefully that makes sense. If you have some trouble let me know.
Basically, we're are clearing those markers.
Best Wishes,
Mike
Indeed, one of the issues was that Dealer Locator is that it was designed to try and allow multiple blocks per page
That said, I worked out a fix and hopefully we'll get this pushed out in an update soon.
If you go to the file
/dealer_locator/block/dealer_search/view.php
After line #10 where it has
var openInfoWindow<?php echo $controller->bID?>;
Add
var markers<?php echo $controller->bID?> = [];
Then just after (around line #70-ish) where there is
$.getJSON(searchUrl, function(data) {
Add right below that
And then lastly above(Line #120-ish) above
google.maps.event.addListener(marker, 'click', function() {
add
markers<?php echo $controller->bID?>.push(marker);
Hopefully that makes sense. If you have some trouble let me know.
Basically, we're are clearing those markers.
Best Wishes,
Mike
Perfect! Thanks mkly!
Perfect Answer...!!!!
Thanks a lot mkly.
Thanks a lot mkly.
I'm getting a not found on the link you posted.
Best Wishes,
Mike