I’m not sure what the best way to avoid duplicate markers on a Google map. My current setup is that the website POSTs to the server with the user’s map bounds. Markers are returned that match the map location / coordinates but I decide if its better to check for duplicate markers on the client side (loop through all current markers in javascript) or only return unique markers from the server by looping through the previously returned markers? Or maybe there is a better way instead of using loops?
Share
you maintain an associative array and hash the key in a way so that two similar markers get the same hash,something like an id.
now before putting a marker into the map you check your associative array if an entry exists for that key, if it does you do nothing else you add a key and add it to the map.