mapbox / mapbox/mapbox-gl-js

Access feature geometry in an expression

Open
#8,218 8 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Question
`{
"geometry":{
"coordinates":[
-117.8173828125,
33.651208299204995
],
"type":"Point"
},
"id":"1",
"properties":{
"cluster":true,
"cluster_id":1,
"point_count":34,
"point_count_abbreviated":"34"
},
"type":"Feature"
}`

How to get the value of geometry coordinates points using "get" expression method? Hope `["get", string, object]: value` will help, but tried to write the expression as ["get", "coordinates", "geometry"] but it's not working, Can you please help me?

### Links to related documentation
https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-get

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.

Research direction

Read the linked style-spec expressions/get documentation first and compare its documented arguments with the supplied GeoJSON Feature example. Done means the documentation explains whether geometry coordinates can be accessed in an expression and shows the supported usage or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.