mapbox / mapbox/tilejson-spec

Bounds where left > right

Open
#25 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

v3 v4
Dominant language
No language data
Stars
296
Forks
51
PR merge metrics
No merged PRs in 30d

Description

If I have a tile source that goes from west of Australia to ~east~ right of New Zealand, I would expect to be able to write the `bounds` as:

```
[90, -70, -170, 70] // left, bottom, right, top
```

Unfortunately this doesn't seem to produce a valid tilejson (in Mapbox GL JS no tiles are requested for this source).

It's not possible to workaround this by just switching the left/right longitudes, because that represents all the negative space where there is no data. Leaving the only possible workaround to specify the entire -180°/180° range:

```
[-180, -70, 180, 70],
```

This results in a lot of unnecessary requests to the server that just result in 404 responses, and also prevents the ability to draw a border around the bounds. However it works from a user perspective because all data is shown.

Extending the bounds beyond 180° to 190° (below) results in appropriate requests, but nothing between 180° and 190°(with Mapbox GL JS as the implementation).

```
[90, -70, 190, 70]
```

Should the spec be able to support bounds where the left longitude is greater than the right longitude?

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

Review the TileJSON bounds definition and the Mapbox GL JS behavior described in this issue, comparing the examples that cross the antimeridian. Done means the specification explicitly resolves whether left > right is valid and documents the resulting behavior or workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, json
Domain
documentation
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.