Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to embed the following map on my website:

https://maps.google.co.uk/maps?q=67+Bridge+Street,+Chester&hl=en&sll=53.16379,-2.737316&sspn=0.678421,2.113495&oq=67+bridge+&hnear=67+Bridge+St,+Chester+CH1+1NW,+United+Kingdom&t=m&z=16

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

like image 486
geoffs3310 Avatar asked Nov 13 '13 15:11

geoffs3310


People also ask

How do I get rid of the boxes in the new Google Maps embeds?

Adding the URL into an iframeThe frameborder="0" and style="border:0" properties to remove the standard iframe border from around the map.

Can you mark out an area on Google Maps?

Add line or shape. Click each corner or bend of your line or shape. To move the map, click and hold the mouse. When you're finished drawing, double-click or complete the shape. Give your line or shape a name.


1 Answers

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});
like image 129
pqteru Avatar answered Oct 12 '22 22:10

pqteru