On Tuesday, October 25, 2011 8:27:02 PM UTC+2, Kasper wrote:
>
> But how did you place them on the polylines? I assume your routes consist 
> from different small polylines, which are then linked together (in an 
> array?)
>

That's correct.
 

> I've tried doing this myself here [ 
> http://bit.ly/vY4YFj<http://www.google.com/url?sa=D&q=http://bit.ly/vY4YFj&usg=AFQjCNGgjkAjhQNtj67ICr6o8aF_Dr668A>]
>  but i havent figured out how to really... I got the code from this page [ 
> http://www.geocodezip.com/v3_polyline_example_kmmarkers_0.html ] but I 
> believe that uses only 1 polyline, and I use multiple [like you?]
>

Let's say that you have a vehicle that starts in DenBosch and ends in 
Tilburg Uni, so it has two paths (polylines)
- DenBosch_TilburgCentraal_path
- TilburgCentraal_TilburgUni_path

If you combine them (I would let you do the search for how to sum up two 
arrays in JS) you get a bigger polyline. 

Assuming that a train leaves DenBosch at 10:10 and arrives in Uni at 10:20. 
If the clock is 10:14 then the train should be projected at 40% along the 
longer path.

Here is a bit of code of how I did it in my project, you need to change / 
adapt it to your needs. Plus, to perform the animation, I would let you 
google / use this forum / check my code to see what is the core JS function 
that is used to repeat a task (i.e. to animate a marker). 
 

> As for the linesPool.positionGet function, that looks very nice!
> But I'm not sure how this would be useable in my case, as I dont have the 
> complex algorithmes you have [and don't have the time to make/use any].
>

Well, the heavy lifting is done in advance(serverside), i.e. computing 
which polyline ids are forming a route from A to B, then the "problem" 
reduces to the one that you have; the pastie that I gave you is based 
exclusively on my linesPool.positionGet() method.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/d-4f_qZOS8UJ.
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-js-api-v3?hl=en.

Reply via email to