ckanext-geoview
ckanext-geoview copied to clipboard
Allow custom Leaflet options
Currently it's impossible to change most of the Leaflet options, since they are set automatically based on the more general map options (ckanext.spatial.common_map.*
). In my opinion, the options for Leaflet's map
should be separately configurable both via the INI:
ckanext.spatial.leaflet.map.zoom = 14
ckanext.spatial.leaflet.map.maxZoom = 16
This would require the support for a corresponding data-module-*
attribute in the JS modules, with the additional benefit of being able to change the Leaflet map options for a specific instance of the map (for example, if you're using both the normal preview and ckanext-spatial's dataset extent map and only want to change the configuration of the latter).
Sounds good, you can follow the same approach as the existing map options adding a separate data-module-leaflet-options
tag. The commonLeafletMap
function already supports being passed custom Leaflet options, so just have to connect the dots :)