OK, this one is tricky, don't read it if you're not fully focused.
I'd like to change (add layers to) a map generated by the leaflet-map module.
To make sure of the script order and calls, I copy SC source of the rendered page to make a local html with it, then I adapt it (files locations) to make it work locally.
I get it working locally with scripts above and below the generated map.
Above code:
... (calling leaflet.js and stuff)
<script>
var mapsPlaceholder = [];
L.Map.addInitHook(function () {
mapsPlaceholder.push(this);
});
</script>
the console.log(map); is returning an object locally, but it returns undefined (so error about addTo(map)) when I have the same code blocks in Saltcorn.
OK, this one is tricky, don't read it if you're not fully focused.
I'd like to change (add layers to) a map generated by the leaflet-map module. To make sure of the script order and calls, I copy SC source of the rendered page to make a local html with it, then I adapt it (files locations) to make it work locally. I get it working locally with scripts above and below the generated map.
Above code:
then we have the SC generated map like:
then I add the script below to tweak the map (change provider here, but not only):
the
console.log(map);
is returning an object locally, but it returnsundefined
(so error about addTo(map)) when I have the same code blocks in Saltcorn.Any idea @glutamate ?