Hello Miguel,
This resolves issue 171 - which was apparently due to a core GWT issue. It
also adds a few more tests to the DirectionsTest, and updates the Marker
class to properly extract Markers from a list.
M maps/maps/test/com/google/gwt/maps/client/geocode/DirectionsTest.java
M maps/maps/src/com/google/gwt/maps/client/overlay/Marker.java
--
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---
M maps/maps/test/com/google/gwt/maps/client/geocode/DirectionsTest.java
M maps/maps/src/com/google/gwt/maps/client/overlay/Marker.java
Index: maps/maps/test/com/google/gwt/maps/client/geocode/DirectionsTest.java
===================================================================
--- maps/maps/test/com/google/gwt/maps/client/geocode/DirectionsTest.java (revision 790)
+++ maps/maps/test/com/google/gwt/maps/client/geocode/DirectionsTest.java (working copy)
@@ -17,7 +17,11 @@
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.maps.client.MapWidget;
+import com.google.gwt.maps.client.overlay.Marker;
+import com.google.gwt.maps.client.overlay.Polyline;
+import java.util.List;
+
/**
* Tests for the geocoding service and supporting classes.
*/
@@ -58,9 +62,12 @@
assertNotNull("result.getMarkers()", result.getMarkers());
assertNotNull("result.getRoutes()", result.getRoutes());
assertNotNull("result.getSummaryHtml()", result.getSummaryHtml());
-// TODO(zundel): this call fails with a ClassCastException from the generated JSIO method DirectionsImplImpl.getPolyline()
-// Polyline p = result.getPolyline();
-// assertNotNull("polyline", p);
+ Polyline p = result.getPolyline();
+ assertNotNull("polyline", p);
+ List<Marker> markers = result.getMarkers();
+ assertNotNull("markers", markers);
+ assertNotNull("markers.get(0)", markers.get(0));
+ assertNotNull("markers.get(1)", markers.get(1));
finishTest();
}
});
Index: maps/maps/src/com/google/gwt/maps/client/overlay/Marker.java
===================================================================
--- maps/maps/src/com/google/gwt/maps/client/overlay/Marker.java (revision 790)
+++ maps/maps/src/com/google/gwt/maps/client/overlay/Marker.java (working copy)
@@ -72,7 +72,10 @@
@SuppressWarnings("unused")
private static final Extractor<Marker> __extractor = new Extractor<Marker>() {
public native Marker fromJS(JavaScriptObject jso) /*-{
- return jso.__gwtPeer == null ? null : jso.__gwtPeer;
+ if (jso.__gwtPeer == null) {
+ return @com.google.gwt.maps.client.overlay.Marker::createPeer(Lcom/google/gwt/core/client/JavaScriptObject;)(jso);
+ }
+ return jso.__gwtPeer;
}-*/;
public JavaScriptObject toJS(Marker o) {