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

Enable usage of leaflet plugins #4289

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

tfitzsim
Copy link
Contributor

@tfitzsim tfitzsim commented Jan 30, 2025

This change enables the usage of leaflet plugins by accepting an additional argument to leaflet, which is as list of additional resources (.js and .css) to load after leaflet but before the map is created.

A small example is included to demonstrate and test the functionality using the leaflet-rotatedmarker plugin.


Feature request: #2767

Trevor Fitzsimmons and others added 2 commits January 30, 2025 13:58
This change enables the usage of leaflet plugins by accepting an
additional argument to leaflet, which is as list of additional
resources (.js and .css) to load after leaflet but before the
map is created.

A small example is included to demonstrate and test the functionality
using the leaflet-rotatedmarker plugin.
Copy link
Contributor

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request, @tfitzsim!

I just reviewed your code and made a few changes:

  • We can move the example into an interactive demo on the documentation page.
  • The JavaScript call can be replaced by calling m.marker with the rotation angle added to the options dictionary.
  • The additional_resources parameter was missing a description in the docstring. And we need to use the List type from the typing module for compatibility with Python 3.8.
  • The operation additional_resources | [] is invalid and needed to be replaced with additional_resources or [].
  • The JavaScript call to loadResources could be simplified.

Let's merge! 🙂

@falkoschindler falkoschindler added the enhancement New feature or request label Jan 31, 2025
@falkoschindler falkoschindler added this to the 2.11 milestone Jan 31, 2025
@falkoschindler falkoschindler merged commit 2f386dd into zauberzeug:main Jan 31, 2025
1 check passed
@falkoschindler falkoschindler changed the title Enable usage of leaflet plugins (#2767) Enable usage of leaflet plugins Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants