mapbox / mapbox/mapbox-gl-js

queryStyledRootProperties method

Open
#11,552 0 comments 0 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

## Motivation

The style editor in Studio uses the map to navigate to layers or components. It would be great if you could click on the map and use something like [`queryRenderedFeatures`](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#queryrenderedfeatures) to find styled root properties (like atmosphere, fog, light)

0

## Design Alternatives

Workaround this by evaluating zoom/pitch/clicked coordinates/root properties set to condition whether to include root property navigation in the tooltip.

## Design

```js
// Return a collection of styled (or default styled) root properties found.
const rootProperties = map.queryStyledRootProperties();
```

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

Start with the existing queryRenderedFeatures API and the Studio style editor described in the issue. Determine how a map click currently reaches layer or component navigation, then define the returned collection for styled or default-styled root properties such as atmosphere, fog, and light. Done means the new queryStyledRootProperties API supports the map-click navigation use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.