public class GeoJsonSource extends Source
| Constructor and Description |
|---|
GeoJsonSource(java.lang.String id)
Create an empty GeoJsonSource
|
GeoJsonSource(java.lang.String id,
Feature feature)
Create a GeoJsonSource from a
Feature |
GeoJsonSource(java.lang.String id,
FeatureCollection features)
Create a GeoJsonSource from a FeatureCollection.
|
GeoJsonSource(java.lang.String id,
FeatureCollection features,
GeoJsonOptions options)
Create a GeoJsonSource from a FeatureCollection and non-default GeoJsonOptions.
|
GeoJsonSource(java.lang.String id,
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,
Geometry geometry)
Create a GeoJsonSource from a
Geometry |
GeoJsonSource(java.lang.String id,
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() |
FeatureCollection |
getClusterChildren(Feature cluster)
Returns the children of a cluster (on the next zoom level) given its id (cluster_id value from feature properties).
|
int |
getClusterExpansionZoom(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).
|
FeatureCollection |
getClusterLeaves(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 |
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<Feature> |
querySourceFeatures(Expression filter)
Queries the source for features.
|
void |
setGeoJson(Feature feature)
Updates the GeoJson with a single feature.
|
void |
setGeoJson(FeatureCollection features)
Updates the GeoJson.
|
void |
setGeoJson(Geometry geometry)
Updates the GeoJson with a single geometry.
|
void |
setUrl(java.lang.String url)
Updates the url
|
void |
setUrl(java.net.URL url)
Updates the url
|
checkThread, getAttribution, getId, getNativePtr, nativeGetAttribution, nativeGetId, setDetachedpublic 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,
java.lang.String geoJson)
id - the source idgeoJson - raw Json FeatureCollectionpublic GeoJsonSource(java.lang.String id,
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,
FeatureCollection features)
id - the source idfeatures - the featurespublic GeoJsonSource(java.lang.String id,
FeatureCollection features,
GeoJsonOptions options)
id - the source idfeatures - the featuresoptions - optionspublic GeoJsonSource(java.lang.String id,
Feature feature)
Featureid - the source idfeature - the featurepublic GeoJsonSource(java.lang.String id,
Feature feature,
GeoJsonOptions options)
Feature and non-default GeoJsonOptionsid - the source idfeature - the featureoptions - optionspublic GeoJsonSource(java.lang.String id,
Geometry geometry)
Geometryid - the source idgeometry - the geometrypublic GeoJsonSource(java.lang.String id,
Geometry geometry,
GeoJsonOptions options)
Geometry and non-default GeoJsonOptionsid - the source idgeometry - the geometryoptions - optionspublic void setGeoJson(Feature feature)
feature - the GeoJSON Feature to setpublic void setGeoJson(Geometry geometry)
geometry - the GeoJSON Geometry to setpublic void setGeoJson(FeatureCollection features)
features - the GeoJSON FeatureCollectionpublic void setUrl(java.net.URL url)
url - the GeoJSON FeatureCollection urlpublic void setUrl(java.lang.String url)
url - the GeoJSON FeatureCollection urlpublic java.lang.String getUrl()
public java.util.List<Feature> querySourceFeatures(Expression filter)
filter - an optional filter expression to filter the returned Featurespublic FeatureCollection getClusterChildren(Feature cluster)
Requires configuring this source as a cluster by calling GeoJsonOptions.withCluster(boolean).
cluster - cluster from which to retrieve children frompublic FeatureCollection getClusterLeaves(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(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)
protected java.lang.String nativeGetUrl()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable© 2015–2019 Mapbox. All rights reserved.