Hi Larry,

Thanks for the reply.
But that is not actually what I am trying to do.

In my case, the polyline is entirely shown in the map.
The thing is, since the map is really zoomed out, not all the vertexes
are actually being drawn.
Only if you start to zoom in, the more detailed ones start to appear.

If you look at the documentation for encoded polyline, you will find
the following:

"An encoded polyline also stores information specifying the precision
when drawing the polyline. This information allows the map to ignore
drawing segments at zoom levels where that precision is not necessary.
Each point in an encoded polyline stores this information in a levels
string which is also encoded alongside the encoded points."

So what I would like to get from the polyline are only the vertexes
that are inside the precision of the zoom level that the map is
showing.
Does anyone know if this is possible??

Thanks in advance,
Vitor.

On Nov 24, 9:52 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> 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