Found in Release: gwt-maps-1.1.0
Detailed description:
Suppose I have the following code when loading GeoXmlOverlay :
GeoXmlOverlay.load(url, new GeoXmlLoadCallback() {
@Override
public void onFailure(String s, Throwable throwable) {
Window.alert("Sorry, your map overlay failed");
GWT.log(s);
if (throwable != null) {
throwable.printStackTrace();
}
}
@Override
public void onSuccess(final String s, final GeoXmlOverlay geoXmlOverlay) {
GWT.log("Overlay success for " + s);
map.addOverlay(geoXmlOverlay);
}
});
Something strange is happening where the onSucess method is called again when
map.addOverlay(geoXmlOverlay) is called.
if map.addOverlay(geoXmlOverlay) is not called, no looping occurs.
A detailed explanation can also be found here :
http://groups.google.com/group/gwt-google-apis/browse_thread/thread/b8fbc5af81d0
e500/734c663bf414aa2e?#734c663bf414aa2e
Workaround if you have one:
public void onSuccess(final String s, final GeoXmlOverlay geoXmlOverlay) {
GWT.log("Overlay success for " + s);
if(!overlayCache.contains(geoXmlOverlay)){
overlayCache.add(geoXmlOverlay);
map.addOverlay(geoXmlOverlay);
}
}
Where overlayCache is just an ArrayList<GeoXmlOverlay>. This code still
results in the onSuccess method being called twice. The second time, the cache
has the overlay so map.addOverlay is not called.
Links to the relevant GWT Developer Forum posts:
http://groups.google.com/group/gwt-google-apis/browse_thread/thread/b8fbc5af81d0
e500/734c663bf414aa2e?#734c663bf414aa2e
Original issue reported on code.google.com by john.d.r...@gmail.com on 21 Mar 2011 at 4:10
Original issue reported on code.google.com by
john.d.r...@gmail.com
on 21 Mar 2011 at 4:10