How do I remove nearby places when embedding google map in an iframe?
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});
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, 2022Comments
-
geoffs3310 almost 2 years
I want to embed the following map on my website:
The map has a marker for the desired address but then it also has markers for nearby places like Costa coffee, Eastgate clock etc.
Is there a way to embed the map without markers for any other places on it?
Just to clarify I want to keep the big red marker but remove all the other places of interest and businesses