# GeojsonLayer

# Props

All common layers props

# source

# Computed getters

# getSourceFeatures(filter?)

  • Arguments:
    • filter Array A filter to limit query results.
  • Description Returns an array of GeoJSON Feature objects from assosiated source filtered by filter.
  • See .querySourceFeatures() map method (opens new window)

# getRenderedFeatures(geometry, filter)

  • Arguments:
    • filter Array A filter to limit query results.
    • geometry Array | Object The geometry of the query region.
  • Description Returns an array of visible GeoJSON Feature objects from assosiated source filtered by filter.
  • See .queryRenderedFeatures() map method (opens new window)

# getClusterExpansionZoom(clusterId)

  • Arguments:
    • clusterId Number The value of the cluster's cluster_id property.
  • Description For clustered sources, fetches the zoom at which the given cluster expands and returns Promise with zoom level as payload.
  • See .getClusterExpansionZoom() GeoJSONSource method (opens new window)

# getClusterChildren(clusterId)

  • Arguments:
    • clusterId Number The value of the cluster's cluster_id property.
    • limit Number The maximum number of features to return.
    • offset Number The number of features to skip (e.g. for pagination).
  • Description For clustered sources, fetches the original points that belong to the cluster and returns Promise with an Array of GeoJSON features as payload.
  • See .getClusterChildren() GeoJSONSource method (opens new window)

# getClusterLeaves(clusterId, limit, offset)

  • Arguments:
    • filter Array A filter to limit query results.
    • geometry Array | Object The geometry of the query region.
  • Description Returns Promise with an array of visible GeoJSON Feature objects from assosiated source filtered by filter in the payload.
  • See .getClusterLeaves() GeoJSONSource method (opens new window)

# Methods

# setFeatureState(featureId, state)

  • Arguments:
    • featureId String | Number Feature identifier.
    • state Object A 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 (opens new window)

# getFeatureState(featureId)

  • Arguments:
    • featureId String | Number Feature identifier.
  • Description Gets the state of a feature.
  • See .getFeatureState() map method (opens new window)

# removeFeatureState(featureId?, sourceLayer?, key?)

  • Arguments:
    • featureId String | Number Feature identifier.
    • sourceLayer string Source layer id.
    • key string The 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 (opens new window)

# Events

All common layer events