Geo JSONSource Descriptor
Configuration for a GeoJSON-backed source. At runtime, com.xweather.mapsgl.map.MapController.addSource creates a com.xweather.mapsgl.sources.GeoJSONSource; use com.xweather.mapsgl.map.MapController.getSource and cast to that type to set com.xweather.mapsgl.sources.GeoJSONSource.data or adjust com.xweather.mapsgl.sources.GeoJSONSource.url after registration.
Provide GeoJSON in one of four ways:
data — inline features assigned on the descriptor before com.xweather.mapsgl.map.MapController.addSource.
bundledAssetPath — path under the host app's
src/main/assets/(loaded on com.xweather.mapsgl.map.MapController.addSource).Assign com.xweather.mapsgl.sources.GeoJSONSource.data after addSource (inline JSON via com.mapbox.geojson.FeatureCollection.fromJson, or an asset path via com.xweather.mapsgl.sources.GeoJSONSource.parseJsonOrAsset).
url — remote GeoJSON endpoint template.
Constructors
In-memory GeoJSON only — assign data before com.xweather.mapsgl.map.MapController.addSource, or com.xweather.mapsgl.sources.GeoJSONSource.data after it. Prefer this constructor over default-arg GeoJSONSourceDescriptor(id = …) when linking against a minified AAR.
Loads GeoJSON from bundledAssetPath under the host app's src/main/assets/ when the source is added. Example: GeoJSONSourceDescriptor("countries", "geojson/conus.geojson").
Properties
Optional Android asset path packaged under src/main/assets/ (app or MapsGL SDK AAR). When set, com.xweather.mapsgl.map.MapController.addSource loads the GeoJSON into com.xweather.mapsgl.sources.GeoJSONSource.data automatically.
Inline GeoJSON features supplied up front, applied to com.xweather.mapsgl.sources.GeoJSONSource.data when com.xweather.mapsgl.map.MapController.addSource creates the source. Use this when the features are already in hand:
Discriminator matching com.xweather.mapsgl.sources.DataSource.kind after registration.