I used react-google-maps
withGoogleMap
for the google map in ReactJs, also I am using styles
to change the custom view of my google map. in that map i have many polygons
with fill color.
the problem is that, my custom polygons
covered google map locality labels, so unable read proper label name.
here is my code
<GoogleMap
options={{
streetViewControl: false,
fullScreenControl: false,
disableDefaultUI: true,
styles: mapStyle,
}}
>
in the image you can see, it’s unable to read the label behind the polygons
so how can I set labels top of the polygons
?
2
Answers
I believe what happens when you create a polygon on the map is that it overlays the map which will overlay all the labels too, you can set opacity to below 1.
This is how you would do it using plain JS:
});
You can change the opacity level of the polygon on ‘zoom_changed’.
So when the level of zoom is lower you can set the opacity level to below 1 and when it’s higher you can set it to 1.
Check out this example here:
Well, I hope this helps.