GWT Maps InfoWindow adding styles

50 views
Skip to first unread message

Buzzterrier

unread,
Nov 28, 2006, 5:10:15 PM11/28/06
to Google Web Toolkit
Hello,

I am having a great time with the GWT Maps Api. However, I have run
into an issue with InfoWindows. The short story is that I need to make
them scrollable, and the fix for that with the non-gwt api is to add
overflow:auto and set the height of the div. This does not appear to be
configurable through the api. I noticed that in GWT the Widget object
can set the css style, but the infoWindow does not inherit from Widget
or any other class in that hierarchy. I also looked at the derived
html, and the InfoWindow div does not have a class name associated with
it (I would have expected .gwt-InfoWindow).

Any ideas on this?

www.gtraffic.info

unread,
Nov 30, 2006, 11:57:50 AM11/30/06
to Google Web Toolkit
If I understand this correctly you are inserting a widget into the info
window through the call:

openInfoWindow( Element content, GInfoWindowOptions opts)

Why not encapsulate your widget in a composite of the widget and a
scrollpanel element and then insert that into the infowindow?

AL.

Buzzterrier

unread,
Dec 9, 2006, 1:17:55 PM12/9/06
to Google Web Toolkit
Thx. that worked great! Still on the uphill side of the gwt learning
curve.

Here is a code snippet for anyone else that is trying to do this.
...
public void onMouseOver(GMarker marker) {
ProjectInfo[] projects = country.getProjectInfo();

markup = "<ul>";
for (int i=0; i< projects.length; i++)
{
markup += "<li class='projInfoWindow'>" + projects[i].getTitle() +
"</li>";
}
markup += "</ul>";
if (projects.length > 5){
HTML hwidget = new HTML();
hwidget.setHTML(markup);
ScrollPanel scroller = new ScrollPanel(hwidget);
scroller.setStyleName("ks-layouts-Scroller");
marker.openInfoWindowHtml(scroller.toString());
}else{
marker.openInfoWindowHtml(markup);
}
}

On Nov 30, 8:57 am, "www.gtraffic.info"

Reply all
Reply to author
Forward
0 new messages