Question

On click of a marker, I'm opening an InfoWindow on a Google Map.

The code is like this:

var point = 
    new GLatLng(
        mPointSet.points[i].lat,
        mPointSet.points[i].long);

var marker = new GMarker(point);

function createMarker(marker, message)
{
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(
            $("#marker-popup-template").html());
    });
}

createMarker(marker);

mBigMap.addOverlay(marker);

The problem is, even though the that the InfoWindow is being populated with has been styled to be 200 px max-width, the InfoWindow still renders too wide, at around 400 px.

Is there a way to make it smaller?

Was it helpful?

Solution

Try maxWidth.

marker.openInfoWindowHtml(
    $("#marker-popup-template").html(),
    { maxWidth: 400 }
);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top