On Nov 24, 12:18 pm, Vitor Costa <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am creating an application where the user can drag a route that has
> been fetched with GDirections. For that, I am using a code similar to
> the demo in the GMAPI website,http://www.marsrutai.info/directions.htm.
> In this code, during a mouse move, the algorithm finds the nearest
> point in the route to the position of the mouse to decide whether to
> put a drag marker or not.
>
> The problem is that when the route is too large, like crossing the US
> from left to right, and using a high zoom level (so that I can see the
> entire US), it starts to get slow. I think the main problem is because
> the polyline actually has many vertexes, and since I have to iterate
> over all of them, it is getting quite slow. But I am only interested
> in the vertexes that are visible in a given zoom level, not all of
> them.
>
> So, is there a way to get only the vertexes of the polyline that are
> actually being drawn?
>
> Thanks in advance,

You should be able to get them programmatically.  Iterate through the
vertices in the polyline testing for map.getBounds().contains

See the documentation for the details.

   -- Larry
--~--~---------~--~----~------------~-------~--~----~
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