Thanks Marcelo, that works perfectly. I guess I wasn't aware, that you can open an infowindow at a marker, that is defined but not currently displayed on the map.
Actually, it turns out that I don't need the flag at all. I just check if gdir.getNumRoutes() > 0. If true then use the endpoint marker of the route, otherwise use the original marker. Just for reference, here is the working map: http://www.einberg-volleyball.de/maps/test/directions3.shtml Jürgen On Jan 15, 4:15 pm, marcelo <[email protected]> wrote: > Ah, but your 'flag' variable is not reset when there is an error. > > Add to the error function: > > function handleErrors() { > alert("Error (status=" + gdir.getStatus().code + ")"); > flag = "original"; > > } > > -- > Marcelo -http://maps.forum.nu > -- > > On Jan 15, 1:38 pm, Jürgen <[email protected]> wrote: > > > > > Oops, wrong adress. This one is > > correct:http://www.einberg-volleyball.de/maps/test/directions2.shtml > > > On 15 Jan., 13:36, Jürgen <[email protected]> wrote: > > > > I think I did give the map as the first parameter to the constructor. > > > However, I can't get it work properly without map.clearOverlays(). See > > > yourself:http://einberg/maps/test/directions2.shtml > > > > On 15 Jan., 13:18, marcelo <[email protected]> wrote: > > > > > Its because in the function onGDirectionsLoad() you're doing > > > > map.clearOverlays(). > > > > If you've given the map as the first parameter to the GDirections() > > > > constructor, you don't need to clearOverlays yourself. The GDirections > > > > object does it for you. > > > > > -- > > > > Marcelo -http://maps.forum.nu > > > > -- > > > > > On Jan 15, 11:43 am, Jürgen <[email protected]> wrote: > > > > > > I have a map where a user can request direction to a given place. > > > > > Suppose the first user request has a valid response and the directions > > > > > are displayed just fine. > > > > > > Then suppose he tries to calculate a non existing route and the > > > > > request fails. > > > > > > Now my problem: > > > > > When he tries again with an existing route, this route is not display > > > > > correctly. Meaning the polyline is not printed on the map and the user > > > > > can't click on the direction steps the view the usual blowup. However, > > > > > the map dimensions are adjusted as usual to show both ends of the > > > > > route plus the complete route. > > > > > > Everything is explained in detail > > > > > here:http://www.einberg-volleyball.de/maps/test/directions.shtml > > > > > > What am I doing wrong? Is there a workaround? > > > > > > Jürgen- Zitierten Text ausblenden - > > > > > - Zitierten Text anzeigen -- Zitierten Text ausblenden - > > > > - Zitierten Text anzeigen -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
