Ian*_*ell 14 draggable google-maps-api-3
在Google Maps v3参考中,我看到有一种方法setDraggable(boolean)可以应用于地图标记.
不过,我想设置setDraggable来true开启地图,没有在地图上标记.
我已在属性设置draggable来false在在MapOptions,但我不知道如何设置这true以后...... map.setDraggable(true)就不能正常工作:
// object literal for map options
var myOptions =
{
center: new google.maps.LatLng(37.09024, -95.712891),
zoom: 4, // smaller number --> zoom out
mapTypeId: google.maps.MapTypeId.TERRAIN,
// removing all map controls
disableDefaultUI: true,
// prevents map from being dragged
draggable: false,
// disabling all keyboard shortcuts
keyboardShortcuts: false,
disableDoubleClickZoom: true,
// do not clear the map div
noClear: true
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
map.setDraggable(true); // does NOT work!
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
27302 次 |
| 最近记录: |