I've ported my GWT app to 1.7.0 from 1.5.2 and widgets that are used as a control on a GoogleMap no longer get ClickEvents. I've checked that the DOM insertion of the control is the same and there are no differences there. Since GWT 1.6 introduced a significant change in the way events are handled I'm thinking something has gone amis there.
I use a GWT image as a a GoogleMaps control:
Image control = new Image("/oeg/images/info_32.png");
Which I place on the map using the Mapitz GMaps lib (yes I know its old, but I have kept supporting a working version that is updated - if anyone is interested just ask)
GControlPosition infoPosition =
new GControlPosition(GControlAnchor.G_ANCHOR_TOP_RIGHT(),
new GSize(7, 30));
getGmap().addControl(new GControl(control, infoPosition));
I've checked the compiled code and it literally just puts the html element on the map as a GControl just the way you'd expect and as I said I've checked the DOM to make sure nothing looks funny.
to get ClickEvents I used to do this...
control.addClickListener(new ClickListener() {
public void onClick(Widget sender)
{
doTipOfTheDay();
}
});
which I changed to this in the 1.6.0 world,
control.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent ce)
{
doTipOfTheDay();
}
});
I've also tried explicitly sinking the click event with
control.sinkEvents(Event.ONCLICK);
but none of this works in GWT-1.6.0/1.7.0 and it all worked fabulously in 1.5.2
Can anyone shed some light on this? Has anyone else run into event issues w/ controls on GMaps with GWT 1.6 and above?
FYI with other Gmaps objects I have no problems. I'm getting mouse clicks on the map surface, on markers etc.
but controls, not so much