javascript - Remove all markers google map v3 -


All markers in my first click event are shown in Google Maps, I want to remove them in the second click. When I execute my code, only the last marker is removed
This is my javascript code:

  var showmarkers = false; Google.maps.event.addDomListener (hotel, 'click', function) {if (showmarkers == incorrect) {showmarkers = true; For (var i = 0; i & lt; len; i ++) {// add makers marker = new google.maps.marker ({status: new google.maps.LatLng (results.rows.item (i). Lat, results.rows.item (i) .long), map: map, icon: icon [1], animation: google.maps.Animation.DROP,}); Marker Peash (Marker);} // Add Infobo Indo google.maps.event.addListener (Marker, 'Click', (Function (Marker, i) {Return Function () {// If we create infowindow here, then all Windows infowindow.setContent ("

  other {alerts ("false "); Shomekers = true; (Var lp = 0; lp  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -