I add a listener to a button
L.DomEvent
.addListener(selectList, 'click', L.DomEvent.stopPropagation)
.addListener(selectList, 'click', L.DomEvent.preventDefault)
.addListener(selectList, 'click', this._onMarkerChange);
And then I want to move map by panto function.
_onMarkerChange: function (){
this._handlingClick = true;
for (var opt in this) {
if(this[opt].selected)
{
var lat = this[opt].getAttribute( "data-lat" );
var lon = this[opt].getAttribute( "data-lon" );
this.L.Map.panTo( new L.LatLng( lat, lon ) );
break;
}
}
this._handlingClick = false;
},
It has an error --Uncaught ReferenceError: map is not defined How should I do? pass map object into this event?