mapbox / mapbox/mapbox-gl-js

Mapbox GL JS: Some coordinates are not rendered

Open
#8,790 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation :mag:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

I'm processing a multi-polygon geojson, but some polygons are not rendered with mapbox-gl-js, generating some gaps. The use of mapbox-js features renders correctly. This problem only occurs with the mapbox-gl-js API. This problem also occurs in Mapbox Studio when rederizing a tileset in a style even though the polygon exists in the dataset.

That's the link to the geojson:
geojson

This is the code snippet where I add the layer, with mapbox-gl-js:
Result
map.addSource( < id > , { type: 'vector', url: < url > }); map.addLayer({ "id": < id > , "type": "fill", "source": < id > , "source-layer": < id > , "layout": {}, "paint": { "fill-color": ["interpolate", ["linear"], ["get", "title"], 0.00, "red", 0.30, "#8aac75", 0.60, "#00e6e6", 0.90, "#00c0cc", 1.20, "#00a5cc", 1.50, "#007fcc", 1.80, "#000066", 2.10, "#0018cc", 2.40, "#0000ba", 2.70, "#000099", 3.00, "#000076", 3.30, "#000066", 3.60, "purple" ] } }, < layerId > );

This is the code snippet where I add the layer, with mapbox-js:
Result
var featureLayer = L.mapbox.featureLayer().addTo(tmap); featureLayer.loadURL('/geojson');

Would anyone know what may be generating this error?

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 reproducing the missing polygons with the linked GeoJSON and the map.addSource/map.addLayer snippet, then compare the Mapbox GL JS result with the mapbox-js featureLayer result and the Mapbox Studio rendering. Done means identifying a reproducible cause for the gaps and documenting or fixing the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.