谷歌地图v3中的弹性标记 [英] Bouncy marker in Google Maps v3

查看:102
本文介绍了谷歌地图v3中的弹性标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Maps API v2中,我们可以设置标记选项 bouncy:true 。它增加了标记眼睛的糖果能力 - 拖动这个标记后,它会弹起来。



API v3中可以做什么?


不要惊讶地发现,这在某些时候会被实现到v3 API中 - 它仍然处于测试阶段,并且会发生一些变化。





如果您真的想要V3 Map中的行为,您可以将事件绑定到dragend方法标记对象。有称为改变MarkerImage对象的锚点的函数 - 也检查API中的MarkerImage对象。


In Google Maps API v2 we can set to marker an option bouncy:true. It adds to marker eye-candy ability - after dragging this marker, it is bouncing.

Is it possible to do in API v3 ?

解决方案

I just had a quick look at the API v3 spec for Markers - it doesn't look like the 'bouncy' option is available right now but I wouldn't be surprised to see this get implemented into the v3 API at some point - it's still in Beta and bound to change quite a bit.

If you really wanted the behavior in a V3 Map now you could tie an event to the 'dragend' method on the Marker Object. Have the function called alter the anchor point of the MarkerImage object - check out the MarkerImage object in the API too.

这篇关于谷歌地图v3中的弹性标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆