Skip to content

Commit 38bc2ec

Browse files
OlivOlivier Gasc
andauthored
Reset movingMarker only if it has been set (#23)
Co-authored-by: Olivier Gasc <[email protected]>
1 parent 319254b commit 38bc2ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/select.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@ var Select = L.Control.extend( /** @lends Select.prototype */ {
198198
this._selection = null;
199199
}
200200

201-
this._movingMarker.setLatLng(this._layer.getLatLngs()[0]);
201+
if (this._movingMarker) {
202+
this._movingMarker.setLatLng(this._layer.getLatLngs()[0]);
203+
}
204+
202205
if (!this.options.useTouch) {
203206
//this._movingMarker.show();
204207
this._map.addLayer(this._movingMarker);

0 commit comments

Comments
 (0)