我在我的应用程序中初始化 map 是这样的:
function doLoad() {
var parnitha= new google.maps.LatLng(38.155428,23.718739);
var myOptions = {
zoom:16,
mapTypeId: google.maps.MapTypeId.SATELLITE,
center: parnitha,
disableDefaultUI: true,
navigationControl: true,
scrollwheel: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_LEFT},
}
map= new google.maps.Map(document.getElementById("map_canvas"), myOptions); }.
双击 map 会放大,我不想这样,因为出于其他原因我想使用 dbClick 事件。请帮我删除 map 上的默认 dbClick 事件。
非常感谢..
最佳答案
尝试在 map 选项对象中将 disableDoubleClickZoom
设置为 true
。它也记录在 http://code.google.com/apis/maps/documentation/javascript/reference.html
将您的 myOptions 对象更新为如下所示(注意第一个选项):
var myOptions = {
disableDoubleClickZoom: true,
zoom:16,
mapTypeId: google.maps.MapTypeId.SATELLITE,
center: parnitha,
disableDefaultUI: true,
navigationControl: true,
scrollwheel: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_LEFT},
}
关于google-maps - 在谷歌地图版本 3 中取消 map 上 dblclick 事件的缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4514157/