我想知道是否可以自定义平移和缩放颜色。从默认的白色到不同的东西或添加渐变,也许。我是谷歌地图的新手,这是我到目前为止所得到的。
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(10.341908, 123.910602),
zoom: 16,
panControl: true,
panControlOptions: {
position: google.maps.ControlPosition.TOP_RIGHT
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE,
position: google.maps.ControlPosition.TOP_RIGHT
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),
mapOptions);
// Creating a marker and positioning it on the map
var marker = new google.maps.Marker({
position: new google.maps.LatLng(10.341908, 123.910602),
map: map
});
}
答案 0 :(得分:2)
#map .gm-style > .gmnoprint > .gmnoprint > div > img { display: none !important;}
#map .gm-style > .gmnoprint > .gmnoprint div[title="Pan up"] { put your css here}
#map .gm-style > .gmnoprint > .gmnoprint div[title="Pan down"] { put your css here }
#map .gm-style > .gmnoprint > .gmnoprint div[title="Pan right"] { put your css here}
#map .gm-style > .gmnoprint > .gmnoprint div[title="Pan left"] {background:url(images/positionbutton_left.png) no-repeat center center !important; put your css here}
#map .gm-style > .gmnoprint > .gmnoprint div[title="Zoom in"] {background:url(images/zoom_in.png) no-repeat center center !important; put your css here }
#map .gm-style > .gmnoprint > .gmnoprint div[title="Zoom out"] { put your css here }
#map .gm-style > .gmnoprint > .gmnoprint div[title="Drag to zoom"] { put your css here}
#map .gm-style > .gmnoprint > .gmnoprint div[title="Click to zoom"] { put your css here}
答案 1 :(得分:0)
没有实施这样的选择。但控件最终只是图像(精灵),一旦地图加载完毕,应该可以将他们的src
更改为不同颜色的自定义图像。