onClick not pass GMarker as GOverlay when clicking on marker
Brought to you by:
lenulus
It seems that the GMap2EventClickListener.onClick(GMap2 map, GOverlay overlay, GLatLng point) does not receive a GMarker through the parameter overlay if the user clicks on a marker. The browser reports javascript errors, and the window alert never appears, for the code at the end. This code is similar to the Javascript version as described in the Section "Click Handling" of
http://code.google.com/p/gwt-google-apis/wiki/MapsAPIDesign
public void onClick
(GMap2 map,
GOverlay overlay,
GLatLng point)
{
if (overlay != null && overlay instanceof GMarker) {
Window.alert("clicked on a marker");
return;
}
GMarker marker = addMarker(map, point, null);
}
Logged In: NO
Same reporter: the workaround is just only checking if overlay is null. If it is not null, we assume it is a marker.