How do I remove nearby places when embedding google map in an iframe?

10,852

Google Map api allows developer to control its appearance, refer to syntax styling

Map Features: A map consists of a set of features, such as a road or park, which are specified using a MapTypeStyleFeatureType. The feature types form a category tree, with all as the root. The full list of features for selection within a map is documented in the Maps Javascript API V3 Reference. Specifying the feature as all will select all map elements.

google.maps.MapTypeStyleFeatureType includes many values for feature types, i.e. road.labels, landscape.natural, poi.business, in your case, the way to hide other business place, here is an example to achieve:

var styles = [
  {
    featureType: "poi",
    elementType: "business",
    stylers: [
      { visibility: "off" }
    ]
  }
];

map.setOptions({styles: styles});
Share:
10,852
geoffs3310
Author by

geoffs3310

Computer Science BSc 2.1 Degree. Full Time web developer 3 years experience. OOPHP5, MySql, CakePHP, Codeigniter, MVC, javascript, jquery, wordpress, opencart, interspire, HTML, CSS

Updated on June 13, 2022

Comments