Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps visual refresh - how do disable font Roboto in InfoWindow

Just trying the new option google.maps.visualRefresh = true in the new version 3.12 of the Google maps javascript API. And although the map new look is great, now the text in my InfoWindows is using the font size Roboto.

The new InfoWindow content div CSS is:

font-family: Roboto, Arial, sans-serif;
font-size: 13px;
font-weight: 300;

This wasn't the case before and it doesn't work at all with the design of my website. Any idea how I could remove it to use the default font define in my body?

like image 865
Johann Avatar asked May 17 '13 15:05

Johann


People also ask

How do I change font in Google Maps?

Change text size On your Android phone or tablet, open the Settings app . Tap Accessibility. From here, you can: Change font size: To make words larger, tap Font size, and then set your preferred letter size.

How do I get rid of infowindow in Google Maps?

After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect.

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.


1 Answers

You can still use your own font in an InfoWindow. Simply provide HTML content instead of plain text, and you can style it any way you want with inline CSS or a stylesheet. Example in this fiddle:

var infowindow = new google.maps.InfoWindow({
    map: map,
    position: center,
    content: '<div class="myinfo">Computer History!</div>'
});

using this CSS:

.myinfo { font-family:Georgia,serif; font-size:18px; }
like image 136
Michael Geary Avatar answered Sep 24 '22 14:09

Michael Geary