/location/nnearest

The module exports a utility method for the nnearest query template.

Requires

Methods

(inner) nnearest(params)

The nnearest method gets coordinates from a feature geometry passed in the params argument.

A parameterised query to the get_nnearest template will be sent. The n for the nearest records query param is implied by the count property value of a cluster feature.

The records returned from the query are presented in a list popup positioned on the feature geometry.

Clicking on a list element allows to get the location associated with the query response record.

Parameters:
NameTypeDescription
paramsobject

Parameter for the nnearest location query.

Properties
NameTypeDescription
params.mapviewmapview

The mapview for locations layer.

params.laterlayer

The locations layer.

params.featureobject

Query records nnearest to the feature.geometry.

params.tablestring

The database table for the query.