Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the info window from an embedded map in the new Google Maps

In years past, it was easy to remove the info window from an embedded Google Maps. Just add iwloc=near in the query string.

In the past few weeks, Google has migrated to a NEW embed query string format, to coincide with their new Maps product.

Does anybody know how to hide the info bubble with the new query string? I do want to keep the marker icon (obstructed by the info window). I tried including iwloc=near before the rest of the query string, but that did nothing. I don't see any option on the new Embedded Map builder, either.

<iframe 
src="https://www.google.com/maps/embed?iwloc=near&pb=!1m20!1m8!1m3!1d3246.3028987305834!2d-97.52973594999999!3d35.5462208!3m2!1i1024!2i768!4f13.1!4m9!1i0!3e6!4m0!4m5!1s0x87b21a2b843c4d5f%3A0xd6deac9724fb9935!2s7316+N+Western+Ave%2C+Oklahoma+City%2C+OK+73116!3m2!1d35.5462208!2d-97.5297267!5e0!3m2!1sen!2sus!4v1394217557679" 
width="420" 
height="200" 
frameborder="0" 
style="border:0">
</iframe>

Here is what is output. Note the info window, bordered in red, that I wish to remove.

Google Maps sample info window output

like image 365
Patrick Moore Avatar asked Mar 07 '14 18:03

Patrick Moore


People also ask

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

On the page you've placed the map, if you right click > Inspect to open the browser dev tools you can look at the code the embed creates, find the elements you want removed and what classes/ids they're using, and use CSS to hide them.

How do you remove map information labels?

Find the “Layers” menu in the bottom left corner of the screen. Hover your cursor over the box and wait until more options appear. Click “More” to open the Map Details menu. Under “Map Type,” you'll see a checked box next to “Labels.” Uncheck it to remove all labels.

What is info window in Google Map?

An InfoWindow displays content (usually text or images) in a popup window above the map, at a given location. The info window has a content area and a tapered stem. The tip of the stem is attached to a specified location on the map. Info windows appear as a Dialog to screen readers.


2 Answers

It looks like they've overhauled the way the embedded maps api works...

From the new docs, it looks like you can definitely remove the bubble by making request in "view mode" instead of "place mode". However this will result in no marker either.

It doesn't have much to say on what options are supported for place mode, but you might try updating your URL to the new place endpoint and then experimenting with some of the legacy options.

Update

I tested it myself using the new google.com/maps/embed/v1/place/... endpoint and it doesn't work if you add &iwloc to that. In fact, it will throw an error about the unsupported parameter.

Unfortunately, it appears that the new API only supports these parameters:

The following optional parameters can be used with any of the map modes listed above.

center defines the center of the map view. It accepts either a comma-separated latitude and longitude value (such as 37.4218,-122.0840) or a place name or address string (such as Champ+de+Mars,Paris,France).

zoom sets the initial zoom level of the map. Accepted values range from 0 (the whole world) to 21 (individual buildings). The upper limit can vary depending on the map data available at the selected location.

maptype can be either roadmap (the default) or satellite, and defines the type of map tiles to load.

language defines the language to use for UI elements and for the display of labels on map tiles. Note that this parameter is only supported for some country tiles; if the specific language requested is not supported for the tile set, then the default language for that tileset will be used. By default, visitors will see a map in their own language.

region defines the appropriate borders and labels to display, based on geo-political sensitivities. Accepts a region code specified as a two-character ccTLD (top-level domain) value.

Sorry to be the bearer of bad news.

like image 168
emersonthis Avatar answered Oct 11 '22 07:10

emersonthis


Try entering latitude & longitude coordinates instead of address. Was just now pleasantly surprised it generated the iframe code without address block overlay.

like image 37
FBT Avatar answered Oct 11 '22 06:10

FBT