mapbox / mapbox/mapbox-gl-js

Expression for bounds?

Open
#5,847 3 comments 3 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

Sometimes I need to exclude or include certain bounds in a layer.
Currently my only solution is to get all the features within bound and exclude them by id.
This is an extremely costly process and works only with features having specific ids.

Design Alternatives

Something like:
["in","bounds",[sw.lng, sw.lat, ne.lng, ne.lat]]

(maybe it would be also nice to access geometry or feature bounds directly, but... don't wanna be greedy)

Design

["in","bounds",[sw.lng, sw.lat, ne.lng, ne.lat]]

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

No files or tests are named. Start by locating the existing layer expression and feature-filtering entry points, then compare their behavior with the proposed ["in","bounds",[sw.lng, sw.lat, ne.lng, ne.lat]] syntax; done means bounds can be used for inclusion or exclusion without fetching features and filtering them by ID.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.