# GeojsonLayer
# Props
All common layers props
# source
- Type:
Object | String - Non-Synced
- Description: A source containing GeoJSON or URL to it.
- See:
GeoJSONSourcein Mapbox API Docs
# Computed getters
# getSourceFeatures(filter?)
- Arguments:
filterArrayA filter to limit query results.
- Description Returns an array of GeoJSON Feature objects from assosiated source filtered by
filter. - See
.querySourceFeatures()map method
# getRenderedFeatures(geometry, filter)
- Arguments:
filterArrayA filter to limit query results.geometryArray | ObjectThe geometry of the query region.
- Description Returns an array of visible GeoJSON Feature objects from assosiated source filtered by
filter. - See
.queryRenderedFeatures()map method
# getClusterExpansionZoom(clusterId)
- Arguments:
clusterIdNumberThe value of the cluster's cluster_id property.
- Description For clustered sources, fetches the zoom at which the given cluster expands and returns
Promisewith zoom level as payload. - See
.getClusterExpansionZoom()GeoJSONSource method
# getClusterChildren(clusterId)
- Arguments:
clusterIdNumberThe value of the cluster's cluster_id property.limitNumberThe maximum number of features to return.offsetNumberThe number of features to skip (e.g. for pagination).
- Description For clustered sources, fetches the original points that belong to the cluster and returns
Promisewith anArrayof GeoJSON features as payload. - See
.getClusterChildren()GeoJSONSource method
# getClusterLeaves(clusterId, limit, offset)
- Arguments:
filterArrayA filter to limit query results.geometryArray | ObjectThe geometry of the query region.
- Description Returns
Promisewith an array of visible GeoJSON Feature objects from assosiated source filtered byfilterin the payload. - See
.getClusterLeaves()GeoJSONSource method
# Methods
# setFeatureState(featureId, state)
- Arguments:
featureIdString | NumberFeature identifier.stateObjectA set of key-value pairs. The values should be valid JSON types.
- Description Sets the state of a feature. The state object is merged in with the existing state of the feature.
- See
.setFeatureState()map method
# getFeatureState(featureId)
- Arguments:
featureIdString | NumberFeature identifier.
- Description Gets the state of a feature.
- See
.getFeatureState()map method
# removeFeatureState(featureId?, sourceLayer?, key?)
- Arguments:
featureIdString | NumberFeature identifier.sourceLayerstringSource layer id.keystringThe key in the feature state to reset.
- Description Removes feature state, setting it back to the default behavior. If no featureId or key is specified, removes all states of that source. If featureId is also specified, removes all keys for that feature's state. If key is also specified, removes that key from that feature's state.
- See
.removeFeatureState()map method
# Events
All common layer events