Mike,

Because the map wraps around at the antimeridian (where abs(lon) ==
180), polylines (or any data) that span that line behave in ways that
can be nonintuitive. Basically, there are different possibilities for
how to wrap such displays, and the one that the Maps API picks often
doesn't match the one you'd like.

The solution for a polyline is typically to break it into 2 at the
point where it crosses the antimeridian. Calculate the latitude of
that crossing point (the math is straightforward), then create two
polylines, one which goes from your positive-longitude endpoint to
179.99999, and the other which goes from -179.99999 to your negative-
longitude endpoint. You may get some slight visual hiccup right at the
line, but it's usually minor, and pretty well unavoidable.

The behavior you're seeing with geodesic polylines is because the
great-circle effect is created by the API breaking the polyline into
segments itself, and only the antimeridian-crossing segment is
affected.

HTH,

String


On Mar 27, 1:30 am, Mike <[email protected]> wrote:
> I've been having problems with long polylines across the globe, for
> example line between these two points:
> new GLatLng(34.690083, 135.1955112),
> new GLatLng(32.082325, -81.096515)
>
> with map.setCenter(new GLatLng(33.386204, -152.9505019), 2);
>
> when {geodesic:true}: i get a funny arc that turns around sharply at
> international date line.
> when {geodesic:false}: i get a straight line that always goes the
> other way around the globe (unpredictable)
>
> Also when i use great circle type, after attempting to zoom in/out,
> the browser freezes. It happens both on IE7 and FF.
>
> Can anyone help?
--~--~---------~--~----~------------~-------~--~----~
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