Maps API JavaScript - Building Styling

Here's the problem:

enter image description here

I have a google maps display in style. I can't seem to believe that the university buildings were unpainted and stroked like the rest of the buildings. I looked at the documentation here: https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType

and tried them all, but none of them work.

Here is my style:

[
   {
      "featureType":"water",
      "elementType":"geometry",
      "stylers":[
         {
            "color":"#193341"
         }
      ]
   },
   {
      "featureType":"landscape",
      "elementType":"geometry.fill",
      "stylers":[
         {
            "color":"#2c5a71"
         }
      ]
   },
   {
      "featureType":"landscape",
      "elementType":"geometry.stroke",
      "stylers":[
         {
            "color":"#2c5a71"
         },
         {
            "lightness":-50
         }
      ]
   },
   {
      "featureType":"road",
      "elementType":"geometry",
      "stylers":[
         {
            "color":"#29768a"
         },
         {
            "lightness":-37
         }
      ]
   },
   {
      "featureType":"poi",
      "elementType":"geometry",
      "stylers":[
         {
            "color":"#406d80"
         }
      ]
   },
   {
      "featureType":"transit",
      "elementType":"geometry",
      "stylers":[
         {
            "color":"#406d80"
         }
      ]
   },
   {
      "elementType":"labels.text.stroke",
      "stylers":[
         {
            "visibility":"on"
         },
         {
            "color":"#3e606f"
         },
         {
            "weight":2
         },
         {
            "gamma":0.84
         }
      ]
   },
   {
      "elementType":"labels.text.fill",
      "stylers":[
         {
            "color":"#ffffff"
         }
      ]
   },
   {
      "featureType":"administrative",
      "elementType":"geometry",
      "stylers":[
         {
            "weight":0.6
         },
         {
            "color":"#1a3541"
         }
      ]
   },
   {
      "featureType":"poi",
      "elementType":"labels",
      "stylers":[
         {
            "visibility":"off"
         }
      ]
   },
   {
      "featureType":"poi.park",
      "elementType":"geometry",
      "stylers":[
         {
            "color":"#2c5a71"
         }
      ]
   },
   {
      "featureType":"landscape",
      "elementType":"geometry",
      "stylers":[
         {
            "hue":"#406d80"
         },
         {
            "gamma":1
         },
         {
            "lightness":1
         },
         {
            "saturation":0
         }
      ]
   },
   {
      "featureType":"poi",
      "elementType":"geometry",
      "stylers":[
         {
            "visibility":"off"
         }
      ]
   }
]

Is it even possible to change the colors of a building?

+4
source share
1 answer

Buildings on your map that do not receive styles show internal maps. I think what you want to do is create internal maps.

, , . , , :

Google

:

[
  {"stylers": [ {"visibility": "off" } ] },
  {"featureType": "water","stylers": [{"visibility": "on"} ] },
  {"featureType": "poi","stylers": [ {"visibility": "on"} ]},
  {"featureType": "transit","stylers": [{ "visibility": "on"}] },
  { "featureType": "landscape","stylers": [ { "visibility": "on" } ] },
  { "featureType": "road", "stylers": [{ "visibility": "on" } ] },
  { "featureType": "administrative",  "stylers": [{ "visibility": "on" } ] },
  /* followed by your style if you have specific styles
    , otherwise remove the last comma */

]
0

Source: https://habr.com/ru/post/1534354/


All Articles