How can I remove points of interest from google maps via API that is always rendered? I mean those points: http://j.mp/1ktcaeB
I've seen it removed in couple of websites, but I couldn't find a way How to do it.
Thanks for any advice.
How can I remove points of interest from google maps via API that is always rendered? I mean those points: http://j.mp/1ktcaeB
I've seen it removed in couple of websites, but I couldn't find a way How to do it.
Thanks for any advice.
This should do the trick:
var myStyles =[
{
featureType: "poi",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
Don't forget to add styles: myStyles
to var myOptions = {...}
also.
Take a look at the Styled Maps docs too.
You need to initialize the map like this:
map = new google.maps.Map(document.getElementById('map'), {
zoom: 6,
center: {lat: 51, lng: 10},
styles: [
{
featureType: "poi",
elementType: "labels",
stylers: [{ visibility: "off" }]
}
]
});
Just in case you are using TypeScript you will need to cast the MapTypeStyle array like this:
const noPoiStyle = <google.maps.MapTypeStyle[]> [
{
featureType: "poi",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];