2017-11-11 11 views

答えて

1

コード検査をもう一度見て、//we define here the style of the mapという行を探して、コードのその部分がGoogleマップの外観を変更するものであることを確認します。さらにカスタマイズするために

、あなたはここで、これらのサイトをチェックアウトすることができます:

https://snazzymaps.com/
https://mapstyle.withgoogle.com/

0

Google Maps APIを使用しているだけで、レンダリングされたマップのスタイルを調整していると思います。ここにAPIへのリンクがあります。 https://developers.google.com/maps/

また、どのような関数呼び出しを行っているかを調べることもできます。デベロッパーのデベロッパーツール(Chromeを使用していることを前提にしていますが、他のブラウザーでも同様です)に移動します。次に、開発者ツールペインの上部バーにある[ソース]を選択します。デベロッパーツールペインの左側にあるソースセクションでインデックスファイルを探します。コードが表示されているセクションの下部にある{}ボタンを押します。これはコードを読みやすくします。それを見て、Googleマップに関連するものを見てください。 Ctrl + Fキーでも検索できます。

代わりにGoogle Maps APIサイトを読むことをお勧めします。

0

を新しいマップ、おしゃれなマップを宣言するときは、スタイルを設定することができますGoogleマップのカラースキームのための優れたリソースです。

ちょうどあなたが(hereからカラースキーム)を使用しているものは何でもしてthis.refs.map置き換え、次のことを試してみてください。

var mapStyle =[ 
    { 
     "featureType": "administrative.country", 
     "elementType": "geometry.fill", 
     "stylers": [ 
      { 
       "color": "#ededed" 
      }, 
      { 
       "gamma": "0.00" 
      }, 
      { 
       "lightness": "-100" 
      }, 
      { 
       "saturation": "-67" 
      } 
     ] 
    }, 
    { 
     "featureType": "administrative.locality", 
     "elementType": "all", 
     "stylers": [ 
      { 
       "saturation": 7 
      }, 
      { 
       "lightness": 19 
      }, 
      { 
       "visibility": "on" 
      } 
     ] 
    }, 
    { 
     "featureType": "administrative.locality", 
     "elementType": "labels.text", 
     "stylers": [ 
      { 
       "visibility": "on" 
      }, 
      { 
       "saturation": "-3" 
      } 
     ] 
    }, 
    { 
     "featureType": "administrative.locality", 
     "elementType": "labels.text.fill", 
     "stylers": [ 
      { 
       "color": "#abb1c8" 
      } 
     ] 
    }, 
    { 
     "featureType": "landscape", 
     "elementType": "all", 
     "stylers": [ 
      { 
       "hue": "#ffffff" 
      }, 
      { 
       "saturation": -100 
      }, 
      { 
       "lightness": 100 
      }, 
      { 
       "visibility": "simplified" 
      } 
     ] 
    }, 
    { 
     "featureType": "landscape.man_made", 
     "elementType": "geometry", 
     "stylers": [ 
      { 
       "lightness": "20" 
      }, 
      { 
       "saturation": "-26" 
      }, 
      { 
       "gamma": "2.33" 
      }, 
      { 
       "color": "#f5f5f5" 
      } 
     ] 
    }, 
    { 
     "featureType": "poi", 
     "elementType": "all", 
     "stylers": [ 
      { 
       "hue": "#ff0000" 
      }, 
      { 
       "saturation": -100 
      }, 
      { 
       "lightness": 100 
      }, 
      { 
       "visibility": "off" 
      } 
     ] 
    }, 
    { 
     "featureType": "poi", 
     "elementType": "labels.text.fill", 
     "stylers": [ 
      { 
       "color": "#ffffff" 
      }, 
      { 
       "lightness": "-19" 
      } 
     ] 
    }, 
    { 
     "featureType": "poi.medical", 
     "elementType": "geometry", 
     "stylers": [ 
      { 
       "visibility": "off" 
      } 
     ] 
    }, 
    { 
     "featureType": "poi.school", 
     "elementType": "geometry.fill", 
     "stylers": [ 
      { 
       "visibility": "off" 
      } 
     ] 
    }, 
    { 
     "featureType": "road", 
     "elementType": "geometry", 
     "stylers": [ 
      { 
       "saturation": "100" 
      }, 
      { 
       "lightness": 31 
      }, 
      { 
       "visibility": "simplified" 
      } 
     ] 
    }, 
    { 
     "featureType": "road", 
     "elementType": "geometry.stroke", 
     "stylers": [ 
      { 
       "visibility": "on" 
      } 
     ] 
    }, 
    { 
     "featureType": "road", 
     "elementType": "labels", 
     "stylers": [ 
      { 
       "hue": "#008eff" 
      }, 
      { 
       "saturation": -93 
      }, 
      { 
       "lightness": 31 
      }, 
      { 
       "visibility": "on" 
      } 
     ] 
    }, 
    { 
     "featureType": "road", 
     "elementType": "labels.text.fill", 
     "stylers": [ 
      { 
       "color": "#d2d1d1" 
      } 
     ] 
    }, 
    { 
     "featureType": "road", 
     "elementType": "labels.text.stroke", 
     "stylers": [ 
      { 
       "visibility": "on" 
      } 
     ] 
    }, 
    { 
     "featureType": "road.highway", 
     "elementType": "geometry.fill", 
     "stylers": [ 
      { 
       "lightness": "3" 
      }, 
      { 
       "color": "#ebebeb" 
      }, 
      { 
       "saturation": "-17" 
      } 
     ] 
    }, 
    { 
     "featureType": "road.highway", 
     "elementType": "geometry.stroke", 
     "stylers": [ 
      { 
       "lightness": "-15" 
      }, 
      { 
       "visibility": "off" 
      } 
     ] 
    }, 
    { 
     "featureType": "road.arterial", 
     "elementType": "geometry.stroke", 
     "stylers": [ 
      { 
       "visibility": "simplified" 
      }, 
      { 
       "color": "#e8e8e8" 
      }, 
      { 
       "saturation": "0" 
      } 
     ] 
    }, 
    { 
     "featureType": "road.arterial", 
     "elementType": "labels", 
     "stylers": [ 
      { 
       "hue": "#bbc0c4" 
      }, 
      { 
       "saturation": -93 
      }, 
      { 
       "lightness": -2 
      }, 
      { 
       "visibility": "simplified" 
      } 
     ] 
    }, 
    { 
     "featureType": "road.arterial", 
     "elementType": "labels.text", 
     "stylers": [ 
      { 
       "visibility": "off" 
      } 
     ] 
    }, 
    { 
     "featureType": "road.local", 
     "elementType": "geometry", 
     "stylers": [ 
      { 
       "hue": "#4e00ff" 
      }, 
      { 
       "saturation": "-100" 
      }, 
      { 
       "lightness": "100" 
      }, 
      { 
       "visibility": "simplified" 
      }, 
      { 
       "weight": "1" 
      } 
     ] 
    }, 
    { 
     "featureType": "transit", 
     "elementType": "all", 
     "stylers": [ 
      { 
       "hue": "#e9ebed" 
      }, 
      { 
       "saturation": 10 
      }, 
      { 
       "lightness": 69 
      }, 
      { 
       "visibility": "on" 
      } 
     ] 
    }, 
    { 
     "featureType": "transit.line", 
     "elementType": "geometry.fill", 
     "stylers": [ 
      { 
       "color": "#e7e7e7" 
      } 
     ] 
    }, 
    { 
     "featureType": "transit.station.bus", 
     "elementType": "geometry", 
     "stylers": [ 
      { 
       "visibility": "on" 
      } 
     ] 
    }, 
    { 
     "featureType": "transit.station.bus", 
     "elementType": "geometry.fill", 
     "stylers": [ 
      { 
       "color": "#ffffff" 
      } 
     ] 
    }, 
    { 
     "featureType": "water", 
     "elementType": "all", 
     "stylers": [ 
      { 
       "hue": "#e9ebed" 
      }, 
      { 
       "saturation": -78 
      }, 
      { 
       "lightness": 67 
      }, 
      { 
       "visibility": "simplified" 
      } 
     ] 
    }, 
    { 
     "featureType": "water", 
     "elementType": "geometry", 
     "stylers": [ 
      { 
       "visibility": "on" 
      }, 
      { 
       "lightness": "-3" 
      } 
     ] 
    } 
] 
    var map = new google.maps.Map(this.refs.map,{ 
     center: center, 
     zoom: 10, 
     styles : mapStyle 
    }); 
関連する問題