I'm using GDirections.loadFromWaypoints to retrieve and draw a
polyline:
I'm doing my own drawing (getPolyline: true) because I don't want the
endpoint bubbles to show.

        var dir=new GDirections();
        GEvent.addListener(dir,'load',onloaded);
        var opt={'getPolyline': true, 'preserveViewport': true};
        dir.loadFromWaypoints(...,opt);

        function onloaded(){
                var ss={'color':'#ff0000','weight':3};
                var p=this.getPolyline();
                p.setStrokeStyle(ss);
                mymap.addOverlay(p);
        }

This works fine, but when the polyline is drawn, I first see it in
blue (default colour) and then it changes to red. Is there a delay in
SetStrokeStyle()? How do I draw it in red only?

I just read in the docs that "The GPolyline must already be added to
the map via GMap2.addOverlay()" so I changed the order to:
                mymap.addOverlay(p);
                p.setStrokeStyle(ss);
but it still shows blue before changing to red.

Is there a way to pre-set the colour & thickness before calling
GDirections.getPolyline()? If not, it looks like .getPolyline() could
use a GPolyStyleOptions parameter.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to