pombreda / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

Can't remove previous directions polygon from Google map #531

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
GWT newbie here, trying to render locations on a Google map. 

Found in Release: google-maps (v3)  

Detailed description:
I'm rendering directions on the map using a query ...

Directions.load(query, opts, new DirectionsCallback() { ... 

I grab the polygon after it has rendered successfully.

public void onSuccess(DirectionResults result) {
route = result.getPolyline();

However when I rerun the query using different locations the old directions are 
not being removed

I've tried to get the polygon 'route' set it to invisible and remove it from 
the map before loading a new query ...

route.setVisible(Boolean.FALSE);
map.removeOverlay(route);   

but this doesn't work.

Workaround if you have one:

Links to the relevant GWT Developer Forum posts:

Thanks in advance.

Original issue reported on code.google.com by peterche...@gmail.com on 5 Dec 2013 at 9:47

GoogleCodeExporter commented 9 years ago
Meant to say using gwt-maps.jar (v3)

Original comment by peterche...@gmail.com on 5 Dec 2013 at 9:48