我正在创建一个带有融合层的谷歌地图,以便网站的访问者可以获取有关各个州技术人员的信息。这里是网站供参考:http ://horizonwebtest.zxq.net/techmap.html地图需要锁定到美国大陆,所以我禁用了默认UI,可拖动,双击缩放,键盘快捷键,滚轮和自动平移。问题是当信息窗口弹出时,它仍然强制地图平移。有谁知道解决这个问题的方法?这是JavaScript:
// JavaScript Document
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(38.816223025492505, -94.15954943749999),
zoom: 4,
disableDefaultUI: true,
draggable: false,
disableDoubleClickZoom: true,
keyboardShortcuts: false,
scrollwheel: false,
disableAutoPan: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var horizonStyles = [
{
featureType: "water",
stylers: [
{ hue: "#0077ff" },
{ saturation: 20 },
{ lightness: -50 },
]
},{
featureType: "administrative.locality",
stylers: [
{ visibility: "off" }
]
},{
featureType: "administrative.province",
elementType: "labels.text.fill",
stylers: [
{ lightness: -80 }
]
}
];
var layer = new google.maps.FusionTablesLayer({
query: {
select: 'geometry',
from: '18KqZR_1Nd39CyWN1kKt8Pufd6wlLS2oQArpCugw'
},
});
var map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
map.setOptions({styles: horizonStyles});
layer.setMap(map);
}
任何想法将不胜感激。