开发者

How to fire event when user clicks outside Google map

开发者 https://www.devze.com 2023-03-11 04:47 出处:网络
When you are editing a text field, and you click outside that text field, a \"blur\" event fires on that text field element that you can do fun stuff with.

When you are editing a text field, and you click outside that text field, a "blur" event fires on that text field element that you can do fun stuff with.

I'm building a Google map where you're editing a line, and I want to do some fun stuff when a user clicks outside the map. (i.e. deselect the current path, and start a new path when the map is clicked again)

Catching a click event on the page in general fee开发者_运维问答ls clumsy. Is there a google maps equivalent of the "blur" or "focusout" event?


You could try adding a dom listener to the map overlay for the blur event.

http://code.google.com/apis/maps/documentation/javascript/events.html#DomEvents

0

精彩评论

暂无评论...
验证码 换一张
取 消