-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
How to pass configuration to plugins? #401
Comments
Datasette-cluster-map doesn't use the new plugin configuration mechanism yet - it really should! The best example of how to use this mechanism right now is embedded in the Datasette unit tests: Lines 266 to 270 in b7257a2
datasette/tests/test_plugins.py Lines 139 to 145 in b7257a2
|
I've released a new version of the datasette-cluster-map plugin to illustrate how plugin configuration can work: simonw/datasette-cluster-map@fcc86c4 |
Thanks. I'll take a look at your changes. |
Hi,
Firstly, thanks for your work on datasette, it is a hugely useful tool!
I've been working on a fork [https://github.com/dazzag24/datasette-cluster-map] of datasette-cluster-map to allow the tileserver to be easily switched. Primarily because the tiles being served in the current version use localised text for labels and I'd like to have English used for these names instead.
It uses http://leaflet-extras.github.io/leaflet-providers/preview/ to allow you to simply set the tile provider using a call like so:
instead of the current:
However I've got stuck in trying to work out how to pass the provider string to the plugin.
In the documentation: https://datasette.readthedocs.io/en/stable/plugins.html you discuss configuration of plugins and use an example of passing in which latitude and longitude columns should be used. However I cannot seem to see anywhere in the current datasette-cluster-map code where these config params are passed in or used.
Can you please point me to an example or how to pass configuration from the metadata.json down into a plugin. Once I've over come this issue I was wondering if you would be interested in taking this change into your version?
Many thanks
Darren
The text was updated successfully, but these errors were encountered: