Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] port raster resampling property #12176

Merged
merged 4 commits into from
Jun 21, 2018
Merged

[core] port raster resampling property #12176

merged 4 commits into from
Jun 21, 2018

Conversation

mollymerp
Copy link
Contributor

@mollymerp mollymerp added Core The cross-platform C++ core, aka mbgl GL JS parity For feature parity with Mapbox GL JS labels Jun 19, 2018
@mollymerp mollymerp requested a review from lbud June 19, 2018 18:40
Copy link
Contributor

@lbud lbud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mollymerp mollymerp force-pushed the raster-resampling branch from f7949be to ec109c7 Compare June 19, 2018 21:46
Molly Lloyd added 2 commits June 19, 2018 14:54
ignore feature-state tests and other to-be-ported tests
@mollymerp mollymerp force-pushed the raster-resampling branch from ec109c7 to 2cf3012 Compare June 19, 2018 21:55
@mollymerp
Copy link
Contributor Author

mollymerp commented Jun 19, 2018

cc @tobrun @1ec5 does this need anything else for ios/android support? (this shouldn't go into chai so not urgent)

Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the feedback below, please add a blurb to the iOS and macOS changelogs describing the addition of this MGLRasterStyleLayer property. Thanks!

Values of this type are used in the `MGLRasterStyleLayer.rasterResampling`
property.
*/
typedef NS_ENUM(NSUInteger, MGLRasterResampling) {
Copy link
Contributor

@1ec5 1ec5 Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enumeration and the corresponding property are named with a gerund, which makes them look like a protocol at the point of use. Consider overriding the property’s name to raster-resampling-mode or raster-resampling-method in platform/darwin/scripts/style-spec-cocoa-conventions-v8.json.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to change it as a platform override, I'd consider we change it in the style-spec and on JS too to keep it consistent. It hasn't gone out in a release yet so not too late to change.

Personally I'm not fussed either way, though raster-resampling is shorter and I don't think is ambiguous compared to raster-resampling-method.

Copy link
Contributor

@1ec5 1ec5 Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very much a platform-specific nuance. In Objective-C and Swift, MGLRasterResampling on its own is very clearly a protocol name, as opposed to an enumeration name. That’s a product of how we’re automatically generating enumeration names based on style specification properties. We could tweak just the enumeration name without tweaking the property name, but that would be even more confusing than changing it wholesale on iOS/macOS.

As you can see from style-spec-cocoa-conventions-v8.json, there’s quite a lot of precedent for overriding property names on iOS/macOS, but we’re trying to keep a light touch, mostly tweaking parts of speech or avoiding conflicts with Cocoa terminology.

I think raster-resampling is OK in the style specification, where properties often resemble CSS naming convention and don’t have the same language constraints.

@@ -6,6 +6,27 @@

NS_ASSUME_NONNULL_BEGIN

/**
The resampling/interpolation method to use for overscaling, also known as
texture magnification filter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This would be fixed upstream in the style specification, but there’s a missing period at the end of this documentation comment and the ones for the individual values below. Not critical though.

@andrewharvey
Copy link
Contributor

Great work on this @mollymerp 👍 , sorry I created more work for the team by pushing this into GL JS.

@mollymerp mollymerp merged commit e1af62e into master Jun 21, 2018
@mollymerp mollymerp deleted the raster-resampling branch June 21, 2018 21:37
@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS Android Mapbox Maps SDK for Android needs changelog Indicates PR needs a changelog entry prior to merging. labels Jun 27, 2018
@friedbunny friedbunny removed the needs changelog Indicates PR needs a changelog entry prior to merging. label Jun 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl GL JS parity For feature parity with Mapbox GL JS iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants