@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.URI uri)
Create a GeoJsonSource from a geo json URI
|
GeoJsonSource(java.lang.String id,
java.net.URI uri,
GeoJsonOptions options)
Create a GeoJsonSource from a geo json URI and non-default GeoJsonOptions
|
GeoJsonSource(java.lang.String id,
java.net.URL url)
Deprecated.
use
GeoJsonSource(String, URI) instead |
GeoJsonSource(java.lang.String id,
java.net.URL url,
GeoJsonOptions options)
Deprecated.
use
GeoJsonSource(String, URI, GeoJsonOptions) instead |
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize() |
com.mapbox.geojson.FeatureCollection |
getClusterChildren(com.mapbox.geojson.Feature cluster)
Returns the children of a cluster (on the next zoom level) given its id (cluster_id value from feature properties).
|
int |
getClusterExpansionZoom(com.mapbox.geojson.Feature cluster)
Returns the zoom on which the cluster expands into several children (useful for "click to zoom" feature)
given the cluster's cluster_id (cluster_id value from feature properties).
|
com.mapbox.geojson.FeatureCollection |
getClusterLeaves(com.mapbox.geojson.Feature cluster,
long limit,
long offset)
Returns all the leaves of a cluster (given its cluster_id), with pagination support: limit is the number of leaves
to return (set to Infinity for all points), and offset is the amount of points to skip (for pagination).
|
java.lang.String |
getUri()
Get the URI of the source.
|
java.lang.String |
getUrl()
Deprecated.
use
getUri() instead |
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 featureCollection)
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 |
setUri(java.lang.String uri)
Updates the URI of the source.
|
void |
setUri(java.net.URI uri)
Updates the URI of the source.
|
void |
setUrl(java.lang.String url)
Deprecated.
use
setUri(String) instead |
void |
setUrl(java.net.URL url)
Deprecated.
use
setUri(URI) instead |
checkThread, getAttribution, getId, getMaxOverscaleFactorForParentTiles, getMinimumTileUpdateInterval, getNativePtr, getPrefetchZoomDelta, isVolatile, nativeGetAttribution, nativeGetId, nativeGetMaxOverscaleFactorForParentTiles, nativeGetMinimumTileUpdateInterval, nativeGetPrefetchZoomDelta, nativeIsVolatile, nativeSetMaxOverscaleFactorForParentTiles, nativeSetMinimumTileUpdateInterval, nativeSetPrefetchZoomDelta, nativeSetVolatile, setDetached, setMaxOverscaleFactorForParentTiles, setMinimumTileUpdateInterval, setPrefetchZoomDelta, setVolatilepublic 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 - options@Deprecated
public GeoJsonSource(java.lang.String id,
java.net.URL url)
GeoJsonSource(String, URI) insteadid - the source idurl - remote json file@Deprecated
public GeoJsonSource(java.lang.String id,
java.net.URL url,
GeoJsonOptions options)
GeoJsonSource(String, URI, GeoJsonOptions) insteadid - the source idurl - remote json fileoptions - optionspublic GeoJsonSource(java.lang.String id,
java.net.URI uri)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
id - the source iduri - unique resource identifierpublic GeoJsonSource(java.lang.String id,
java.net.URI uri,
GeoJsonOptions options)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
id - the source iduri - 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)
Featureid - the source idfeature - the featurepublic GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Feature feature,
GeoJsonOptions options)
Feature and non-default GeoJsonOptionsid - the source idfeature - the featureoptions - optionspublic GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Geometry geometry)
Geometryid - the source idgeometry - the geometrypublic GeoJsonSource(java.lang.String id,
com.mapbox.geojson.Geometry geometry,
GeoJsonOptions options)
Geometry and non-default GeoJsonOptionsid - 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(@Nullable
com.mapbox.geojson.FeatureCollection featureCollection)
featureCollection - the GeoJSON FeatureCollectionpublic void setGeoJson(java.lang.String json)
json - the raw GeoJson FeatureCollection string@Deprecated
public void setUrl(@NonNull
java.net.URL url)
setUri(URI) insteadurl - the GeoJSON FeatureCollection urlpublic void setUri(@NonNull
java.net.URI uri)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
uri - the GeoJSON FeatureCollection uri@Deprecated public void setUrl(java.lang.String url)
setUri(String) insteadurl - the GeoJSON FeatureCollection urlpublic void setUri(java.lang.String uri)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
uri - the GeoJSON FeatureCollection uri@Nullable public java.lang.String getUrl()
getUri() instead@Nullable public java.lang.String getUri()
@NonNull
public java.util.List<com.mapbox.geojson.Feature> querySourceFeatures(@Nullable
Expression filter)
filter - an optional filter expression to filter the returned Features@NonNull
public com.mapbox.geojson.FeatureCollection getClusterChildren(@NonNull
com.mapbox.geojson.Feature cluster)
Requires configuring this source as a cluster by calling GeoJsonOptions.withCluster(boolean).
cluster - cluster from which to retrieve children from@NonNull
public com.mapbox.geojson.FeatureCollection getClusterLeaves(@NonNull
com.mapbox.geojson.Feature cluster,
long limit,
long offset)
Requires configuring this source as a cluster by calling GeoJsonOptions.withCluster(boolean).
cluster - cluster from which to retrieve leaves fromlimit - limit is the number of points to returnoffset - offset is the amount of points to skip (for pagination)public int getClusterExpansionZoom(@NonNull
com.mapbox.geojson.Feature cluster)
Requires configuring this source as a cluster by calling GeoJsonOptions.withCluster(boolean).
cluster - cluster from which to retrieve the expansion zoom fromprotected 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.Objectjava.lang.Throwable