Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

custom infowindow box with google maps api v3?

I am trying to have a custom infowindow box in the google maps api. If that is not possible, I want to at least remove the rounded corners for the popup. Is this possible?

I tried useing

InfoWindow({
    content: "<h3>" + title + "</h3>",
    boxStyle: { styles }
})

but boxStyle does nothing.

like image 443
Phil Avatar asked Mar 26 '11 18:03

Phil


People also ask

How do you change the InfoWindow position on Google Maps?

An InfoWindow can be placed on a map at a particular position or above a marker, depending on what is specified in the options. Unless auto-pan is disabled, an InfoWindow will pan the map to make itself visible when it is opened. After constructing an InfoWindow, you must call open to display it on the map.

How do I show multiple Infowindows on Google Maps?

Initialize google. maps. InfoWindow() for info windows popup. Loop through the locations (markers) and set the marker position with options (position, map, title, etc.)

How do I add buttons to InfoWindow?

addListener(marker, 'click', function() { infowindow. setContent('<p>Event Name: '+this. title+'</p>' + '<p>Event Type: '+this. etype+'</p>' + '<p>Cause: '+this.

How do I add a tooltip to Google Maps?

You can either use "title" and "url", or infowindow with href embedded, to provide tooltips and hyperlinks for map markers.


1 Answers

You can use an InfoBox class from Google Maps Utility Library. Or you can write a custom class overriding the default styling

like image 138
Michal Avatar answered Sep 28 '22 19:09

Michal