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

clarify geometry-type expression behavior for vector tile sources #7699

Closed
samanpwbb opened this issue Dec 13, 2018 · 3 comments · Fixed by #10841
Closed

clarify geometry-type expression behavior for vector tile sources #7699

samanpwbb opened this issue Dec 13, 2018 · 3 comments · Fixed by #10841
Assignees
Labels
api 📝 cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) docs 📜 style-spec

Comments

@samanpwbb
Copy link
Contributor

samanpwbb commented Dec 13, 2018

Problem

The documentation for geometry-type in the spec (

"doc": "Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",
) could clarify which property types will be available for which source types. Current copy is:

Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.

Based on a quick experiment, it doesn't appear like the geometry-type expression ever returns a multi* feature when applied to a vector tile source.

Suggestion

There's likely more nuance going on here than I'm aware of – in which case, the appropriate explanation in the appropriate place would solve this issue better than anything I can come up with. Here are some suggestions based on what I know:

  • Add a sentence to the spec documentation, something like: "Multi* feature types will only be detectable in GeoJSON sources, use the singular forms when working with vector tile sources".
  • Change the behavior of geometry-type to return true for multi-features in both vector tile and GeoJSON source types.
@mourner
Copy link
Member

mourner commented Jan 2, 2019

I wonder whether it makes sense to differentiate between Multi and Single geometries in the context of a Mapbox style — perhaps we should do the other way around and fix GeoJSON to return Polygon/Line/Point for multi geometries as well?

It's definitely a design omission — we should have thought this out to be consistent. The only problem with fixing this is that it's a breaking change, so perhaps updating the docs would be an easier first step, assuming a follow-up.

@mourner mourner added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Jan 2, 2019
@chloekraw
Copy link
Contributor

@SnailBones
Copy link
Contributor

@HeyStenson's commit provides the documentation fix.

Added to #6584 so we can revisit the breaking change in the next style spec version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api 📝 cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) docs 📜 style-spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants