@UiThread public class GeoJsonSource extends Source
Constructor and Description |
---|
GeoJsonSource(long nativePtr)
Internal use
|
GeoJsonSource(String id)
Create an empty GeoJsonSource
|
GeoJsonSource(String id,
com.mapbox.services.commons.geojson.FeatureCollection features)
Create a GeoJsonSource from a
FeatureCollection |
GeoJsonSource(String id,
com.mapbox.services.commons.geojson.FeatureCollection features,
GeoJsonOptions options)
Create a GeoJsonSource from a
FeatureCollection and non-default GeoJsonOptions |
GeoJsonSource(String id,
GeoJsonOptions options)
Create an empty GeoJsonSource with non-default
GeoJsonOptions |
GeoJsonSource(String id,
String geoJson)
Create a GeoJsonSource from a raw json string
|
GeoJsonSource(String id,
String geoJson,
GeoJsonOptions options)
Create a GeoJsonSource from a raw json string and non-default
GeoJsonOptions |
GeoJsonSource(String id,
URL url)
Create a GeoJsonSource from a remote geo json file
|
GeoJsonSource(String id,
URL url,
GeoJsonOptions options)
Create a GeoJsonSource from a remote geo json file and non-default
GeoJsonOptions |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
protected void |
initialize(String layerId,
Object options) |
protected void |
nativeSetUrl(String url) |
List<com.mapbox.services.commons.geojson.Feature> |
querySourceFeatures(Filter.Statement filter)
Queries the source for features.
|
void |
setGeoJson(com.mapbox.services.commons.geojson.FeatureCollection features)
Updates the GeoJson
|
void |
setGeoJson(String json)
Updates the GeoJson
|
protected void |
setRawJson(String geoJson) |
void |
setUrl(String url)
Updates the url
|
void |
setUrl(URL url)
Updates the url
|
checkValidity, getId, getNativePtr, invalidate, nativeGetId
public GeoJsonSource(long nativePtr)
nativePtr
- - pointer to native peerpublic GeoJsonSource(String id)
id
- the source idpublic GeoJsonSource(String id, GeoJsonOptions options)
GeoJsonOptions
id
- the source idoptions
- optionspublic GeoJsonSource(String id, String geoJson)
id
- the source idgeoJson
- raw Json FeatureCollectionpublic GeoJsonSource(String id, String geoJson, GeoJsonOptions options)
GeoJsonOptions
id
- the source idgeoJson
- raw Json bodyoptions
- optionspublic GeoJsonSource(String id, URL url)
id
- the source idurl
- remote json filepublic GeoJsonSource(String id, URL url, GeoJsonOptions options)
GeoJsonOptions
id
- the source idurl
- remote json fileoptions
- optionspublic GeoJsonSource(String id, com.mapbox.services.commons.geojson.FeatureCollection features)
FeatureCollection
id
- the source idfeatures
- the featurespublic GeoJsonSource(String id, com.mapbox.services.commons.geojson.FeatureCollection features, GeoJsonOptions options)
FeatureCollection
and non-default GeoJsonOptions
id
- the source idfeatures
- the featuresoptions
- optionspublic void setGeoJson(com.mapbox.services.commons.geojson.FeatureCollection features)
features
- the GeoJSON FeatureCollection
public void setGeoJson(String json)
json
- the raw GeoJson FeatureCollection stringpublic void setUrl(URL url)
url
- the GeoJSON FeatureCollection urlpublic void setUrl(String url)
url
- the GeoJSON FeatureCollection url@NonNull public List<com.mapbox.services.commons.geojson.Feature> querySourceFeatures(@Nullable Filter.Statement filter)
filter
- an optional filter statement to filter the returned Featuresprotected void setRawJson(String geoJson)
protected void nativeSetUrl(String url)
© 2015–2017 Mapbox. All rights reserved.