mapbox / mapbox/mapbox-gl-js

Allow rendering of lines and polygons within a clustered GeoJSON source

Open
#3,419 18 comments 17 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

**mapbox-gl-js version 0.26.0**:

I'm working on an angular app where it's difficult to know in advance if the GeoJSON data will include points, lines, polygons or any combination of valid GeoJSON features.
### Steps to Trigger Behavior
1. load polygons or lines into a Mapbox GL map
2. on `map.addSource()` set `cluster:true`
3. add a layer of polygons or lines `map.addLayer()`
4. view map in browser
### Expected Behavior

If clustering is turned on, but the data is comprised of lines or polygons, it would be great if the map would still render the valid GeoJSON. If there is a combination of lines, polygons, and points - it would be nice if Mapbox GL would render the lines and polygons normally, while clustering the points as expected.
### Actual Behavior

The map does not render any points, lines, or polygons.

Thank you kindly.

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 behavior in a browser with a GeoJSON source configured through map.addSource() with cluster:true, then add line and polygon layers with map.addLayer(). Verify how points, lines, polygons, and mixed feature collections render. Done means non-point features render normally while point features still cluster as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.