any example on using google map v3 with gwt1.6.4 through jsni ?
A:
How would you return a value back to the java code? e.g. I can get the duration of a trip with the below code, but how can I then get it back to my java code?
protected native String getDuration() /*-{
var directionsService = new $wnd.google.maps.DirectionsService();
var start = "penn station, new york, ny";
var end = "grand central station, new york, ny";
var request = {
origin: start,
destination: end,
travelMode: $wnd.google.maps.DirectionsTravelMode.WALKING
};
var duration = "not set";
directionsService.route(request, function(response, status) {
if (status == $wnd.google.maps.DirectionsStatus.OK) {
duration = response.routes[0].legs[0].duration.text;
}
});
}-*/;
Stephen
2010-08-15 00:23:36