Reputation: 642
I am working with a security company that has a patrol car travel around a neighborhood. Every 30 seconds, they record a GPS coordinate/point which I can download and use. I'm trying to map a 'path of travel' for the patrol vehicle using Google Maps API.
I understand how to map (marker) all the points using the Google Maps v3 API. I also understand how I can do a driving route between a few points using directionsService. According to Google and StackOverflow, the maximum number of waypoints is 26.
The problem is that I have dozens of these points (1 hour = 120 points). I can't just draw a polyline between the points because I need it to show the path of travel on the actual street - not as the crow flies between 2 points. Also, I don't have 10K to purchase an Enterprise license.
Any ideas on how this might be accomplished or am I SOL? Can you draw 120 multiple 'routes' on the same map? Speed is not important here.
Thanks, Mike
Upvotes: 1
Views: 1310
Reputation: 117334
Can you draw 120 multiple 'routes' on the same map?
You can. When you want to draw the routes by using the DirectionsRenderer you must use a separate DirectionsRenderer
-instance for each route.
Another approach: request the routes via the DirectionsService, but use a custom Polyline
to draw the route. Each time you get a new route you'll only have to push the points of the new route to the path of the polyline.
Upvotes: 1