mapbox / mapbox/mapbox-gl-js

querySourceFeatures returns the data doubled

Open
#13,034 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

I created a Style https://api.mapbox.com/styles/v1/nurp/clqxnrutg005s01pddzsbchyz.html?title=view&access_token=pk.eyJ1IjoibnVycCIsImEiOiJjajVkaWF0NnUwYTdsMnduejdpZjIydjd1In0.BTjYUbXCFa5UUhqdbficyg&zoomwheel=true&fresh=true#0.54/0/0

Uploaded my geojson source with 7 features in it.

On my javascript page, I call this and see that it returns an array of 14 objects. First 7 objects are repeated again somehow
map.querySourceFeatures('composite', { sourceLayer: 'small_data-d3ir0g'})
Is this expected or bug?

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 with the reported map.querySourceFeatures('composite', { sourceLayer: 'small_data-d3ir0g' }) call and the linked style, then reproduce the seven-feature GeoJSON case. Compare the returned features and determine whether duplicate results are expected for this source; done means the behavior is clarified or corrected with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, frontend, web-dev
Issue type
Bug
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.