Restrict possible min/max zoom values

Fix #1318
This commit is contained in:
David Larlet 2023-09-19 13:56:11 -04:00
parent 038a1a3c4d
commit aed9e898e9
No known key found for this signature in database
GPG key ID: 3E2953A359E7E7BD
2 changed files with 30 additions and 4 deletions

View file

@ -669,6 +669,11 @@ input[type=hidden].blur + .button {
/*box-shadow: inset 0 0 0 1px #215d9c;*/ /*box-shadow: inset 0 0 0 1px #215d9c;*/
color: #efefef; color: #efefef;
} }
input:invalid {
border-color: red;
background-color: darkred;
}
/* *********** */ /* *********** */
/* Alerts */ /* Alerts */

View file

@ -14,6 +14,7 @@ L.Map.mergeOptions({
default_popupContentTemplate: '# {name}\n{description}', default_popupContentTemplate: '# {name}\n{description}',
default_interactive: true, default_interactive: true,
default_labelDirection: 'auto', default_labelDirection: 'auto',
maxZoomLimit: 20,
attributionControl: false, attributionControl: false,
allowEdit: true, allowEdit: true,
embedControl: true, embedControl: true,
@ -1524,11 +1525,21 @@ L.U.Map.include({
], ],
[ [
'options.tilelayer.maxZoom', 'options.tilelayer.maxZoom',
{ handler: 'BlurIntInput', placeholder: L._('max zoom') }, {
handler: 'BlurIntInput',
placeholder: L._('max zoom'),
min: 0,
max: this.options.maxZoomLimit,
},
], ],
[ [
'options.tilelayer.minZoom', 'options.tilelayer.minZoom',
{ handler: 'BlurIntInput', placeholder: L._('min zoom') }, {
handler: 'BlurIntInput',
placeholder: L._('min zoom'),
min: 0,
max: this.options.maxZoomLimit,
},
], ],
[ [
'options.tilelayer.attribution', 'options.tilelayer.attribution',
@ -1563,11 +1574,21 @@ L.U.Map.include({
], ],
[ [
'options.overlay.maxZoom', 'options.overlay.maxZoom',
{ handler: 'BlurIntInput', placeholder: L._('max zoom') }, {
handler: 'BlurIntInput',
placeholder: L._('max zoom'),
min: 0,
max: this.options.maxZoomLimit,
},
], ],
[ [
'options.overlay.minZoom', 'options.overlay.minZoom',
{ handler: 'BlurIntInput', placeholder: L._('min zoom') }, {
handler: 'BlurIntInput',
placeholder: L._('min zoom'),
min: 0,
max: this.options.maxZoomLimit,
},
], ],
[ [
'options.overlay.attribution', 'options.overlay.attribution',