Skip to main content

IdentifyFeatures

Task for identifying features at a point across multiple map services with advanced tolerance and filtering options.

Constructor

new IdentifyFeatures(options: IdentifyOptions)
ArgumentTypeDescription
optionsIdentifyOptionsConfiguration options for the identify operation

Options

OptionTypeDefaultDescription
urlstringRequired MapService URL
layersArray<number> | string'all'Layers to identify
tolerancenumber3Search tolerance in pixels
returnGeometrybooleanfalseInclude feature geometry
maxAllowableOffsetnumberGeometry simplification
geometryPrecisionnumberDecimal places for geometry
dynamicLayersArray<object>Dynamic layer definitions
mapExtentobjectCurrent map extent
imageDisplayobjectMap image parameters
returnFieldNamebooleanfalseReturn field names with values
returnUnformattedValuesbooleanfalseReturn raw field values
tokenstringAuthentication token

Chainable Methods

All methods return the task instance for chaining:

task.tolerance(5).layers([0, 1]).returnGeometry(true)
MethodDescription
layers(layers)Set layers to identify
tolerance(pixels)Set search tolerance
returnGeometry(boolean)Include geometry in results
returnFieldName(boolean)Include field names
token(token)Set authentication token

Execution Methods

.at(point, map, callback?)

Identify features at a geographic point.

Parameters:

  • point (LngLat) - Geographic coordinates
  • map (Map) - MapLibre GL or Mapbox GL map instance
  • callback (Function, optional) - Callback function for results

Returns: Promise<FeatureCollection>

.on(map)

Set the map instance for the identify operation.

Parameters:

  • map (Map) - MapLibre GL or Mapbox GL map instance

Returns: IdentifyFeatures (for chaining)

.run()

Execute the identify operation with current parameters.

Returns: Promise<FeatureCollection>

console.log('Identified features:', results.features); });


## Advanced Usage Examples