-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios, macos] Fix querying features returning nil when features available. #9784
[ios, macos] Fix querying features returning nil when features available. #9784
Conversation
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.
Oh, good catch.
Would it be better to fix this by adding a style:(MGLStyle*)
parameter to -[MGLSource initWithRawSource:]
, keeping the style
property readonly
?
Also, is there somewhere you can add a test for this?
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 agree that we probably should add a parameter to -[MGLSource initWithRawSource:]
and its subclass implementations instead of making mapView
writeable.
Also, this bug fix is significant enough to deserve a mention in the iOS and macOS changelogs.
platform/darwin/src/MGLStyle.mm
Outdated
@@ -187,7 +187,13 @@ - (MGLSource *)memberOfSources:(MGLSource *)object { | |||
- (MGLSource *)sourceWithIdentifier:(NSString *)identifier | |||
{ | |||
auto rawSource = self.mapView.mbglMap->getSource(identifier.UTF8String); | |||
return rawSource ? [self sourceFromMBGLSource:rawSource] : nil; | |||
MGLSource *source = nil; |
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.
Nit: it isn’t necessary to explicitly set a local variable to nil
in Objective-C.
79c088e
to
fd3002a
Compare
platform/darwin/src/MGLStyle.mm
Outdated
@@ -187,7 +187,8 @@ - (MGLSource *)memberOfSources:(MGLSource *)object { | |||
- (MGLSource *)sourceWithIdentifier:(NSString *)identifier | |||
{ | |||
auto rawSource = self.mapView.mbglMap->getSource(identifier.UTF8String); | |||
return rawSource ? [self sourceFromMBGLSource:rawSource] : nil; | |||
|
|||
return rawSource ? [self sourceFromMBGLSource:rawSource] : nil;; |
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.
Nit: stray semicolon.
platform/ios/CHANGELOG.md
Outdated
@@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT | |||
* Added an MGLStyle.localizesLabels property, off by default, that localizes any Mapbox Streets–sourced symbol layer into the user’s preferred language. ([#9582](https://github.com/mapbox/mapbox-gl-native/pull/9582)) | |||
* Added an additional camera method to MGLMapView that accepts an edge padding parameter. ([#9651](https://github.com/mapbox/mapbox-gl-native/pull/9651)) | |||
* Fixed an issue with the scaling of the user location annotation’s horizontal accuracy indicator. ([#9721](https://github.com/mapbox/mapbox-gl-native/pull/9721)) | |||
* Fixed an issue that caused querying features in a source added through Mapbox Studio returned nil. ([#9784](https://github.com/mapbox/mapbox-gl-native/pull/9784)) |
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.
Nit: s/returned/to return/. Also, if I understand correctly, the issue affected all vector sources, not just those added through 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.
You are right.
fd3002a
to
defbfa5
Compare
Also, macOS SDK v0.5.1 has yet to be released, because none of the changes that went into iOS SDK v3.6.1 were relevant to macOS.
Made some changes to the changelogs in fdf7a3f:
|
Thanks @1ec5! |
Fixes #9646