From 36a0e36c14163d2d9411ce8efbc0d45e043e0a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 16 Dec 2023 15:19:23 +0100 Subject: [PATCH] fix: accept long floats for latitude and longitude Without "step: any", long floats are considered invalid. --- umap/static/umap/js/umap.features.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 8e826131..7dee60d1 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -680,8 +680,26 @@ L.U.Marker = L.Marker.extend({ appendEditFieldsets: function (container) { L.U.FeatureMixin.appendEditFieldsets.call(this, container) const coordinatesOptions = [ - ['_latlng.lat', { handler: 'FloatInput', label: L._('Latitude') }], - ['_latlng.lng', { handler: 'FloatInput', label: L._('Longitude') }], + [ + '_latlng.lat', + { + handler: 'FloatInput', + label: L._('Latitude'), + step: 'any', + min: -90, + max: 90, + }, + ], + [ + '_latlng.lng', + { + handler: 'FloatInput', + label: L._('Longitude'), + step: 'any', + min: -180, + max: 180, + }, + ], ] const builder = new L.U.FormBuilder(this, coordinatesOptions, { callback: function () {