mapbox / mapbox/mapbox-gl-leaflet

Mapbox logo/attribution controls not visible

Open
#147 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
546
Forks
148
PR merge metrics
No merged PRs in 30d

Description

It seems that the attribution controls are not visible by default in mapbox-gl-leaflet. The text attribution is disabled by default, and while the logo renders, it appears outside of the visible bounds of the Leaflet map, and even if you eliminate the padding (so that the size of the mapbox and Leaflet maps are the same), the z-index makes it render behind the map. The same applies to Mapbox's attribution control if it is manually enabled.

The problem with this is that a licensing requirement for Mapbox is to display attribution and the logo:
https://docs.mapbox.com/help/getting-started/attribution/

Unlike vanilla Mapbox GL JS, Mapbox GL Leaflet does not comply by default. As such, users of the tool must either make changes to make the default attribution visible, or add Leaflet for this (Leaflet provides an attribution control, though you'd need another control for the logo). In my case I've created custom Leaflet controls that take the Mapbox controls and add them to the corresponding corners of the Leaflet map. However, it would be better if this were not necessary.

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 by reproducing the missing Mapbox logo and attribution controls in mapbox-gl-leaflet, checking their positioning, visibility, and z-index relative to the Leaflet map. Done means Mapbox attribution text and logo are visible by default without requiring custom Leaflet controls, while complying with the linked Mapbox attribution requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.