4

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.

Gagravarr
  • 47,320
  • 10
  • 111
  • 156
casey
  • 57
  • 1
  • 2
  • possible duplicate of [Close InfoWindow for local business marker](http://stackoverflow.com/questions/11335299/close-infowindow-for-local-business-marker) – geocodezip Apr 30 '14 at 16:29

3 Answers3

3

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.

danielmeade
  • 164
  • 1
  • 12
2

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" }]
        }
    ]
});
lewis4u
  • 14,256
  • 18
  • 107
  • 148
0

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" }
    ]
  }
];
Mehdi Benmoha
  • 3,694
  • 3
  • 23
  • 43