It looks like the EPoly code is really only meant for use with one
distance (i.e. one function call). You should be able to speed it up
significantly (from O(n^2) to O(n), I would think) if you rewrite it
to find multiple intervals.

Further explanation: the GetPointAtDistance function always starts at
the first vertex when finding the distance, thus you're going over the
first section of the line over and over when you use the function for
multiple distances. To solve this inefficiency, you could either write
a similar function to find all the intervals at once, or possibly
adjust the function to return the last vertex passed which could be
fed back into the function as a starting vertex for a headstart on the
existing algorithm. I would suggest the former.

If you use Firebug, you can use its profiling tool to check out the
speed differences.


On Nov 28, 6:49 am, Pax <[EMAIL PROTECTED]> wrote:
> Thanks Mike, much appreciated!
>
> Is there any way to increase performance? It takes a long time to
> calculate if I have to return 200+ points.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to