@UiThread public class GeoJsonSource extends Source
Constructor and Description |
---|
GeoJsonSource(java.lang.String id)
Create an empty GeoJsonSource
|
GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Feature feature)
Create a GeoJsonSource from a
Feature |
GeoJsonSource(java.lang.String id,
com.mapbox.geojson.FeatureCollection features)
Create a GeoJsonSource from a FeatureCollection.
|
GeoJsonSource(java.lang.String id,
com.mapbox.geojson.FeatureCollection features,
GeoJsonOptions options)
Create a GeoJsonSource from a FeatureCollection and non-default GeoJsonOptions.
|
GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Feature feature,
GeoJsonOptions options)
Create a GeoJsonSource from a
Feature and non-default GeoJsonOptions |
GeoJsonSource(java.lang.String id,
GeoJsonOptions options)
Create an empty GeoJsonSource with non-default GeoJsonOptions.
|
GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Geometry geometry)
Create a GeoJsonSource from a
Geometry |
GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Geometry geometry,
GeoJsonOptions options)
Create a GeoJsonSource from a
Geometry and non-default GeoJsonOptions |
GeoJsonSource(java.lang.String id,
java.lang.String geoJson)
Create a GeoJsonSource from a raw json string
|
GeoJsonSource(java.lang.String id,
java.lang.String geoJson,
GeoJsonOptions options)
Create a GeoJsonSource from a raw json string and non-default GeoJsonOptions
|
GeoJsonSource(java.lang.String id,
java.net.URL url)
Create a GeoJsonSource from a remote geo json file
|
GeoJsonSource(java.lang.String id,
java.net.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() |
java.lang.String |
getUrl() |
protected void |
initialize(java.lang.String layerId,
java.lang.Object options) |
protected java.lang.String |
nativeGetUrl() |
protected void |
nativeSetUrl(java.lang.String url) |
java.util.List<com.mapbox.geojson.Feature> |
querySourceFeatures(Expression filter)
Queries the source for features.
|
void |
setGeoJson(com.mapbox.geojson.Feature feature)
Updates the GeoJson with a single feature.
|
void |
setGeoJson(com.mapbox.geojson.FeatureCollection features)
Updates the GeoJson.
|
void |
setGeoJson(com.mapbox.geojson.Geometry geometry)
Updates the GeoJson with a single geometry.
|
void |
setGeoJson(java.lang.String json)
Updates the GeoJson.
|
void |
setUrl(java.lang.String url)
Updates the url
|
void |
setUrl(java.net.URL url)
Updates the url
|
checkThread, getAttribution, getId, getNativePtr, nativeGetAttribution, nativeGetId
public GeoJsonSource(java.lang.String id)
id
- the source idpublic GeoJsonSource(java.lang.String id, GeoJsonOptions options)
id
- the source idoptions
- optionspublic GeoJsonSource(java.lang.String id, @Nullable java.lang.String geoJson)
id
- the source idgeoJson
- raw Json FeatureCollectionpublic GeoJsonSource(java.lang.String id, @Nullable java.lang.String geoJson, GeoJsonOptions options)
id
- the source idgeoJson
- raw Json bodyoptions
- optionspublic GeoJsonSource(java.lang.String id, java.net.URL url)
id
- the source idurl
- remote json filepublic GeoJsonSource(java.lang.String id, java.net.URL url, GeoJsonOptions options)
id
- the source idurl
- remote json fileoptions
- optionspublic GeoJsonSource(java.lang.String id, com.mapbox.geojson.FeatureCollection features)
id
- the source idfeatures
- the featurespublic GeoJsonSource(java.lang.String id, com.mapbox.geojson.FeatureCollection features, GeoJsonOptions options)
id
- the source idfeatures
- the featuresoptions
- optionspublic GeoJsonSource(java.lang.String id, com.mapbox.geojson.Feature feature)
Feature
id
- the source idfeature
- the featurepublic GeoJsonSource(java.lang.String id, com.mapbox.geojson.Feature feature, GeoJsonOptions options)
Feature
and non-default GeoJsonOptions
id
- the source idfeature
- the featureoptions
- optionspublic GeoJsonSource(java.lang.String id, com.mapbox.geojson.Geometry geometry)
Geometry
id
- the source idgeometry
- the geometrypublic GeoJsonSource(java.lang.String id, com.mapbox.geojson.Geometry geometry, GeoJsonOptions options)
Geometry
and non-default GeoJsonOptions
id
- the source idgeometry
- the geometryoptions
- optionspublic void setGeoJson(com.mapbox.geojson.Feature feature)
feature
- the GeoJSON Feature
to setpublic void setGeoJson(com.mapbox.geojson.Geometry geometry)
geometry
- the GeoJSON Geometry
to setpublic void setGeoJson(com.mapbox.geojson.FeatureCollection features)
features
- the GeoJSON FeatureCollectionpublic void setGeoJson(java.lang.String json)
json
- the raw GeoJson FeatureCollection stringpublic void setUrl(@NonNull java.net.URL url)
url
- the GeoJSON FeatureCollection urlpublic void setUrl(java.lang.String url)
url
- the GeoJSON FeatureCollection url@Nullable public java.lang.String getUrl()
@NonNull public java.util.List<com.mapbox.geojson.Feature> querySourceFeatures(@Nullable Expression filter)
filter
- an optional filter expression to filter the returned Featuresprotected void initialize(java.lang.String layerId, java.lang.Object options)
protected void nativeSetUrl(java.lang.String url)
@NonNull protected java.lang.String nativeGetUrl()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable