You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Shape overlays are unable to cross antimeridian #4974
The corresponding MapKit code does straddle the antimeridian:
Also reproduces with polygons.
This is a very old bug that has reproduced in the iOS SDK since shape annotations were first implemented in #1655, but I was unable to find a ticket that adequately addresses it. The diagnosis in #3879 (comment) probably applies here, even though point annotations are apparently unaffected as of #4285.
MapKit may be doing some kind of guessing/snapping here but Mapbox GL JS certainly doesn't - much like GeoJSON that crosses the antimeridian, the only unambiguous way to represent this geometry is with coordinates >180 or <-180
In representing features that cross the antimeridian, interoperability is improved by modifying their geometry. Any geometry that crosses the antimeridian SHOULD be represented by cutting it in two such that neither part's representation crosses the antimeridian.
If we were to require the use of longitudes beyond ±180° in order to add such features, I think that would be fine from a developer standpoint. Ideally, we'd handle the job of partitioning the feature along the antimeridian for the developer.
@1ec5 Do we have an update on a fix to this issue? We've seen this issue materialize with actual storm tracks in our development environment. See attached.
The right workaround will be too add or subtract 360 to longitudes that are "too far" away, e.g. so that the example [-170,0], [170,0] above will become [190,0], [170,0] or [-190,0], [-170,0]. Combined with a fix in mapbox/geojson-vt-cpp#57, this should cover all use cases.
Activity
bleege commentedon May 9, 2016
Confirming that this also impacts the Android SDK as the corresponding code produces a similar screenshot.
This translates to the Core GL level by
MapboxMap.addPolyline()callingMapView.addPolyline()which in turn callsaddShapeAnnotations()in Core GL to do the rendering.tmcw commentedon May 12, 2016
Can you do
MapKit may be doing some kind of guessing/snapping here but Mapbox GL JS certainly doesn't - much like GeoJSON that crosses the antimeridian, the only unambiguous way to represent this geometry is with coordinates >180 or <-180
sgillies commentedon May 12, 2016
@tmcw latest revision to the GeoJSON draft says
https://github.com/geojson/draft-geojson/blob/master/middle.mkd#antimeridian-cutting
1ec5 commentedon May 12, 2016
If we were to require the use of longitudes beyond ±180° in order to add such features, I think that would be fine from a developer standpoint. Ideally, we'd handle the job of partitioning the feature along the antimeridian for the developer.
tbernas commentedon Aug 3, 2016
@1ec5 Do we have an update on a fix to this issue? We've seen this issue materialize with actual storm tracks in our development environment. See attached.


incanus commentedon Aug 4, 2016
Is a possible workaround to:
1ec5 commentedon Aug 5, 2016
Step 3 doesn't look sound. If I'm not mistaken, you'd get the same result as the current behavior.
mourner commentedon Aug 18, 2016
The right workaround will be too add or subtract 360 to longitudes that are "too far" away, e.g. so that the example
[-170,0], [170,0]above will become[190,0], [170,0]or[-190,0], [-170,0]. Combined with a fix in mapbox/geojson-vt-cpp#57, this should cover all use cases.boundsj commentedon Aug 19, 2016
Closing this. The solution noted by @mourner along with the fix in geojson-vt-cpp works.
1ec5 commentedon Dec 6, 2016
Noting that the workaround is no longer needed, now that mapbox/geojson-vt-cpp#57 has landed in #6088.