Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circles at extreme latitudes are not clamped but mirrored, and sometimes omitted #8201

Open
peterqliu opened this issue Apr 26, 2019 · 5 comments
Labels

Comments

@peterqliu
Copy link
Contributor

mapbox-gl-js version:
0.53.0
browser:
Chrome

Steps to Trigger Behavior

  1. Add a source with points of latitude < -85.05 , or > 90
  2. Style source with circle layer

Link to Demonstration

https://jsfiddle.net/83m0L5hn/1/

This demo renders points at longitudes from 0 to 240, at intervals of 10. Red points have latitudes equal to longitude, and blue points have latitudes negative of longitude.

Screen Shot 2019-04-25 at 5 36 00 PM

Expected Behavior

Circles render properly at up til latitudes +/- 85.05, at which point they get clamped at that value.

Actual Behavior

Circles past +/-90 latitude start approaching the equator again, as if mirroring from the top and bottom edges of the projection. In addition, extreme southerly points are omitted entirely (missing blue dot at very bottom)

cc/ @ryanhamley @mourner

@peterqliu
Copy link
Contributor Author

deep, deep upstream hack at mapbox/geojson-vt#124 . suggestions welcome 🙏

@1ec5
Copy link
Contributor

1ec5 commented May 2, 2019

Would it be more accurate to mirror the coordinates as if going past the pole, for example to support the daylight chart effect seen in mapbox/mapbox-gl-native#14534? That particular implementation doesn’t rely on coordinates beyond ±90 degrees latitude, but it does potentially go up to ±90 degrees before coming back toward the equator. The clamping proposed in mapbox/geojson-vt#124 would prevent the curve from being smooth, right?

@peterqliu
Copy link
Contributor Author

@1ec5 to my understanding, we've achieved consensus on strict, non-smooth clamping as the expected behavior

@mourner
Copy link
Member

mourner commented May 2, 2019

@1ec5 leaving the projection unbounded doesn't really work for Mercator projection, because latitudes near 90/-90 approach Infinity/-Infinity. I think clamping is the most reliable thing to do. You can always do the mirroring logic in the implementation (prior to serving the geometry for rendering).

@1ec5
Copy link
Contributor

1ec5 commented May 2, 2019

For future reference on the iOS side, MapKit doesn’t render annotations past ±85° or so but leaves the coordinate data intact for querying purposes and so that animated annotations have the right trajectory. (Apple Maps’s satellite map is displayed on a globe, but that feature is unavailable in MapKit.)

/ref mapbox/mapbox-gl-native#1671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants