Google Maps Polyline - How do I remove it?

前端 未结 5 930
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-17 17:34

So I checked previous questions regarding this, which all relate to V2, which is of no help.

So, I create two markers, save them in an array as markers[\"to\"] and m

5条回答
  •  借酒劲吻你
    2021-01-17 18:09

    Assuming that "mypolyline" is your Polyline object, you can also try:

    mypolyline.setPath([]);
    

    This way, you are taking out the coordinates from the Polyline, which in effect will remove it from the map.

提交回复
热议问题