I'm trying to make several directions (well, their Polyline, essentially) on one copy of the map. In the previous version of the map API, I did something like
GEvent.addListener(directions[i], "load", function() {
var polyline = this.getPolyline();
map.addOverlay(polyline);
polyline.setStrokeStyle({opacity:0.2})
});
directions[i].load("from:here to:"+x[i].childNodes[0].nodeValue,{getPolyline:true});
Now that there are DirectionsService and DirectionsRenderer classes, I don’t know which best practices do the same. Create multiple instances of the DirectionsRenderer class and force them to do setMap () on the main map instance? I am creating several instances of the DirectionsServices class.
I am very new to javascript and functional languages in general and barely had time to figure out how to close functional locks, as they relate to callbacks. Sorry for the formatting.
Any help would be appreciated, I will try to clarify any points that you can raise.