mapbox / mapbox/mapbox-gl-js

Custom pop up not rotating when the map rotates

Open
#12,893 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

👋 Hello Mapbox Community,

I'm experiencing an issue with customizing the behavior of the Mapbox popup tip. Specifically, the problem is that my custom tip doesn't rotate in sync with the map. I've attempted to apply a CSS transform property to adjust its orientation, but unfortunately, that doesn't seem to work.

📷 Issue Visualized:
(Please refer to the attached image for a clear understanding of the issue.)

📝 What I've Tried:
I'm adding popups programmatically and have also used the following CSS to style the popup tip:

```CSS
.mapboxgl-popup-tip {
width: 20px !important;
height: 20px !important;
background: linear-gradient(to right, red 50%, green 50%) !important;
clip-path: polygon(50% 100%, 0% 0%, 100% 0%) !important;
}
```

Despite these custom styles, the tip refuses to rotate when the map itself is rotated, essentially disregarding any transform styles that I try to apply.

I'd really appreciate any insights or solutions to this challenge. Has anyone faced similar issues or has advice on how to successfully apply the transform property to the Mapbox popup tip?

Thanks in advance for your assistance! 🙏

![image](https://github.com/mapbox/mapbox-gl-js/assets/12662909/82ce56a0-7d6b-4b0a-9438-326307073af6)

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 source files or tests are identified in the issue. Start by reproducing the popup behavior with the provided CSS while rotating the map; done would mean the custom popup tip rotates in sync with the map.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.