谷歌地图风格(API) - 使用JavaScript

时间:2013-02-17 23:18:45

标签: google-maps-api-3 google-fusion-tables

我正在尝试应用此向导中的代码http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html

例如:

[
  {
    "elementType": "geometry",
    "stylers": [
      { "hue": "#00ccff" },
      { "visibility": "simplified" }
    ]
  }
]
<{3>}代码中的

是谁愿意帮忙?我真诚地不知道热情继续下去。

1 个答案:

答案 0 :(得分:0)

将问题中的示例数组传递给地图的styles - 选项:

       map = new google.maps.Map(document.getElementById('map-canvas'), {
          center: new google.maps.LatLng(48.70727541512677,
                                         20.578157256250062),
          zoom: 7, 
          styles:[
  {
    "elementType": "geometry",
    "stylers": [
      { "hue": "#00ccff" },
      { "visibility": "simplified" }
    ]
  }
],
          panControl: false,
    zoomControl: true,
    zoomControlOptions: {
      style: google.maps.ZoomControlStyle.SMALL
    },
        streetViewControl: false,
        mapTypeControl: true,
    mapTypeControlOptions: {
      style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,

},


      mapTypeId: google.maps.MapTypeId.ROADMAP

});

http://jsbin.com/owaxas/1/edit