Hi all
I having a problem with the gwt google map v3.8 api
When i make a direction request with only source and destination i have a 
call back and it work 
When i add one or more waypoint then the call back do not occur. Here is my 
section of code.
It will be a great  help you can point out what i have done wrong here 
please


final MapOptions myOptions = MapOptions.create();
myOptions.setZoom(14.0);
myOptions.setMapTypeId(MapTypeId.ROADMAP);
map = GoogleMap.create(Document.get().getElementById("map_canvas"), 
myOptions);
LatLng source =  LatLng.create(41.850033, -87.6500523);
LatLng mid =  LatLng.create(30.008226,-100.283203);
LatLng destination =  LatLng.create(40.69847032728747,-73.9514422416687);
DirectionsRequest request = DirectionsRequest.create();
request.setOrigin(source);
request.setDestination(destination);
DirectionsWaypoint waypoint = DirectionsWaypoint.create();
waypoint.setLocation(mid);
waypoint.setStopover(true);
JsArray<DirectionsWaypoint> jsWaypoint = JsArray.createArray().cast();
jsWaypoint.push(waypoint);
request.setWaypoints(jsWaypoint);
request.setTravelMode(TravelMode.DRIVING);
JSONObject requestJson = new JSONObject(request);
request.setOptimizeWaypoints(true);

final DirectionsRenderer directionsRenderer = DirectionsRenderer.create();
directionsRenderer.setMap(map);
DirectionsService directionsService = DirectionsService.create();
directionsService.route(request, new DirectionsService.Callback(  ) {
@Override
public void handle(DirectionsResult a, DirectionsStatus b) {
System.out.println("here");
if(b == DirectionsStatus.OK){
directionsRenderer.setDirections(a);
}else{
System.out.println("Error");
}
}
});

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to