Calculate Distances in Virtual Fields

You can calculate distance using virtual fields that are based on retrievable index fields. These distances can then display as hit meta.

See Also
Calculating Results On-The-Fly with Virtual Fields
  • When #distance is used with a name, @thename.distance returns the distance to the center. It is also possible to use #dist(pointField, lat/x, lng/y) to return the distance of the point to (lat, lng) or (x, y) depending on the coordinate format.
  • When GPS points are used the distance is in meters.

You can also use #lat(point) to get the latitude or the X component of a point, and #lng(point) to get the longitude or the Y component of a point.