-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Explicit source options overwrite #8232
Conversation
"line": 12 | ||
}, | ||
{ | ||
"message": "sources.no-unknown-properties-with-url.foo: a source with a \"url\" property may not include a \"foo\" property", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is unknown properties support needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think foreign members (unknown properties) in source options should be leaved as it is. Foreign members does not affect source's functionality and add extensibility for metadata or custom sources. As we don't invalidate foreign members in geojson、image、video sources, invalidate foreign members in vector, raster, raster-dem seems inconsistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jingsam Sorry for the delay in getting back to this. Allowing foreign members in the TileJSON does not seem necessary as part of this PR. It is preferable to have strict validation to ensure that unnecesary or incorrect properties are not being added to such files.
cc @mapbox/studio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go except the foreign properties test.
@asheemmamoowala I have invalid foreign members in source options when mapbox-gl-js/src/style-spec/validate/validate_source.js Lines 32 to 38 in 58fa110
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jingsam Thank you for sticking to your guns on this. Just rechecked the TilJSON spec. It states that
Implementations MUST treat unknown keys as if they weren't present.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually - could you add a render test to ensure that the over-ride properties take effect. An example that uses constrains maxzoom or bounds would work well with a small image size.
@asheemmamoowala I add a test, please check out. |
Explicit source options should taken precedence over TileJSON. See details in #8192
Launch Checklist
@mapbox/studio
and/or@mapbox/maps-design
if this PR includes style spec changes@mapbox/gl-native
if this PR includes shader changes or needs a native port