Prevent to redraw a marker when setting invalid latlng from edit form
cf #799
This commit is contained in:
parent
3927a845a4
commit
3089b71705
2 changed files with 5 additions and 0 deletions
|
@ -546,3 +546,7 @@ L.U.Orderable = L.Evented.extend({
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
L.LatLng.prototype.isValid = function () {
|
||||
return !isNaN(this.lat) && !isNaN(this.lng);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue