(function(){window.mapOverlay=function(n,t,i,r){this.point=n;this.type=t;this.data=i;this.opt=r;this.dom=null};window.mapOverlay.prototype=new BMap.Overlay;window.mapOverlay.prototype.initialize=function(n){var t=this;if(this._map=n,this.dom=$("#mapPoint"+this.type).tmpl(this.data,this.opt||{}),n.getPanes().labelPane.appendChild(this.dom.get(0)),this.type==1)this.dom.click(function(){t.opt&&t.opt.beforeClick&&t.opt.beforeClick.call(this,t.dom.data("id"));$(this).addClass("cur").siblings(".mapInfo_label").removeClass("cur");t.opt&&t.opt.afterClick&&t.opt.afterClick.call(this,t.dom.data("id"))});else this.dom.on("mouseover",".point_icon",function(){$(this).addClass("on");t.opt&&t.opt.mouseOver&&t.opt.mouseOver(t.dom.data("id"))}).on("mouseout",".point_icon",function(){$(this).removeClass("on");t.opt&&t.opt.mouseOut&&t.opt.mouseOut(t.dom.data("id"))}).on("click",".point_icon",function(){t.opt&&t.opt.beforeClick&&t.opt.beforeClick(t.dom.data("id"));$(this).addClass("cur").siblings().show().parent().siblings(".mapInfo_label").find(".point_icon").removeClass("cur").siblings(".schoolInfo").hide();var r=$(this).siblings(".schoolInfo"),e=r.width(),u=r.height();r.css({top:-u-44});var f=0,i=0,n=t._map.pointToPixel(t.point);n.x<(e+40)/2+80&&(f=(e+40)/2+80-n.x);n.yt._map.getSize().height&&(i=t._map.getSize().height-72-n.y);(f||i)&&t._map.panBy(f,i);t.opt&&t.opt.afterClick&&t.opt.afterClick(t.dom.data("id"))}).on("click",".close",function(){return $(this).closest(".schoolInfo").hide().siblings().removeClass("cur"),t.opt&&t.opt.close&&t.opt.close($(this).closest(".mapInfo_label").data("id")),!1});return this.dom.get(0)};window.mapOverlay.prototype.draw=function(){var n=this._map.pointToOverlayPixel(this.point),t=$(".point_icon",this.dom);this.dom.css({left:n.x-t.width()/2,top:n.y-t.height()})};window.isInsideChina=function(n,t){var i=new BMap.Point(t,n),r=[new BMap.Point(109.80126612712718,17.898633893295141),new BMap.Point(121.31493800212877,21.946476111300186),new BMap.Point(124.39110987712877,40.047268941252526),new BMap.Point(133.44384425212365,45.091646713711611),new BMap.Point(135.02587550212081,48.051182364615642),new BMap.Point(123.51220362711922,53.385534346864063),new BMap.Point(120.43603175213593,52.858097392100007),new BMap.Point(115.42626612712826,47.992396910145914),new BMap.Point(119.99657862713116,46.862719959824375),new BMap.Point(111.55907862712962,44.96741475271827),new BMap.Point(104.79150050213622,41.642842382008155),new BMap.Point(95.299313002136614,44.027080884966637),new BMap.Point(87.477047377128372,49.2128365916667),new BMap.Point(79.918453627136444,44.780561228881169),new BMap.Point(80.533688002129736,41.708489694897878),new BMap.Point(73.062984877132038,39.371138390177748),new BMap.Point(76.3149380021373,35.749513988666521),new BMap.Point(78.775875502127292,34.382764995024147),new BMap.Point(78.5122036271278,32.029841881231533),new BMap.Point(81.148922377123029,29.7675879471509),new BMap.Point(87.828609877122119,27.531037991582323),new BMap.Point(89.937984877135079,27.997667164503611),new BMap.Point(92.398922377125075,26.591834512784345),new BMap.Point(97.848141127120869,28.230228718445531),new BMap.Point(99.16650050213525,27.062419441231455),new BMap.Point(97.145016127133317,23.8088334580699),new BMap.Point(99.078609877124222,23.728397674313982),new BMap.Point(99.518063002129,21.783339842013376),new BMap.Point(101.89110987712473,20.636245536763482),new BMap.Point(101.71532862713622,22.272186704042909),new BMap.Point(105.84618800213434,23.2447444825754),new BMap.Point(108.04345362712479,21.53828733999238),new BMap.Point(108.39501612713536,18.3997396524843),new BMap.Point(109.80126612712718,17.898633893295141)],u=new BMap.Polygon(r,{strokeColor:"#f50704",fillColor:"#cfcfcf",strokeWeight:5,strokeOpacity:0,fillOpacity:0});return isPointInPolygon(i,u)};window.isPointInRect=function(n,t){if(!(n instanceof BMap.Point)||!(t instanceof BMap.Bounds))return!1;var i=t.getSouthWest(),r=t.getNorthEast();return n.lng>=i.lng&&n.lng<=r.lng&&n.lat>=i.lat&&n.lat<=r.lat};window.isPointInPolygon=function(n,t){var a,e,c,l;if(!(n instanceof BMap.Point)||!(t instanceof BMap.Polygon)||(a=t.getBounds(),!this.isPointInRect(n,a)))return!1;var o=t.getPath(),h=o.length,s=!0,f=0,i,r,u=n;for(i=o[0],e=1;e<=h;++e){if(u.equals(i))return s;if(r=o[e%h],u.latMath.max(i.lat,r.lat)){i=r;continue}if(u.lat>Math.min(i.lat,r.lat)&&u.lat=Math.min(i.lng,r.lng))return s;if(i.lng==r.lng){if(i.lng==u.lng)return s;++f}else{if(c=(u.lat-i.lat)*(r.lng-i.lng)/(r.lat-i.lat)+i.lng,Math.abs(u.lng-c)<2e-10)return s;u.lng=Math.min(i.lat,l.lat)&&u.lat<=Math.max(i.lat,l.lat)?++f:f+=2);i=r}return f%2==0?!1:!0}})()