mapbox / mapbox/mapbox-gl-js

Differentiate between text-click and symbol click when in same layer?

Open
#7,981 5 comments 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

I have a symbol layer that has both icon and text properties, creating an icon and text. I want different click behavior when I click the text or the icon, but nothing in the API events seems to give me a clue as to whether an icon or text were actually clicked because they are in the same layer. Any ideas, even if I need to dig into the internals?

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

No file or test is named. Start by reviewing the symbol-layer event API and the event data available for rendered features; done would mean a documented or implemented way to distinguish an icon click from a text click within the same layer.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.