Skip to content Skip to sidebar Skip to footer

Google Maps Api V3 - Legend Duplication

I have embed a google maps in Klipfolio, however the legend's items are duplicating themselves from time to time when you refresh the page. screenshot of the legend duplicated and

Solution 1:

For whoever else that will meet this error, I solved this by a work-around. Just remove values that repeat themselves by using their css class. An example can be found here.

<html><divclass = "test">Window</div><divclass = "test">Table</div><divclass = "test">Chaise</div><divclass = "test">Window</div><divclass = "test">Chaise</div></html><script>
$('.test').each(function () {
  $('.test:contains("' + $(this).text() + '"):gt(0)').remove();  
});
</script>

Refer to the previous comments I made about js making duplicates when it is being loaded from the body.

Post a Comment for "Google Maps Api V3 - Legend Duplication"