multiple cycling routes on one map
As part of a cycling survey http://www40.brinkster.com/katlayout/ I
want to plot multiple cycle routes on a map.
The UK google maps has only cars and walking as options - so i would
choose the walking one and have a constructor
map = new GMap2(document.getElementById("map_canvas,route"));
map.setCenter(new GLatLng(54.981022,-1.609898), 14);
map.setUIToDefault();
I was going to make the div it would write the directions to hidden
- assuming that each set of directions ( there could be several
hundred) wouldn't appear .
But I cant get the multiple routes to display when walking is chosen
when I get the polyline object
var routes = [route1, route2, route3, route4];
var directionsArray = [];
for (i = 0; i < routes.length; i++)
{directionsArray[i] = new GDirections();
GEvent.addListener(directionsArray[i], "load", onGDirectionsLoad);
directionsArray[i].load(routes[i],
(getPolyline:true,travelmode:G_TRAVEL_MODE_WALKING});
}
function onGDirectionsLoad()
{var polyline = this.getPolyline();
polyline.setStrokeStyle({color: routeColours[x],weight:3,opacity:
0.7});
map.addOverlay(polyline);
x++;
}
the next step after plotting routes is to look at the most used ones
and then target any campaigning to address those problems.
In Newcastle there is a big green space in the middle (
http://en.wikipedia.org/wiki/Town_Moor,_Newcastle_upon_Tyne) which is
car free and well used by cyclists so just converting waypoints to lat
and long and using the car route wont work either
can multiple cycle routes plotted on the same map be done with the
GoogleMaps API or do i need to come up with different way of tackling
it ?
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home