用wrapper封装这样在对象内外都可以访问 代码如下:function MapPool(){ function createMarker(name, lat, lng, state){ var marker = new AMap.Marker({ position : new AMap.LngLat(lng, lat), }); //the function mapMoveTo is not accessible here too AMap.event.addListener(marker, “click”,function(e){ //move