diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index 05af31bf..5bc48647 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -669,6 +669,11 @@ input[type=hidden].blur + .button { /*box-shadow: inset 0 0 0 1px #215d9c;*/ color: #efefef; } +input:invalid { + border-color: red; + background-color: darkred; +} + /* *********** */ /* Alerts */ diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 27414e33..8537819e 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -14,6 +14,7 @@ L.Map.mergeOptions({ default_popupContentTemplate: '# {name}\n{description}', default_interactive: true, default_labelDirection: 'auto', + maxZoomLimit: 20, attributionControl: false, allowEdit: true, embedControl: true, @@ -1524,11 +1525,21 @@ L.U.Map.include({ ], [ 'options.tilelayer.maxZoom', - { handler: 'BlurIntInput', placeholder: L._('max zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('max zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.tilelayer.minZoom', - { handler: 'BlurIntInput', placeholder: L._('min zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('min zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.tilelayer.attribution', @@ -1563,11 +1574,21 @@ L.U.Map.include({ ], [ 'options.overlay.maxZoom', - { handler: 'BlurIntInput', placeholder: L._('max zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('max zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.overlay.minZoom', - { handler: 'BlurIntInput', placeholder: L._('min zoom') }, + { + handler: 'BlurIntInput', + placeholder: L._('min zoom'), + min: 0, + max: this.options.maxZoomLimit, + }, ], [ 'options.overlay.attribution',