用wrapper封裝這樣在物件內外都可以存取
function createMarker(name, lat, lng, state){
var marker = new AMap.Marker({
position : new AMap ); > //the function mapMoveTo is not accessible here too
AMap.event.addListener(marker, "click",function(e){ this.moveMapTo(key, name, state) will raise a unresolved function error
//you should write wrapper function as a member variable
});
}
var _mapMoveTo = function(key, name, state){
//TODO
}
this.mapMTo== 🎜> _mapMoveTo(key, name, state);
}
}