mapbox / mapbox/mapbox-gl-js

Distance expression operator

Open
#6,062 8 comments 1 reaction 1 assignee View on GitHub

@zmiao is already working on this.

Since Mar 11, 2020.

  • #10616 by @zmiao — closed without merging
cross-platform :tv: feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

It would be nice to have an expression operator that evaluates to the physical distance between two geographic coordinates. Coupled with an operator that evaluates to the centroid of the current feature and even the ability to apply a gradient to a shape (#4095), it would enable interesting visualizations that draw the viewer’s attention to a particular feature. A more mundane use case would be displaying the distance of each city on the map as you hover over a particular city.

This request is inspired by the `distanceToLocation:fromLocation:(there, here)` function built into NSExpression on iOS and macOS, which returns the distance in meters from the coordinate _there_ to the coordinate _here_.

/cc @anandthakker

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.