Google Maps API v3 - How to clear overlays?

前端 未结 7 2261
野性不改
野性不改 2020-12-31 00:30

In Google Maps API v2, I was using map.clearOverlays() to remove the marker and draw them again.

How can I do that using Google Maps API v3 ?

Th

7条回答
  •  悲哀的现实
    2020-12-31 01:20

    I found another solution and it works very good it will remove all overlays that exist on the map

    gmap.overlayMapTypes.setAt( 0, null);
    

    while gmap is your map object

提交回复
热议问题