views:

514

answers:

1

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?

+1  A: 

Try maxWidth.

marker.openInfoWindowHtml(
    $("#marker-popup-template").html(),
    { maxWidth: 400 }
);
Chris B
Thanks! Just what I needed!
jonathanconway