Is it possible to eliminate the default map in the google map leaving only the map polygon?

StackOverflow https://stackoverflow.com/questions/22144397

  •  19-10-2022
  •  | 
  •  

문제

I'm making a custom map. First, by using the polygon and added to the map polygon. And I want to erase all the map except the polygon, but it is not. Can you solve this What if?

var styles = [ {
            featureType : "all",
            elementType : "all",
            stylers : [ {
                visibility : "off"
            } ]
        }
..... etc.........

I want to erase all the map except the polygon.(I want to eliminate not only the label but also the shape of the map.)

올바른 솔루션이 없습니다

다른 팁

This could be a red herring, but you might try removing the featureType and elementType from styles:

var styles = [
    {
        "stylers": [
            { "visibility": "off" }
        ]
    }
];

If that seems like a strange suggestion, it seems strange to me too. You would think that featureType and elementType "all" should work fine.

But the code above is what the Styled Map Wizard generates when I select All for feature type and element type and turn visibility off. And it does successfully remove everything from the map.

In case that doesn't make any difference, are you getting any styles to work at this point?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top