mapbox / mapbox/mapbox-gl-js

Support symbols for the source._dataType='vector' instead of source.type=='vector'

Open
#13,138 1 comment 0 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

So to add support to the custom vector layers I noticed that in the style.js we only support symbol layers for the `vector` and `geojson` source types. However I noticed that there is another parameter `source._dataType` which can be used so it also supports custom source types

Here is the line that checks for the source.type

https://github.com/mapbox/mapbox-gl-js/blob/fd2045fd6aef55d9265c9a4c43fb48b294289482/src/style/style.js#L1408

I guess changing it to check based on `source._dataType` will allow custom sources to support symbols too

## Design Alternatives

it allows to add better support for the vector custom sources.

### Implementation

https://github.com/mapbox/mapbox-gl-js/blob/fd2045fd6aef55d9265c9a4c43fb48b294289482/src/style/style.js#L1408

I guess changing it to check based on `source._dataType` will allow custom sources to support symbols too

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 at src/style/style.js around the source.type check linked in the issue, and trace how symbol-layer support is selected for vector and geojson sources. Verify the change would recognize sources whose _dataType is vector while preserving existing behavior for the built-in source types.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.