如何在iPad网络浏览器上捕获谷歌地图API中心的更改事件?
在基于HTML的google map的web浏览器上更改的消息在台式PC或笔记本电脑web浏览器上可以被触发,但在iPhone和iPad上,它们在触发时永远不会返回正确的中心坐标。有办法做到这一点吗?不,你不能。 不仅对于如何在iPad网络浏览器上捕获谷歌地图API中心的更改事件?,ipad,google-maps,Ipad,Google Maps,在基于HTML的google map的web浏览器上更改的消息在台式PC或笔记本电脑web浏览器上可以被触发,但在iPhone和iPad上,它们在触发时永远不会返回正确的中心坐标。有办法做到这一点吗?不,你不能。 不仅对于center\u changed,而且对于drag,mousemove事件,它们都不会更新当前地图的边界和中心。它仅在移动完成时更新 你可以用这样复杂的方式来解决这个问题 google.maps.event.addListener(map, 'dragstart', f
center\u changed
,而且对于drag
,mousemove
事件,它们都不会更新当前地图的边界和中心。它仅在移动完成时更新
你可以用这样复杂的方式来解决这个问题
google.maps.event.addListener(map, 'dragstart', function(event) {
//save drag start bounds
//save mouse starting point
});
google.maps.event.addListener(map, 'drag', function(event) {
//get mouse moving distance
//calculate center from start bounds and mouse moving distance
});
google.maps.event.addListener(map, 'dragEnd', function(event) {
//save drag end bounds
});
我不知道你这样做的目的。但是,如果要动态显示标记,我将加载9个窗口的所有标记,这是中心更改限制的最大值
+--------+--------+--------+
: : : :
: : : :
+--------+========+--------+
: | view | :
: | port | :
+--------+========+--------+
: : : :
: : : :
+--------+--------+--------+
我需要它的原因是动态查看地图中心标记的详细信息。我在onthemap.at上有一个演示,但是谢谢,我只需要确认这是不可能的。我必须承认我不知道如何计算鼠标的距离