开发者

How do I toggle 'draggable' for Google Maps GMarker object?

开发者 https://www.devze.com 2023-01-03 06:28 出处:网络
I want to have draggable markers (already done), but I need to be able to turn off draggability in certain conditions.

I want to have draggable markers (already done), but I need to be able to turn off draggability in certain conditions.

Marker is created like this;

var Marker = new GMarker(center,{draggable:true});  

...which works fine. But I can't figure ou开发者_StackOverflow中文版t how to make it undraggable.


like this

var myMarker = new GMarker(center,{draggable:true}); 
myMarker.disableDragging();

http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMarker.disableDragging

0

精彩评论

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