Add FeaturesHaveOwners map option.

WIP
This commit is contained in:
Brian DeRocher 2023-09-20 12:48:32 -04:00
parent e76c147b65
commit e25fb5d04f
3 changed files with 10 additions and 0 deletions

View file

@ -249,6 +249,7 @@ DATABASES = {
} }
UMAP_DEFAULT_SHARE_STATUS = None UMAP_DEFAULT_SHARE_STATUS = None
UMAP_DEFAULT_EDIT_STATUS = None UMAP_DEFAULT_EDIT_STATUS = None
UMAP_DEFAULT_FEATURES_HAVE_OWNERS = True
UMAP_READONLY = env('UMAP_READONLY', default=False) UMAP_READONLY = env('UMAP_READONLY', default=False)
UMAP_GZIP = True UMAP_GZIP = True

View file

@ -108,6 +108,7 @@ L.U.Map.include({
L.Util.setBooleanFromQueryString(this.options, 'displayCaptionOnLoad') L.Util.setBooleanFromQueryString(this.options, 'displayCaptionOnLoad')
L.Util.setBooleanFromQueryString(this.options, 'captionBar') L.Util.setBooleanFromQueryString(this.options, 'captionBar')
L.Util.setBooleanFromQueryString(this.options, 'captionMenus') L.Util.setBooleanFromQueryString(this.options, 'captionMenus')
L.Util.setBooleanFromQueryString(this.options, 'featuresHaveOwners')
for (let i = 0; i < this.HIDDABLE_CONTROLS.length; i++) { for (let i = 0; i < this.HIDDABLE_CONTROLS.length; i++) {
L.Util.setNullableBooleanFromQueryString( L.Util.setNullableBooleanFromQueryString(
this.options, this.options,
@ -1112,6 +1113,7 @@ L.U.Map.include({
'filterKey', 'filterKey',
'facetKey', 'facetKey',
'slugKey', 'slugKey',
'featuresHaveOwners',
'showLabel', 'showLabel',
'labelDirection', 'labelDirection',
'labelInteractive', 'labelInteractive',
@ -1457,6 +1459,12 @@ L.U.Map.include({
label: L._('Feature identifier key'), label: L._('Feature identifier key'),
}, },
], ],
[
'options.featuesHaveOwners',
{
handler: 'Switch', label: L._('Features have owners')
},
],
] ]
builder = new L.U.FormBuilder(this, optionsFields, { builder = new L.U.FormBuilder(this, optionsFields, {

View file

@ -509,6 +509,7 @@ class MapDetailMixin:
"properties": { "properties": {
"zoom": getattr(settings, "LEAFLET_ZOOM", 6), "zoom": getattr(settings, "LEAFLET_ZOOM", 6),
"datalayers": [], "datalayers": [],
"features_have_owners": settings.UMAP_DEFAULT_FEATURES_HAVE_OWNERS,
}, },
} }