I ran across an issue today on a project I'm working on creating a dealer locator for a company:
Plotting the initial search results is fine. It goes something like this:
Remove any markers that might already be there with map.removeMarker()
Add the new markers to the map
Set the bounds of the map to contain the new markers
That's fine on the first search, but if I then scroll back up and search again, when the new set of markers is plotted, although the original ones are no longer visible, they are still included in the array of markers used to create the bounds, even though this is using map.findMarker({visible:true}).
It seems that map.removeMarker() is leaving the markers behind somehow, even after hiding them. Is there a solution to this issue? Have others happened across the same problem?
Many thanks!
I ran across an issue today on a project I'm working on creating a dealer locator for a company:
Plotting the initial search results is fine. It goes something like this:
Remove any markers that might already be there with
map.removeMarker()Add the new markers to the map
Set the bounds of the map to contain the new markers
That's fine on the first search, but if I then scroll back up and search again, when the new set of markers is plotted, although the original ones are no longer visible, they are still included in the array of markers used to create the bounds, even though this is using
map.findMarker({visible:true}).It seems that
map.removeMarker()is leaving the markers behind somehow, even after hiding them. Is there a solution to this issue? Have others happened across the same problem?Many thanks!