1
我正在創建一個具有融合層的Google地圖,因此網站的訪問者可以獲得有關各個州的技術人員的信息。以下是供參考的網址:http://horizonwebtest.zxq.net/techmap.html地圖需要鎖定到美國大陸,所以我禁用了默認UI,可拖動,雙擊縮放,鍵盤快捷鍵,滾輪和自動平移。問題是當信息窗口彈出時,它仍然強制地圖平移。有沒有人知道解決這個問題的方法?這裏是JavaScript:谷歌地圖API v3停止信息框從平移地圖
// 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);
}
任何想法將不勝感激。