this is my sample.
i use "setMap(null)".
var g_map;
var arr_overlay = new Array();
var riderCount = 0;
function initialize() {
var latlng = new google.maps.LatLng(37.5115422, 127.0266094); var
myOptions = { zoom: 13, center: latlng, mapTypeId:
google.maps.MapTypeId.ROADMAP }; g_map = new google.maps.Map
(document.getElementById("map_canvas"), myOptions); }
function gotoCenter(lat,lon){ var z = g_map.getZoom(); var center =
new google.maps.LatLng(lat, lon); g_map.panTo(center);
return 1;
}
function drawRider(lat, lon, pk, id, title, img){
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat, lon)
, map: g_map, title:title
, icon:img}
);
google.maps.event.addListener(
marker
, 'click'
, function() {
RiderAlloc.getRiderOrderList(pk,id);
}
);
arr_overlay[riderCount++] = marker;
}
function removeRiders()
{
var mk;
for(i= 0; i <arr_overlay.length; i++) {
mk = arr_overlay[i];
mk.setMap(null);
}
arr_overlay = null;
arr_overlay = new Array();
riderCount = 0;
}
On 1월28일, 오후9시04분, arlen <[email protected]> wrote:
> How do I clear all the markers on the map, I used the google map API3.
>
> thanks!
>
> arlen
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.