Describe the bug
For implementing completely customized map providers, decidim 0.24 allowed to override the javascript function createMapController. This is still documented in a comment in factory.js. However, since the migration to Webpacker, the function createMapController is no longer read from the global window.Decidim object, but rather imported directly from "src/decidim/map/factory". This makes it impossible (as far as I know) to cleanly add a custom map provider.
I am currently researching more hacky ways to work around this issue on our side. But really this should be fixed in decidim itself. In map.js, there is a comment indicating that one can "override" the document.ready handler, but I am pretty sure overriding a $(() => { ... }) function is not possible. Maybe @ferblape can explain how he intended us to extend the map js code when he wrote this comment?
To Reproduce
Steps to reproduce the behavior:
- Go to https://try.decidim.org
- Optionally, navigate to any page with a map on it, e.g. https://try.decidim.org/processes/E3CoCo/f/124/
- Open the dev console
- Type in
window.Decidim.createMapController and hit enter -> the result is undefined
Expected behavior
The function window.Decidim.createMapController should still be defined and used as the single source of truth for creating maps.
Or alternatively, another way should be provided and documented to install completely customized js map controllers.
Extra data (please complete the following information):
- Device: any
- Device OS: any
- Browser: any
- Decidim Version: 0.26
- Decidim installation: any
Additional context
Describe the bug
For implementing completely customized map providers, decidim 0.24 allowed to override the javascript function
createMapController. This is still documented in a comment in factory.js. However, since the migration to Webpacker, the functioncreateMapControlleris no longer read from the globalwindow.Decidimobject, but rather imported directlyfrom "src/decidim/map/factory". This makes it impossible (as far as I know) to cleanly add a custom map provider.I am currently researching more hacky ways to work around this issue on our side. But really this should be fixed in decidim itself. In map.js, there is a comment indicating that one can "override" the document.ready handler, but I am pretty sure overriding a
$(() => { ... })function is not possible. Maybe @ferblape can explain how he intended us to extend the map js code when he wrote this comment?To Reproduce
Steps to reproduce the behavior:
window.Decidim.createMapControllerand hit enter -> the result isundefinedExpected behavior
The function
window.Decidim.createMapControllershould still be defined and used as the single source of truth for creating maps.Or alternatively, another way should be provided and documented to install completely customized js map controllers.
Extra data (please complete the following information):
Additional context