1
我想在使用繪圖工具(多邊形)繪製疊加層之前有一個事件。在這種情況下,我想清除以前的任何圖紙。當Google地圖中的繪圖模式更改時,我們是否有活動?
我想在使用繪圖工具(多邊形)繪製疊加層之前有一個事件。在這種情況下,我想清除以前的任何圖紙。當Google地圖中的繪圖模式更改時,我們是否有活動?
在CoffeeScript的
google.maps.event.addDomListener mapElement, 'click', (e) ->
if e?.target?.parentElement?.parentElement?.parentElement?.title == "Draw a shape"
clearExistingShapes() # <-- your own code goes there
不是很優雅,但在緊要關頭的作品。