mapbox / mapbox/mapbox-gl-js

Support Polygon for tile_bounds !

Open
#7,556 0 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

When working with raster layers we often have parse data or not `square` source, resulting in really poor performance (because mapbox-gl-js is trying to load tiles that don't exist.)

I understand that support polygons (or even Multipolygons) will also impact the performance but I'd like to see if this could be an alternative.

## Design Alternatives

> "do nothing" an option

Sure this is not something that have to be implemented but will be a nice to have 🙉

## Design

Not sure if @mourner have a really light and performance `polygon` intersection algorithm we could use 😄

The best option will be to keep this as invisible as possible for the user, which will either pass a `[number, number, number, number]` or a geojson like polygon feature representing the bounds.

### Concepts

> Where do the concepts set new precedents?

Well this could set some precedents where user could ask for more feature type support (e.g multi-poylgon) or to support this kind a `bounds` in other api.

Thanks

👼 🙏

I'll be happy to start a sketch PR... but might not be the best person to do it

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 by tracing how tile_bounds is handled for raster layers and how mapbox-gl-js decides which tiles to load. The issue names no files, tests, or implementation entry points, and its proposed polygon input and intersection behavior are still open; done would require an agreed design plus implementation and coverage for polygon bounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.