Jacksonkr
Jacksonkr

Reputation: 32247

javascript google maps v3.14 - how to hide poi now?

I don't know if it's google's recent changes in 3.14 or if I'm missing something but I need to get rid of local businesses / points of interest on my map. What's going on here? I need to hide disneyland and other similar points of interest.

var mapOptions = {
  zoom: 16,
  zoomControl:false,
  streetViewControl:false,
  panControl:false,
  mapTypeControl:false,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  styles: {
    featureType: "poi",
    //elementType: "labels",
    stylers: [{
      visibility: "off"
    }]
  }
};
var map = new google.maps.Map(
  document.getElementById("map"),
  mapOptions
);

Upvotes: 1

Views: 1413

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117354

styles is expected to be an array, but you provide an object.

Fixed style:

styles: [{
    featureType: "poi",
    //elementType: "labels",
    stylers: [{
        visibility: "off"
    }]
}]

http://jsfiddle.net/4mtyu/389/

Upvotes: 2

Related Questions