How to add antialiasing to Polylines

1,170 views
Skip to first unread message

Coen de Jong

unread,
Feb 5, 2012, 7:37:30 AM2/5/12
to google-map...@googlegroups.com
My polylines on the map now look pretty ugly because the lines are not smoothened. Does anyone know how I can achieve that? Look at an example here: http://labs.shifthappens.nl/vagabond/pilot/

Rossko

unread,
Feb 5, 2012, 8:31:48 AM2/5/12
to Google Maps JavaScript API v3
> My polylines on the map now look pretty ugly because the lines are not
> smoothened.

I can see smooth dashed curves in IE. Is your problem browser
dependent, or am I looking at the wrong thing?

Andrew Leach

unread,
Feb 5, 2012, 8:36:12 AM2/5/12
to google-map...@googlegroups.com

Ditto Firefox 3.6.21. There's a kink in A-B, but the lines are rendered well.

Coen de Jong

unread,
Feb 5, 2012, 8:57:01 AM2/5/12
to google-map...@googlegroups.com
Hmm. I just updated the website to show solid lines. That might clarify the issue a bit more. I agree that somehow, after a reset of my Chrome browser the lines do look better. It might also be the drawing algorithm that is flawed in this case.

Does anybody know a good way to draw arcs (curved lines) from point A to B on a google map?

> --
> 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.
>

geoco...@gmail.com

unread,
Feb 5, 2012, 9:38:55 AM2/5/12
to Google Maps JavaScript API v3
On Feb 5, 5:57 am, Coen de Jong <co.dej...@gmail.com> wrote:
> Hmm. I just updated the website to show solid lines. That might clarify the issue a bit more. I agree that somehow, after a reset of my Chrome browser the lines do look better. It might also be the drawing algorithm that is flawed in this case.
>
> Does anybody know a good way to draw arcs (curved lines) from point A to B on a google map?

Are you looking for geodesic lines?

http://www.geocodezip.com/v3_polyline_example_geodesic.html
http://www.geocodezip.com/v3_polyline_example_geodesic_proj.html

or just curves:

http://www.geocodezip.com/v3_polygon_example_arc.html

-- Larry

Coen de Jong

unread,
Feb 5, 2012, 10:41:12 AM2/5/12
to google-map...@googlegroups.com
Hi there! Yes actual curves, arcs from point to point. Geodesic lines only work on a very long distance, and I want to give the viewer the impression of a journey, with bows from destination to destination. Also for small distances.

Your 3rd example therefore seems very promising. I'll look into it to implement it into my own project. The lines look very detailed as well, much more than mine are now. Is it OK to return to this thread to ask you questions in case I get stuck?
Reply all
Reply to author
Forward
0 new messages