Length of polyline in pixels

266 views
Skip to first unread message

Pil

unread,
Jul 13, 2011, 3:02:25 AM7/13/11
to Google Maps JavaScript API v3
I need to get the length of a polyline in pixels to cut off 10 or 20
pixels at the end of the line.

Looking for a simple and short way to do that.

Pil

unread,
Jul 13, 2011, 10:06:34 AM7/13/11
to Google Maps JavaScript API v3
Hmm, I see, that's no easy task, there is a lot of math necessary.

That's not worth the effort. Sorry for the noise.

Chris Broadfoot

unread,
Jul 27, 2011, 7:03:09 AM7/27/11
to google-map...@googlegroups.com
You could find the approximate length (in metres) of 10px at the desired latitude, and then chop that length off the polyline.

--


On Wed, Jul 13, 2011 at 10:06 PM, Pil <wol...@gmail.com> wrote:
Hmm, I see, that's no easy task, there is a lot of math necessary.

That's not worth the effort. Sorry for the noise.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Pil

unread,
Jul 27, 2011, 7:24:19 AM7/27/11
to Google Maps JavaScript API v3
Thanks Chris,

meanwhile I know how to calculate the pixel length of a polyline,
based on Pythagoras' theorem

http://www.wolfpil.de/v3/arrow-heads.html




On Jul 27, 1:03 pm, Chris Broadfoot <c...@google.com> wrote:
> You could find the approximate length (in metres) of 10px at the desired
> latitude, and then chop that length off the polyline.
>
> --http://twitter.com/broady
Reply all
Reply to author
Forward
0 new messages