!function(n){var t=function(n){this.init(n)};t.prototype={init:function(t){var a={id:"",level:15,zoom:!1,type:[],width:0,height:0,titleclass:"",contentclass:"",showpanorama:!1,showmarkpanorama:!1,showlabel:!1,mapstyle:"normal",icon:{},centerpoint:{},index:-1,animate:!1,points:[],callback:function(){}};this.currentdata=null,this.opts=n.extend({},a,t),this.render()},render:function(){var n=this.opts,t=n.id,a=n.centerpoint.lng,e=n.centerpoint.lat,o=n.level,i=new bmap.point(a,e),r=this.map=new bmap.map(t),l=n.mapstyle;r.centerandzoom(i,o),r.setmapstyle({style:l}),this.addcontrol()},addcontrol:function(){var n=this.opts,t=this.map,a=n.type,e=n.zoom,o=n.showpanorama,i=a.length>0?40:20;if(t.addcontrol(new bmap.navigationcontrol),t.addcontrol(new bmap.scalecontrol),t.addcontrol(new bmap.overviewmapcontrol),e&&t.enablescrollwheelzoom(!0),o){var r=new bmap.panoramacontrol;r.setoffset(new bmap.size(12,i)),t.addcontrol(r)}if(a.length>0){var l=this.getmaptype(a);t.addcontrol(new bmap.maptypecontrol({maptypes:l}))}this.rendermarker()},rendermarker:function(){var t=this,a=this.opts,e=this.map,o=a.points,i=a.icon,r=a.animate,l=a.showlabel,s=a.callback;o.length>0&&n.each(o,function(n,o){var p=new bmap.point(o.lng,o.lat),c=new bmap.marker(p);i&&i.url&&(c=new bmap.marker(p,{icon:new bmap.icon(i.url,new bmap.size(i.width,i.height))})),e.addoverlay(c),r&&c.setanimation(bmap_animation_drop),l&&t.renderlabel(o),n===a.index&&t.openinfowindow(o.id),c.addeventlistener("click",function(){t.openinfowindow(o.id),s&&"function"==typeof s&&s(o.id)})})},renderlabel:function(n){var t=this.map,a=n.title,e=new bmap.point(n.lng,n.lat),o=new bmap.label(a,{position:e,offset:new bmap.size(0,0)});t.addoverlay(o)},getmaptype:function(t){var a=[],e={"地图":bmap_normal_map,"卫星":bmap_satellite_map,"三维":bmap_perspective_map};return n.each(t,function(n,t){t in e&&a.push(e[t])}),a},getposition:function(t){var a=this.opts.points,e=null;return t?a.length>0&&n.each(a,function(n,a){a.id===t&&(e=a)}):e=this.currentdata,e},openinfowindow:function(t){var a=this,e=this.map,o=this.opts,i=this.getposition(t),r=i.content,l=new bmap.point(i.lng,i.lat),s=o.showmarkpanorama,p="",c='