开发者

how to get the google map's pageX when dragend ,the version is v3

开发者 https://www.devze.com 2022-12-25 01:01 出处:网络
this is my code: google.maps.event.addListener(marker, \'dragend\', function(event) { alert(event.pageX)//undefined

this is my code:

google.maps.event.addListener(marker, 'dragend', function(event) {
   alert(event.pageX)//undefined
});

and i want开发者_开发问答 to get the (x,y) about mouse when dragend..

thanks


you can get event.pixel and that will give you a x,y object that is relative to the mapDiv's position. If you want absolute position on the page then you will need to add the offset of the mapDiv to that result.

0

精彩评论

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