Repository navigation
Conversation
URL example does not work as of this commit since a change in core still needs to happen to trigger an update.
|
@boundsj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @1ec5, @incanus and @friedbunny to be potential reviewers. |
|
This is a WIP to make the data properties of Note: I cherry picked #6770 to make this work for URLs. However I see that PR has an open question regarding the resetting of a request. I will monitor to see if additional changes should get pulled in here. |
| NSString *string = [[NSString alloc] initWithData:_geoJSONData encoding:NSUTF8StringEncoding]; | ||
| const auto geojson = mapbox::geojson::parse(string.UTF8String).get<mapbox::geojson::feature_collection>(); | ||
|
|
||
| const auto geoJSONSource = reinterpret_cast<mbgl::style::GeoJSONSource *>(self.source); |
There was a problem hiding this comment.
These reinterpret_casts would be unnecessary if this class instead has a class extension that redefines the source property to be of type mbgl::style::GeoJSONSource *. We follow this covariant pattern in a few places, notably the style layer classes.
|
|
||
| NSURL *url = self.URL.mgl_URLByStandardizingScheme; | ||
| const auto geoJSONSource = reinterpret_cast<mbgl::style::GeoJSONSource *>(self.source); | ||
| geoJSONSource->setURL(url.absoluteString.UTF8String); |
There was a problem hiding this comment.
Either update features or nil it out.
|
For consistency, I also cherry picked @ivovandongen's 19a707d |
|
This will continue in #6793. I will address the change requests there. |
Fixes #6159
This adds support for updating a
MGLGeoJSONSource'sgeoJSONData,URL, andfeaturesproperties and having that update trigger a refresh of the map with the new source data.