I’m using google maps v3 API to display markers from an XML document, and I’m utilizing marker manager to specify the number of markers to show per zoom level.
Here’s the link: http://www.wrh.noaa.gov/mfr/rec/v2/index_sidebar_zoom.php
And here’s the problem. It seems that upon loading, the script loads all the markers for each zoom level together, so even though I only have ~200 markers, my marker array, named “batch”, contains 507 markers. When I display “batch” on the sidebar, it thus displays some duplicate markers.
So to troubleshoot this, I tried to eliminate duplicates using a jquery script I found. However, when I alert the length of the “batch” array and then alert the length of the new array (supposed to be free of duplicates), it shows 507 as well.
So, any suggestions on how to eliminate the duplicate markers, and sort them alphabetically to display on the sidebar?
Lastly, I seem to have lost my functionality of displaying more markers as I zoom in while I’ve been working on the sidebar. Any ideas on what happened to that functionality?
Thanks for any help,
S
The MarkerManager is diplaying the first 48 markers 4 times, the first 98 markers 3 times, the first 150 markers twice. Is that what you want?
I think what you want is this:
And change your createMarker function to take a start and end number.
Like this