Patch to the library

22 views
Skip to first unread message

Ben

unread,
Jan 8, 2012, 5:57:47 PM1/8/12
to gwt-maps3-discuss
Hello,

First thanks for making this library available.

I think I have fixed a couple of issues:

1. Routes
a. Directions given in walking / driving were not working for me at
least
b. Units are given as a number (int) rather than a string
2. Polylines could not be removed as setting their map to null threw a
null pointer exception rather than passing the null down.

The patch can be found here:

https://github.com/benjgibbs/GWTCycleRoutePlanner/blob/master/GWTCycleRoutePlanner/gwt-google-maps-v3.patch

Kind Regards

Ben

ZehnVon12

unread,
Jan 20, 2012, 9:43:40 AM1/20/12
to gwt-maps3-discuss
Hi Ben,

thank you for that patch.
With it everything works fine.

Gruß
Michael

ZehnVon12

unread,
Jan 27, 2012, 11:20:01 AM1/27/12
to gwt-maps3-discuss
Hi,

I use the code

final HasDirectionsRequest req = new DirectionsRequest();
req.setOriginLatLng(latLng);
req.setDestinationLatLng(destination);
String travelMode = new DirectionsTravelMode().Driving();
req.setTravelMode(travelMode);

final HasDirectionsService service = new DirectionsService();

if (!GWT.isScript())
{
removeGwtObjectId(req.getJso());
}

service.route(req, new DirectionsCallback()
{
@Override
public void callback(HasDirectionsResult res, String status)
{

if (status.equals("OK"))
{
HasDirectionsRendererOptions options = new
DirectionsRendererOptions();
options.setDirections(response);
options.setMap(mapWidget.getMap());
new DirectionsRenderer(options);
}
}
});

to display a route on the map and it work fine. But how is it possible
to clear the route on the map to display another one?

Gruß
Michael


On 8 Jan., 23:57, Ben <benjgi...@gmail.com> wrote:
> Hello,
>
> First thanks for making this library available.
>
> I think I have fixed a couple of issues:
>
> 1. Routes
>  a. Directions given in walking / driving were not working for me at
> least
>  b. Units are given as a number (int) rather than a string
> 2. Polylines could not be removed as setting their map to null threw a
> null pointer exception rather than passing the null down.
>
> The patch can be found here:
>
> https://github.com/benjgibbs/GWTCycleRoutePlanner/blob/master/GWTCycl...
>
> Kind Regards
>
> Ben

mo

unread,
Jan 30, 2012, 1:19:06 PM1/30/12
to gwt-maps3-discuss
Hi,

I'm having the same issue with removing rendered directions... when
trying to set the map of the directionRenderer to null via
setMap(null) it throws a NPE. The java script api apparently
(according to http://stackoverflow.com/questions/5645920/remove-directions-from-google-map-api-v3
) would allow it though.
Imho, the wrapper is wrong there and should be fixed.

As a workaround, I'm setting a map that I'm not displaying. I guess
that's a valid workaround, but I don't know how much overhead that
causes over a clean solution.

regards,
Mark
Reply all
Reply to author
Forward
0 new messages