ckanext-geoview icon indicating copy to clipboard operation
ckanext-geoview copied to clipboard

Allow custom Leaflet options

Open torfsen opened this issue 8 years ago • 1 comments

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).

torfsen avatar Oct 07 '16 12:10 torfsen

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 :)

amercader avatar Oct 07 '16 14:10 amercader