mapbox / mapbox/mapbox-gl-js

hasFeatures function

Open
#7,813 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple: good first issue needs discussion :speech_balloon:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Would it be possible to add a function that checks if there are any features in a query? It would work like queryRenderedFeatures but only return true or false.

This would make it more efficient to query if there are any areas under the mousepointer for changing the cursor style.

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 the existing queryRenderedFeatures API entry point and trace how it determines features under the mouse pointer. Add a boolean hasFeatures result for the same query, then verify that it correctly distinguishes areas with and without features for cursor-style changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
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.