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