1

我想知道是否可以自定义平移和缩放颜色。从默认的白色到不同的颜色或添加渐变,也许。我是谷歌地图的新手,这就是我到目前为止的想法。

     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    
    });
      }
4

2 回答 2

1

map.gm-style > .gmnoprint > .gmnoprint { 把你的 CSS 放在这里}

#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}
于 2015-02-26T21:27:10.153 回答
0

没有实施这样的选项。但是控件最终只是图像(精灵),一旦地图完成加载,应该可以将它们更改src为不同颜色的自定义图像。

于 2013-01-30T22:16:01.577 回答