What is the mechanism I should be using to display multiple routes on
one map? Did I miss something in the reference? Also, I,m rendering
the routes anew every time the map is refreshed. I intend to
eventually store the JSON routes (DirectionsService results) in a
MySQL blob and then retrieve and display them rather than having
Google recreate them every time the map comes up.
V3 is a VERY nice package. Keep up the good work. Thanx...
You should be able to create two DirectionsRenderer objects, each that
use the same map and different DirectionsResults.
var map = new
google.maps.Map(document.getElementById("map_canvas"));
function renderDirections(result) {
var directionsRenderer = new google.maps.DirectionsRenderer;
directionsRenderer.setMap(map);
directionsRenderer.setDirections(result);
}
var directionsService = new google.maps.DirectionsService;
function requestDirections(start, end) {
directionsService.route({
origin: start,
destination: end,
travelMode: google.maps.DirectionsTravelMode.DRIVING
}, function(result) {
renderDirections(result);
});
}
requestDirections('Huntsville, AL', 'Boston, MA');
requestDirections('Bakersfield, CA', 'Vancouver, BC');
Hope that helps,
Susannah
On Mar 8, 7:17 pm, "Susannah (Google Employee)" <susann...@google.com>
wrote:
I'm planning to have a lot of routs on the map and keep asking Google
to recalculate them every time do not sound good.
I'm wondering did you succeed with your idea to keep DirectionsResult
object in MySQL. Could you share the technique/concepts? :)
Another solution I can think of is to convert (somehow)
DirectionsRoute to array of LatLng (store them in MySQL) then draw a
Polyline form that array.
Any other solutions/ideas?
Thanks.
On Mar 8, 2:27 pm, Jon Grubb <jonwgr...@gmail.com> wrote:
> Hi folks. I'm building a web site
>
> ... skipped ...