diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 07bab3cc..9b9d5e01 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -546,3 +546,7 @@ L.U.Orderable = L.Evented.extend({ } }); + +L.LatLng.prototype.isValid = function () { + return !isNaN(this.lat) && !isNaN(this.lng); +} diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 54a0394c..ce17aa0d 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -585,6 +585,7 @@ L.U.Marker = L.Marker.extend({ ]; var builder = new L.U.FormBuilder(this, coordinatesOptions, { callback: function () { + if (!this._latlng.isValid()) return; this._redraw(); this.bringToCenter(); },