This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
MGLGeoJSONSource should have a features initializer #6302
Labels
feature
iOS
Mapbox Maps SDK for iOS
macOS
Mapbox Maps SDK for macOS
navigation
For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
runtime styling
Milestone
MGLGeoJSONSource currently has four initializers: two that accept a GeoJSON-formatted NSData object, and two that accept a URL to a local or remote GeoJSON file. MGLGeoJSONSource should have an additional initializer that accepts an array of MGLFeatures and would accompany the existing read-only
features
property.Consider this basic use case: the developer wants to create a GeoJSON source containing a particular polyline feature. Currently, they have to either compose a GeoJSON string and stuff it into an NSData object or write out a GeoJSON file and refer to it by its path. Instead, it would be much more convenient to create the source using an MGLPolyline object directly.
To simplify MGLGeoJSONSource, we should remove
-initWithSourceIdentifier:geoJSONData:
and-initWithSourceIdentifier:URL:
and make theoptions
parameter on the remaining initializers nullable. MGLGeoJSONSource would be left with three initializers corresponding to the three propertiesfeatures
,geoJSONData
, andURL
.We should also make
MGLFeature.attributes
read-write so that it’s possible to create a feature with specific attributes that a layer might filter for./cc @boundsj @incanus @frederoni
The text was updated successfully, but these errors were encountered: