Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attribution handling to the layer #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fityannugroho
Copy link

Summary

This PR introduces enhancements to improve attribution handling. The key changes include dynamic retrieval of attributions from MapLibre styles, support for custom attribution controls, and additional events to synchronize attribution updates.

Key Changes

Custom Attribution Handling

  • Feature: The getAttribution method now dynamically retrieves attributions from MapLibre style sources if attributionControl is enabled and no custom attribution is specified.
  • Fallback: If no valid attributions are found, it defaults to an empty string.

Automatic Attribution Update on Map Load

  • Added an event listener to the load event of the MapLibre instance to update the Leaflet map's attribution control dynamically after the MapLibre map has fully loaded.

Why This Change?

  • Dynamic Attribution Support: Automatically gathering attributions from MapLibre sources ensures compliance with licensing terms without requiring manual input.
  • Customization Flexibility: Developers can specify their own attributions via options.attributionControl.customAttribution when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant