CustomWebSDK.min.js 94 KB

1
  1. var _typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(w){return typeof w}:function(w){return w&&"function"===typeof Symbol&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w};function _possibleConstructorReturn(w,h){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||"object"!==typeof h&&"function"!==typeof h?w:h}function _inherits(w,h){if("function"!==typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function, not "+typeof h);w.prototype=Object.create(h&&h.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}});h&&(Object.setPrototypeOf?Object.setPrototypeOf(w,h):w.__proto__=h)}function _classCallCheck(w,h){if(!(w instanceof h))throw new TypeError("Cannot call a class as a function");}(function(w){"object"===("undefined"===typeof exports?"undefined":_typeof(exports))&&"undefined"!==typeof module?module.exports=w():"function"===typeof define&&define.amd?define([],w):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Custom=w()})(function(){return function h(k,n,g){function d(b,e){if(!n[b]){if(!k[b]){var f="function"==typeof require&&require;if(!e&&f)return f(b,!0);if(a)return a(b,!0);f=Error("Cannot find module '"+b+"'");throw f.code="MODULE_NOT_FOUND",f;}f=n[b]={exports:{}};k[b][0].call(f.exports,function(f){var e=k[b][1][f];return d(e?e:f)},f,f.exports,h,k,n,g)}return n[b].exports}for(var a="function"==typeof require&&require,c=0;c<g.length;c++)d(g[c]);return d}({1:[function(h,k,n){h=L.extend({},L.CRS.Earth,{code:"EPSG:4326",projection:L.Projection.LonLat,transformation:new L.Transformation(1/180,1,-1/180,.5),scale:function(g){return 256*Math.pow(2,g-1)}});k.exports=h},{}],2:[function(h,k,n){L.Control.Attribution.prototype.options={position:"bottomright"};L.Map.TouchZoom.prototype._onTouchMove=function(g){return function(d){if(d.touches&&2===d.touches.length&&this._zooming){var a=this._map,c=a.mouseEventToContainerPoint(d.touches[0]),b=a.mouseEventToContainerPoint(d.touches[1]),e=c.distanceTo(b)/this._startDist;this._zoom=a.getScaleZoom(e,this._startZoom)+1;!a.options.bounceAtZoomLimits&&(this._zoom<a.getMinZoom()&&1>e||this._zoom>a.getMaxZoom()&&1<e)&&(this._zoom=a._limitZoom(this._zoom));if("center"===a.options.touchZoom){if(this._center=this._startLatLng,1===e)return}else{c=c._add(b)._divideBy(2)._subtract(this._centerPoint);if(1===e&&0===c.x&&0===c.y)return;this._center=a.unproject(a.project(this._pinchStartLatLng,this._zoom).subtract(c),this._zoom)}this._moved||(a._moveStart(!0),this._moved=!0);L.Util.cancelAnimFrame(this._animRequest);a=L.bind(a._move,a,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=L.Util.requestAnimFrame(a,this,!0);L.DomEvent.preventDefault(d)}}}(L.Map.TouchZoom.prototype._onTouchMove);L.Map.prototype.flyTo=function(g){return function(d,a,c){function b(b){b=(u*u-h*h+2.0164*(b?-1:1)*2.0164*k*k)/(4.0328*(b?u:h)*k);b=Math.sqrt(b*b+1)-b;return 1E-9>b?-18:Math.log(b)}function e(b){return(Math.exp(b)+Math.exp(-b))/2}function f(b){return h*(e(n)/e(n+1.42*b))}function m(b){var f=e(n);b=n+1.42*b;b=(Math.exp(b)-Math.exp(-b))/2/e(b);return h*(f*b-(Math.exp(n)-Math.exp(-n))/2)/2.0164}function r(){var b=(Date.now()-D)/v,e=(1-Math.pow(1-b,1.5))*E;1>=b?(this._flyToFrame=L.Util.requestAnimFrame(r,this),this._move(this.unproject(p.add(l.subtract(p).multiplyBy(m(e)/k)),g),this.getScaleZoom(h/f(e),g),{flyTo:!0})):(a=Math.round(a),this._move(d,a)._moveEnd(!0))}c=c||{};if(!1===c.animate||!L.Browser.any3d)return this.setView(d,a,c);this._stop();var p=this.project(this.getCenter()),l=this.project(d),q=this.getSize(),g=this._zoom;d=L.latLng(d);a=void 0===a?g:a;var h=Math.max(q.x,q.y),u=h*this.getZoomScale(g,a),k=l.distanceTo(p)||1,n=b(0),D=Date.now(),E=(b(1)-n)/1.42,v=c.duration?1E3*c.duration:800*E;this._moveStart(!0);r.call(this);return this}}(L.Map.prototype.flyTo);if(window.ActiveXObject||"ActiveXObject"in window)String.prototype.startsWith=function(g){return null==g||""==g||0==this.length||g.length>this.length||this.substr(0,g.length)!=g?!1:!0},String.prototype.endsWith=function(g){return window.ActiveXObject||"ActiveXObject"in window?-1!==this.indexOf(g,this.length-g.length):this.endsWith(g)}},{}],3:[function(h,k,n){k.exports="jssdk_bate@ leaflet 2.1.5"},{}],4:[function(h,k,n){h=function(){function g(){_classCallCheck(this,g);this.otherDisplay=!0;this.layers=[];this.order=[]}g.prototype.addFilterLayer=function(d){this.layers.push(d)};g.prototype.removeFilterLayerById=function(d){for(var a=0;a<this.layers.length;a++)this.layers[a].id==d&&this.layers.splice(a,1)};return g}();k.exports=h},{}],5:[function(h,k,n){h=function(g){function d(){_classCallCheck(this,d);var a=_possibleConstructorReturn(this,g.call(this));a.id=null;a.filters={};a.idFilter=null;a.filterStr=null;a.display=!0;return a}_inherits(d,g);d.prototype.addFilterField=function(a,c){this.filters[a]=c};d.prototype.removeFilterField=function(a){delete this.filters[a]};return d}(h("./Filter"));k.exports=h},{"./Filter":4}],6:[function(h,k,n){k=k.exports={};h("./ext/LeafletExt");L.CRS.CustomEPSG4326=h("./ext/CRS.CustomEPSG4326");k.DataSource=h("./layer/datasource/DataSource");k.URLDataSource=h("./layer/datasource/URLDataSource");k.LocalDataSource=h("./layer/datasource/LocalDataSource");L.GLabelGrid=h("./layer/label/GLabelGrid");L.GWVTAnno=h("./layer/label/GWVTAnno");k.Feature=h("./layer/label/feature/Feature");k.GGroup=h("./layer/vector/stylejs/GGroup");k.GLevels=h("./layer/vector/stylejs/GLevels");k.GStyleItem=h("./layer/vector/stylejs/GStyleItem");L.GDynamicMap=h("./layer/vector/GDynamicMap");L.GVMapGrid=h("./layer/vector/GVMapGrid");L.GXYZ=h("./layer/vector/GXYZ");k.GServiceGroup=h("./layer/GServiceGroup");k.GVMapGridUtil=h("./layer/vector/draw/GVMapGridUtil");k.Filter=h("./filter/Filter");k.FilterLayer=h("./filter/FilterLayer")},{"./ext/CRS.CustomEPSG4326":1,"./ext/LeafletExt":2,"./filter/Filter":4,"./filter/FilterLayer":5,"./layer/GServiceGroup":7,"./layer/datasource/DataSource":8,"./layer/datasource/LocalDataSource":9,"./layer/datasource/URLDataSource":10,"./layer/label/GLabelGrid":11,"./layer/label/GWVTAnno":12,"./layer/label/feature/Feature":23,"./layer/vector/GDynamicMap":24,"./layer/vector/GVMapGrid":25,"./layer/vector/GXYZ":26,"./layer/vector/draw/GVMapGridUtil":31,"./layer/vector/stylejs/GGroup":34,"./layer/vector/stylejs/GLevels":35,"./layer/vector/stylejs/GStyleItem":36}],7:[function(h,k,n){h=function(){function g(d,a,c,b){_classCallCheck(this,g);this.label=this.layer=this.map=null;this.layerType=0;this.labelType=2;this.map=c;this.url=a;this.layerId=d;this.styleId=null;this.tileSize=256}g.prototype.addServiceGroup=function(){options&&options.styleId&&(this.styleId=options.styleId);options&&options.tileSize&&(this.tileSize=options.tileSize);switch(this.layerType){case 0:this.addBaseLayer();break;case 1:this.addFrontBaseLayer()}switch(this.labelType){case 2:this.addFrontLabel();break;case 3:this.AddImgLabel();break;case 4:this.addAvoidLabel()}};g.prototype.addBaseLayer=function(){this.layer=new L.GXYZ(this.url+"\x26x\x3d{x}\x26y\x3d{y}\x26l\x3d{z}\x26tileType\x3d"+this.layerType,{sphericalMercator:!1,isBaseLayer:!1,tileSize:this.tileSize});this.map.addLayer(this.layer)};g.prototype.addFrontBaseLayer=function(){this.layer=new L.GVMapGrid(this.url+"\x26x\x3d{x}\x26y\x3d{y}\x26l\x3d{z}\x26tileType\x3d"+this.layerType,{maxZoom:21,keepBuffer:0,updateWhenZooming:!1,tileSize:this.tileSize});this.map.addLayer(this.layer)};g.prototype.AddImgLabel=function(){this.label=new L.GXYZ(this.url+"\x26x\x3d{x}\x26y\x3d{y}\x26l\x3d{z}\x26tileType\x3d"+this.labelType,{sphericalMercator:!1,isBaseLayer:!1,tileSize:this.tileSize});this.map.addLayer(this.label)};g.prototype.addAvoidLabel=function(d){this.label=new L.GLabelGrid(this.url+"\x26x\x3d{x}\x26y\x3d{y}\x26l\x3d{z}\x26tileType\x3d"+this.labelType,{hitDetection:!0,keepBuffer:0,updateWhenZooming:!1,tileSize:this.tileSize});this.map.addLayer(this.label)};g.prototype.addFrontLabel=function(d){this.label=new L.GWVTAnno("GWVTanno",{tileSize:this.tileSize});d=new Custom.URLDataSource;d.url=this.url+"\x26x\x3d${x}\x26y\x3d${y}\x26l\x3d${z}\x26tileType\x3d"+this.labelType;this.label.addDataSource(d);this.map.addLayer(this.label)};g.prototype.setLayerType=function(d){"Img"==d?this.layerType=0:"Data"==d&&(this.layerType=1)};g.prototype.setLabelType=function(d){"Data"==d?this.labelType=2:"Img"==d?this.labelType=3:"AvoidImg"==d&&(this.labelType=4)};g.prototype.setTileSize=function(d){this.tileSize=d};g.prototype.getLayer=function(){return this.layer};g.prototype.getLabel=function(){return this.label};g.prototype.removeGroupLayer=function(){this.layer&&this.map.removeLayer(this.layer);this.label&&this.map.removeLayer(this.label)};return g}();k.exports=h},{}],8:[function(h,k,n){var g=h("../../utils/UUID");k.exports=function a(){_classCallCheck(this,a);this.id=(new g).valueOf();this.type="";this.textures={}}},{"../../utils/UUID":38}],9:[function(h,k,n){h=function(g){function d(){_classCallCheck(this,d);var a=_possibleConstructorReturn(this,g.call(this));a.type="LocalDataSource";a.features=[];a.textureUrls={};return a}_inherits(d,g);d.prototype.addFeature=function(a){this.features.push(a)};d.prototype.addTextureUrl=function(a,c){this.textureUrls[a]=c};d.prototype.removeTextureUrl=function(a){delete this.textureUrls[a]};d.prototype.loadTexture=function(){var a=new Deferred,c=0,b;for(b in this.textureUrls)c++;if(0==c)a.resolve();else{var e=0,f;for(f in this.textureUrls)b=new Image,b.name=f,b.onload=function(b){e++;this.textures[b.target.name]=b.target;e==c&&a.resolve()}.bind(this),b.src=this.textureUrls[f];return a}};d.prototype.removeFeatureById=function(a){for(var c=0;c<this.features.length;c++)this.features[c].id==a&&this.features.splice(c,1)};return d}(h("./DataSource"));k.exports=h},{"./DataSource":8}],10:[function(h,k,n){n=h("./DataSource");var g=h("./../../utils/es6-promise"),d=g.Deferred,a=g.getJSON,c=h("../../ext/Version");h=function(b){function e(){_classCallCheck(this,e);var f=_possibleConstructorReturn(this,b.call(this));f.urlArray=[];f.type="URLDataSource";f.url=null;f.styleUrl=null;f.styleId="style";f.filter=null;f.textures={};f.control=null;f.controlId=null;f.sourceUrl=null;f.host="";f.servername="";return f}_inherits(e,b);e.prototype.loadStyle=function(b){var f=new d,e=new d,p=new d;this.parseUrl();this.sourceUrl||(this.sourceUrl=this.url+"\x26clientVersion\x3d"+c,this.url=this.url+"\x26clientVersion\x3d"+c);this.control&&this.isIE()?a({type:"post",url:this.host+"/mapserver/vmap/"+this.servername+"/setControl",data:"control\x3d"+this.control,dataType:"json"}).then(function(b){this.controlId=b.id;this.url=this.sourceUrl+"\x26controlId\x3d"+b.id;f.resolve()}.bind(this)):(this.url=this.control?this.sourceUrl+"\x26control\x3d"+this.control:this.sourceUrl,f.resolve());b||(b="label");a({url:this.host+"/mapserver/styleInfo/"+this.servername+"/"+this.styleId+"/"+b+"/style.js?"+Math.random(),dataType:"text"}).then(function(b){this.styleFun=new Function("drawer","level",b);e.resolve()}.bind(this));a({url:this.host+"/mapserver/styleInfo/"+this.servername+"/"+this.styleId+"/label/texture.js?"+Math.random(),dataType:"text"}).then(function(b){b=JSON.parse(b);var f=0,e;for(e in b)f++;if(0==f)p.resolve();else{var c=0,a;for(a in b)e=new Image,e.name=a,e.onload=function(b){c++;this.textures[b.target.name]=b.target;c==f&&p.resolve()}.bind(this),e.src=b[a]}}.bind(this));return[f,e,p]};e.prototype.parseUrl=function(){var b=this.url.split("?"),e=b[0].split("/mapserver/");this.host=e[0];this.servername=e[1].split("/")[1];b=b[1].split("\x26");for(e=0;e<b.length;e++){var c=b[e].split("\x3d");if("styleId"==c[0]){this.styleId=c[1];break}}};e.prototype.setFilter=function(b){this.control=null;if(this.url&&b&&(0!=b.layers.length||0!=b.order.length)){for(var f=0;f<b.layers.length;f++)b.layers[f].id||b.layers.splice(f,1);this.control=JSON.stringify(b)}};e.prototype.getTexture=function(b){return this.textures[b]};e.prototype.addTexture=function(b,e){this.textures[b]=e};e.prototype.isIE=function(){return window.ActiveXObject||"ActiveXObject"in window?!0:!1};return e}(n);k.exports=h},{"../../ext/Version":3,"./../../utils/es6-promise":39,"./DataSource":8}],11:[function(h,k,n){var g=h("../vector/draw/GXYZUtil"),d=h("../../ext/Version"),a=h("./avoid/GDrawGeomerty"),c=h("./../../utils/es6-promise").getJSON;h=L.TileLayer.extend({urlArray:[],sourceUrl:null,textures:{},tileQueue:[],ratio:1,tilesize:256,control:null,controlId:null,hitDetection:!1,initialize:function(b,e){1.5<window.devicePixelRatio&&(this.ratio=2);this.sourceUrl||(this.sourceUrl=b);e&&e.tileSize&&(this.tilesize=e.tileSize);this.gxyzUtil=new g;this.gxyzUtil.tileSize=this.tilesize;this.gxyzUtil.parseUrl(b);this._url=b+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d;L.setOptions(this,e);e&&(this.hitDetection=e.hitDetection);this.on("tileunload",this._onTileRemove);this.on("tileload",this._onTileLoad);this.on("tileerror",this._onTileError)},_initContainer:function(){this._container||(this._container=L.DomUtil.create("div","leaflet-pane leaflet-overlay-pane"),this.getPane().appendChild(this._container))},onAdd:function(){this.control&&(this._url=this.sourceUrl+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26control\x3d"+this.control);this.controlId&&(this._url=this.sourceUrl+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26controlId\x3d"+this.controlId);this._initContainer();this._levels={};this._tiles={};c({url:this.gxyzUtil.host+"/mapserver/styleInfo/"+this.gxyzUtil.servername+"/"+this.gxyzUtil.styleId+"/label/texture.js",dataType:"text"}).then(function(b){b=JSON.parse(b);var e=0,f;for(f in b)e++;0==e&&(this._resetView(),this._update());var c=0,a;for(a in b)f=new Image,f.name=a,f.onload=function(b){c++;this.textures[b.target.name]=b.target;c==e&&(this._resetView(),this._update())}.bind(this),f.src=b[a]}.bind(this))},createTile:function(b,e){var f=this.tileQueue.pop();f?this._cleanTile(f):f=this.initTile();var a=this.getTileUrl(b);c({url:a,dataType:"json"}).then(function(b){f.data=b;this._tileOnLoad.apply(this,[e,f])}.bind(this),function(b){this._tileOnError.apply(this,[e,f,b])}.bind(this));return f},getTileUrl:function(b){var e={r:L.Browser.retina?"@2x":"",s:this._getSubdomain(b),x:b.x,y:b.y,z:this._getZoomForUrl()};this._map&&!this._map.options.crs.infinite&&(b=this._globalTileRange.max.y-b.y,this.options.tms&&(e.y=b),e["-y"]=b);if(0==this.urlArray.length)return L.Util.template(this._url,L.extend(e,this.options));b=this.urlArray[Math.round(Math.random()*(this.urlArray.length-1))];var f=this._url.split("/mapserver")[1];return L.Util.template(b+"/mapserver"+f,L.extend(e,this.options))},initTile:function(){var b=document.createElement("canvas");b.style.width=this.tilesize+"px";b.style.height=this.tilesize+"px";b.width=this.tilesize;b.height=this.tilesize;var e=b.getContext("2d",{isQuality:!0});b.ctx=e;this.hitDetection&&(e=document.createElement("canvas"),e.style.width=this.tilesize+"px",e.style.height=this.tilesize+"px",e.width=this.tilesize,e.height=this.tilesize,e=e.getContext("2d",{isQuality:!0}),b.hitCtx=e);return b},_onTileRemove:function(b){this.tileQueue.push(b.tile)},_abortLoading:function(){var b,e;for(b in this._tiles)this._tiles[b].coords.z!==this._tileZoom&&(e=this._tiles[b].el,L.DomUtil.remove(e))},_onTileLoad:function(b){b=b.tile;this._drawTile(b,b.data);b.complete=!0},_onTileError:function(b){b=b.tile;b.complete=!0;this.tileQueue.push(b)},_tileOnError:function(b,e,f){b(f,e)},_drawTile:function(b,e){for(var f=b.ctx,c={},d=0;d<e.length;d++){var p=e[d];1==p.type?(p.id=Math.round(16777216*Math.random()),c[p.id]=p,p.iconImg=this.textures[p.style.texture],a.drawPointIcon(f,p,this.ratio,!1,b.hitCtx,this.hitDetection),a.drawPoint(f,p,this.ratio,!1,!1,b.hitCtx,this.hitDetection)):2==p.type&&a.drawLine(f,p,this.ratio)}b.featureIdMap=c},_cleanTile:function(b){b.ctx.clearRect(0,0,this.tilesize,this.tilesize);b.hitCtx&&b.hitCtx.clearRect(0,0,this.tilesize,this.tilesize)},getFeatureByXY:function(b,e){var f=null;if(this.hitDetection){var c=this._map.containerPointToLatLng(new L.point(b,e)),a=this._map.options.crs.projection.bounds,d=this._map.getBounds(),l=this._map.getPixelBounds(),q=(d._northEast.lat-d._southWest.lat)/(l.max.y-l.min.y),d=this.tilesize,l=(a.max.y-c.lat)/(q*d),a=(c.lng-a.min.x)/(q*d),q=Math.floor(l),g=Math.floor(a),c=this._map.getZoom(),c=this._tiles[g+":"+q+":"+c].el,d=c.hitCtx.getImageData((a-g)*d,(l-q)*d,1,1).data;if(255===d[3]&&(d=d[2]+256*(d[1]+256*d[0])))try{f=c.featureIdMap[d-1]}catch(x){}}return f},setFilter:function(b){!this._url||!b||0==b.layers.length&&0==b.order.length?(this.control=this.controlId=null,this.setUrl(this.sourceUrl+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d)):this.gxyzUtil.setFilter(b,function(b){b.isIE?(this.controlId=b.id,this.setUrl(this.sourceUrl+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26controlId\x3d"+b.id)):(this.control=b.id,this.setUrl(this.sourceUrl+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26control\x3d"+b.id))}.bind(this))}});k.exports=h},{"../../ext/Version":3,"../vector/draw/GXYZUtil":32,"./../../utils/es6-promise":39,"./avoid/GDrawGeomerty":17}],12:[function(h,k,n){var g=h("./draw/CanvasLayer");h=L.Layer.extend({canvasLayer:null,currLevel:2,ratio:1,hitDetection:!0,options:{tileSize:256,opacity:1},initialize:function(d){L.setOptions(this,d);this.options.hasOwnProperty("hitDetection")&&(this.hitDetection=this.options.hitDetection);1.5<window.devicePixelRatio&&(this.ratio=2);this.canvasLayer=new g;this.canvasLayer.tileSize=this.options.tileSize;this.canvasLayer.hitDetection=this.hitDetection;this.canvasLayer.ratio=this.ratio;this.animating=!1},onAdd:function(){var d=this._map.options.crs.projection.bounds;this.canvasLayer.init(this._map._size.x,this._map._size.y,this.options.tileSize,this);this.canvasLayer.maxExtent=[d.min.x,d.min.y,d.max.x,d.max.y];this._container=this.canvasLayer.root;this._zoomAnimated&&L.DomUtil.addClass(this._container,"leaflet-zoom-animated");this.canvasLayer.root.style.opacity=this.options.opacity;this.getPane().appendChild(this.canvasLayer.root);this._update()},setOpacity:function(d){this.options.opacity=d;this.canvasLayer.root&&(this.canvasLayer.root.style.opacity=this.options.opacity)},getEvents:function(){var d={resize:this.onResize,movestart:this.onMoveStart,zoom:this._onZoom,moveend:this._onMoveend};this._zoomAnimated&&(d.zoomanim=this._onAnimZoom);return d},onResize:function(d){this.canvasLayer.tileSize=this.options.tileSize;this.canvasLayer.gwvtAnno=this;this.canvasLayer.initCanvas(this._map._size.x,this._map._size.y);this._update()},_onAnimZoom:function(d){this.updateTransform(d.center,d.zoom)},_onZoom:function(){this.updateTransform(this._map.getCenter(),this._map.getZoom())},_onMoveend:function(){this.animating=!1;this._update()},updateTransform:function(d,a){this._zoom&&this._center||(this._zoom=this._map.getZoom(),this._center=this._map.getCenter());var c=this._map.getZoomScale(a,this._zoom),b=this.getCanvasXY(),e=this._map.getSize().multiplyBy(.5),f=this._map.project(this._center,a),f=this._map.project(d,a).subtract(f),b=e.multiplyBy(-c).add(b).add(e).subtract(f);L.Browser.any3d?L.DomUtil.setTransform(this.canvasLayer.root,b,c):L.DomUtil.setPosition(this.canvasLayer.root,b)},onMoveStart:function(){this.animating=!0},_update:function(){var d=this._map;if(d){var a=d.getBounds(),c=d.getPixelBounds(),c=(a._northEast.lat-a._southWest.lat)/(c.max.y-c.min.y),b=d.options.crs.projection.bounds,e=Math.floor((b.max.y-a._northEast.lat)/(c*this.options.tileSize)),f=Math.ceil((b.max.y-a._southWest.lat)/(c*this.options.tileSize)),m=Math.floor((a._southWest.lng-b.min.x)/(c*this.options.tileSize)),b=Math.ceil((a._northEast.lng-b.min.x)/(c*this.options.tileSize)),d=d.getZoom(),r=this.currLevel!=d,e=this.getGrid(e,f,m,b,d);this.canvasLayer.extent=[a._southWest.lng,a._southWest.lat,a._northEast.lng,a._northEast.lat];this.canvasLayer.res=c;this.canvasLayer.requestLabelTiles(e,r);this.currLevel=d}},getGrid:function(d,a,c,b,e){for(var f=[];c<b;c++)for(var m=d;m<a;m++)f.push({row:m,col:c,level:e});return f},resetCanvasDiv:function(){var d=this.getCanvasXY();L.DomUtil.setPosition(this._container,d);this._center=this._map.getCenter();this._zoom=this._map.getZoom()},getCanvasXY:function(){if(this._map){var d=this._map.dragging._draggable._element.style.transform.match(/(-?\d+\.?\d*)(px)/g),a=d[0].replace("px",""),d=d[1].replace("px","");return{x:-a,y:-d}}},redraw:function(){this.canvasLayer&&this.canvasLayer.redraw()},addDataSource:function(d){this.canvasLayer.addDataSource(d)},removeDataSourceById:function(d){this.canvasLayer.removeDataSourceById(d)},onRemove:function(d){L.DomUtil.remove(this.canvasLayer.root)},addToMap:function(d){d.addLayer(this)},getFeatureByXY:function(d,a){return this.canvasLayer.getFeatureByXY(d,a)},setHasImportant:function(d){this.canvasLayer&&(this.canvasLayer.hasImportant=d)},getHasImportant:function(){return this.canvasLayer?this.canvasLayer.hasImportant:!0},CLASS_NAME:"OpenLayers.Layer.GWVTAnno"});k.exports=h},{"./draw/CanvasLayer":21}],13:[function(h,k,n){h=function(){function g(){_classCallCheck(this,g)}g.getRealLength=function(d){for(var a=d.length,c=0,b=0;b<a;b++)var e=d.charCodeAt(b),c=0<=e&&128>=e?c+.5:c+1;return c};g.isNotNull=function(d){return!d&&0!=d||"string"==typeof d&&(d=d.toLowerCase(),""==d||"undefined"==d||"null"==d)?!1:!0};g.formatFont=function(d,a,c){var b=d;c&&(d=d.split(" "),d[d.length-1]="SimHei",b=d.join(" "));return b.replace(/(\d+\.?\d*)(px|em|rem|pt)/g,function(b,f,c){f=12>f?12*a:Math.round(f)*a;return f+c})};g.formatLabel=function(d){d&&0<d.length&&(d=d.replace(/([\x00-\x1f\x7f])/g,""),d=d.replace(/(\s*$)/g,""),d=d.replace(/<br\/>/g,""));return d};g.getAngle=function(d,a){return 0==a[0]-d[0]?a[1]>d[0]?90:-90:360*Math.atan((a[1]-d[1])/(a[0]-d[0]))/(2*Math.PI)};return g}();k.exports=h},{}],14:[function(h,k,n){var g=h("./GGridIndex"),d=h("./GLabelBox");h=function(){function a(c,b){_classCallCheck(this,a);this.grid=null;this.GLabelBox=new d(c,b)}a.prototype.avoid=function(c,b){if(0==b.length)return c;for(var e=0;e<c.length;e++){var f=c[e];1==f.type&&this.avoidPointLine(f,b);2==f.type&&(f.isCollision=this.avoidLineLine(f,b))}return c};a.prototype.avoidPointLine=function(c,b){var e=c.style.direction;b=this.getAvoidLineFeatures(c.weight,b);for(var f=0,a=c.boxs.length,d=0;d<b.length;d++)for(var p=b[d],l=0;l<a;l++){var q=e+l;q>=a&&(q-=a);if(this.crashBoxLine(c.boxs[q],p.sourceDatas,!1)&&c.directions[q]&&(delete c.directions[q],f++,4==f))return!0}return!1};a.prototype.avoidLineLine=function(c,b){b=this.getAvoidLineFeatures(c.weight,b);for(var e=0;e<b.length;e++)for(var f=b[e],a,d=0;d<c.boxs.length;d++)if(a=this.crashPartLineLine(c.boxs[d],f.sourceDatas))return!0;return!1};a.prototype.getAvoidLineFeatures=function(c,b){for(var e=[],f=0;f<b.length;f++){var a=b[f];a.weight>c&&e.push(a)}return e};a.prototype.crashBoxLine=function(c,b,e){var f=[];e?(f.push([c[0],c[1],c[2],c[1]]),f.push([c[2],c[1],c[2],c[3]]),f.push([c[2],c[3],c[0],c[3]]),f.push([c[0],c[3],c[0],c[1]])):(f.push([c[0],c[1],c[2],c[3]]),f.push([c[2],c[1],c[0],c[3]]));for(c=0;c<f.length;c++){e=f[c];for(var a=0;a<b.length/2-1;a++)if(this.crashPartLinePartLine(e,[b[2*a],b[2*a+1],b[2*(a+1)],b[2*(a+1)+1]]))return!0}return!1};a.prototype.crashLineLine=function(c,b){for(var e=0;e<c.length/2-1;e++)for(var f=[c[2*e],c[2*e+1],c[2*(e+1)],c[2*(e+1)+1]],a=0;a<b.length/2-1;a++)if(this.crashPartLinePartLine(f,[b[2*a],b[2*a+1],b[2*(a+1)],b[2*(a+1)+1]]))return!0;return!1};a.prototype.crashPartLineLine=function(c,b){for(var e=0;e<b.length/2-1;e++)if(this.crashPartLinePartLine(c,[b[2*e],b[2*e+1],b[2*(e+1)],b[2*(e+1)+1]]))return!0;return!1};a.prototype.crashPartLinePartLine=function(c,b){var e=c[0],f=c[1],a=c[3],d=b[0],p=b[1],l=b[2],q=b[3],g,h;g=c[2]-e;a-=f;l-=d;h=q-p;q=g*h-l*a;if(0==q)return 0;var u=0<q,e=e-d,f=f-p;g=g*f-a*e;if(0>g==u)return 0;f=l*f-h*e;return 0>f==u||g>q==u||f>q==u?0:1};a.prototype.defaultAvoid=function(c,b){this.grid=new g(8192,16,0);if(null==c||1>c.length)return[];c=this.GLabelBox.setBox(c,!1);c=this.mergeFeatures(c);this.sort(c,b);for(var e=0;e<c.length;e++)this.avoidFeature(c[e]);c=this.GLabelBox.filterFeature(c);this.removeRepeat(c);return this.prevFeatures=c=this.filterFeature(c)};a.prototype.avoidFeature=function(c){0==c.style.show||1==c.hidden?c.hidden=!0:c.boxs?1==c.type?this.avoidPoint(c):c.isCollision?c.hidden=!0:this.avoidLine(c):c.hidden=!0};a.prototype.avoidPoint=function(c){if(1==c.style.isImportant)this.addBoxToCells(c.primaryId,c.boxs[c.style.direction]);else if(c.style.isFourDirections&&c.style.texture)this.addFourCollisionFeatureToCells(c,c.style.direction);else if(c.directions[c.style.direction]){var b=c.boxs[c.style.direction];this.isCollision(b)?c.hidden=!0:this.addBoxToCells(c.primaryId,b)}else c.hidden=!0};a.prototype.avoidLine=function(c){if(1==c.style.isImportant)for(var b=0;b<c.boxs.length;b++)this.addBoxToCells(c.primaryId+"index_"+b,c.boxs[b]);else{for(var b=!1,e=0;e<c.boxs.length;e++)if(this.isCollision(c.boxs[e])){b=!0;break}if(b)c.hidden=!0;else for(b=0;b<c.boxs.length;b++)this.addBoxToCells(c.primaryId+"index_"+b,c.boxs[b])}};a.prototype.addFourCollisionFeatureToCells=function(c,b){var e=!0,f=[];c.directions[b]&&(f=c.boxs[b],e=this.isCollision(f));e?(b++,4==b&&(b-=4),b==c.style.direction?c.hidden=!0:this.addFourCollisionFeatureToCells(c,b)):(c.style.textPoint=c.fourPoints[b],c.box=f,this.addBoxToCells(c.primaryId,f))};a.prototype.isCollision=function(c){return 0<this.grid.query(c[0],c[1],c[2],c[3]).length};a.prototype.addBoxToCells=function(c,b){this.grid.insert(c,b[0],b[1],b[2],b[3])};a.prototype.mergeFeatures=function(c){for(var b={},e=0;e<c.length;e++){var f=c[e];b[f.attributeId]||(b[f.attributeId]=[]);b[f.attributeId].push(f)}for(var a in b)if(e=b[a],1<e.length){f=e[0];if("1"==f.type){for(var d=e[0].directions,p=1;p<e.length;p++)d=this.getBothDirection(d,e[p].directions);var p=!1,l;for(l in d){p=!0;break}for(var q=0;q<e.length;q++)p?e[0].hidden=!0:e[0].directions=d}if("2"==f.type){f=!1;for(d=0;d<e.length;d++)if(1==e[d].isCollision){f=!0;break}if(f)for(f=0;f<e.length;f++)e[f].hidden=!0}}return this.GLabelBox.filterFeature(c)};a.prototype.sort=function(c,b){if(0<c.length)return c.sort(function(e,f){if(b){if(e.style.isImportant&&!f.style.isImportant)return-1;if(f.style.isImportant&&!e.style.isImportant)return 1}var c=e.weight,a=f.weight,d=e.primaryId,l=f.primaryId;c||(c=-1);a||(a=-1);return c<a?1:c==a?d<l?1:-1:-1}.bind(this))};a.prototype.getBothDirection=function(c,b){var e={},f;for(f in c)b[f]&&(e[f]=1);return e};a.prototype.removeRepeat=function(c){for(var b=[],e=[],f=[],a=[],d=[],p=[],l=0;l<c.length;l++){var q=c[l];1==q.type?1==q.drawed?a.push(q):b.push(q):2==q.type&&("text"==q.lineType&&(1==q.drawed?d.push(q):e.push(q)),"code"==q.lineType&&(1==q.drawed?p.push(q):f.push(q)))}for(c=0;c<b.length;c++)this.getShowPointFeatrues(a,b[c]);for(b=0;b<e.length;b++)this.getShowLineTextFeatrues(d,e[b]);for(e=0;e<f.length;e++)this.getShowLineCodeFeatrues(p,f[e]);if(this.prevFeatures)for(f=0;f<this.prevFeatures.length;f++)this.prevFeatures[f].drawed=!1};a.prototype.getShowPointFeatrues=function(c,b){for(var e=!1,f=0;f<c.length;f++){var a=c[f];a.label==b.label&&a.style.distance&&b.style.distance&&this.getDistance(a.style.textPoint,b.style.textPoint)<a.style.distance&&(e=!0,b.hidden=!0)}e||c.push(b)};a.prototype.getShowLineTextFeatrues=function(c,b){for(var e=!1,f=0;f<c.length;f++){var a=c[f];a.label==b.label&&a.style.lineTextDistance&&b.style.lineTextDistance&&this.getDistance(a.centerPoint,b.centerPoint)<a.style.lineTextDistance&&(e=!0,b.hidden=!0)}e||c.push(b)};a.prototype.getShowLineCodeFeatrues=function(c,b){for(var e=!1,f=0;f<c.length;f++){var a=c[f];a.label==b.label&&a.style.lineCodeDistance&&b.style.lineCodeDistance&&this.getDistance(a.centerPoint,b.centerPoint)<a.style.lineCodeDistance&&(e=!0,b.hidden=!0)}e||c.push(b)};a.prototype.getDistance=function(a,b){var e=b[0]-a[0],f=b[1]-a[1];return Math.pow(e*e+f*f,.5)};a.prototype.filterFeature=function(a){for(var b=[],e=0;e<a.length;e++)a[e].hidden||(a[e].drawed=!0,b.push(a[e]));return b};return a}();k.exports=h},{"./GGridIndex":18,"./GLabelBox":19}],15:[function(h,k,n){var g=h("./GDistance"),d=h("./../../../utils/gistools/GisTools"),a=h("./AvoidUtil");h=function(){function c(){_classCallCheck(this,c)}c.cutLineFeature=function(b){var a=[],f;if(4>b.sourceData.length)return a;var c=this.createLineTextFeatrue(b,0);f=c.index;c.feature&&a.push(c.feature);c=this.createLineCodeFeatrue(b,f);f=c.index;c.feature&&a.push(c.feature);b=this.createLineArrowFeatrue(b,f);b.feature&&a.push(b.feature);return a};c.createLineTextFeatrue=function(b,c){var f=b.style,e=b.sourceData,r=new g,p=[],l=null;if(a.isNotNull(b.label)){b.label+="";for(var q=0;q<b.label.length+1;q++)p.push(1.2*f.lineHeight+2+f.gap);q=[].concat(p);p=r.getNodePath(e,p);r=p.pointList;if(1<r.length){c=p.index;var p=!1,h=b.label.length>r.length?r.length-1:b.label.length-1,x=[r[0][0][0],r[0][0][1]],u=r[h][0],k=a.getAngle(x,u),l=this.cloneFeature(b);l.angle=k;0!=f.changeDirection&&(p=this.isChangeDirection(b.label,x,u,k))&&(r=this.changeDirection(e,r,q,c,h));l.attributeId+="_text";l.sourceAngleData=r;l.lineType="text";r.length<b.label.length&&(c=b.sourceData.length,r.length>.5*b.label.length?this.delayTextPoint(e,r,b.label,f.chinaLabelWidth+f.gap,p):l=null)}else f.showRoadCode||(l=this.cloneFeature(b),l.attributeId+="_text",l.sourceAngleData=[[[e[0],e[1]],0]],l.lineType="text",c=2)}f.lineOffset&&l&&1<l.sourceAngleData.length&&(l.sourceAngleData=d.lineOffset(l.sourceAngleData,f.lineOffset));return{feature:l,index:c}};c.createLineCodeFeatrue=function(b,c){var f=b.style,e=b.sourceData,d=new g,p=[],l=null,q=b.roadCodeLabel;return f.showRoadCode&&a.isNotNull(q)&&c<e.length&&(f=e.slice(c,e.length-1),p.push(30),d=d.getNodePath(f,p),p=d.pointList,1==p.length&&(c+=d.index,l=this.cloneFeature(b),l.attributeId+="_code",l.sourceAngleData=p,l.lineType="code",l.label=q+""),0==p.length)?(l=this.cloneFeature(b),l.attributeId+="_code",l.sourceAngleData=[[e,0]],l.lineType="code",l.label=q+"",{feature:l,index:2}):{feature:l,index:c}};c.createLineArrowFeatrue=function(b,a){var f=b.style,c=b.sourceData,e=new g,d=[],l=null;f.showArrow&&a<c.length&&(f=c.slice(a,c.length-1),d.push(16),d.push(16),e=e.getNodePath(f,d).pointList,2==e.length&&(l=this.cloneFeature(b),l.attributeId+="_arrow",l.sourceAngleData=e,l.lineType="arrow"));return{feature:l,index:a}};c.delayTextPoint=function(b,a,f,c,d){b=1==a.length?d?[b[b.length-2],b[b.length-1]]:[b[0],b[1]]:a[a.length-2][0];d=a[a.length-1][0];for(var e=a[a.length-1][1],m=a.length,r=1;r<f.length-m+1;r++){var g=[this.getPoint(b,d,c*r),e];a.push(g)}};c.cloneFeature=function(b){return{type:b.type,datas:b.datas,sourceData:b.sourceData,label:b.label,roadCodeLabel:b.roadCodeLabel,attributeId:b.attributeId,style:b.style,textures:b.textures,xyz:b.xyz,lineType:b.lineType,weight:b.weight,attributes:b.attributes}};c.changeDirection=function(b,a,f,c,d){c=c>=b.length?b.length:c;c=b.slice(0,c);b=[];for(var e=0;e<c.length-1;e++)b.push([c[e],c[e+1]]),e++;b=b.reverse();a=a[d][0];c=[a[0],a[1]];for(a=0;a<b.length;a++)c.push(b[a][0]),c.push(b[a][1]);return a=(new g).getNodePath(c,f).pointList};c.isChangeDirection=function(b,a,f,c){var e=!1;if(/.*[\u4e00-\u9fa5]+.*$/.test(b)){if(a[0]==f[0]&&a[1]>f[1])return!0;-45>c&&-90<c?a[0]<f[0]&&(e=!0):a[0]>f[0]&&(e=!0)}else a[0]>f[0]&&(e=!0);return e};c.getDistance=function(b,a){var f=a[0]-b[0],c=a[1]-b[1];return Math.pow(f*f+c*c,.5)};c.getLineDistance=function(b){if(4>b.length)return 0;for(var a=0,f=0;f<b.length/2-1;f++)a+=this.getDistance([b[2*f],b[2*f+1]],[b[2*(f+1)],b[2*(f+1)+1]]);return a};c.getPoint=function(b,a,f){var c=a[0]-b[0],e=a[1]-b[1];b=a[0];0==c?a=0<e?a[1]+f:a[1]-f:(f=Math.sqrt(f*f/(e/c*(e/c)+1)),0>c&&(f=-f),b=a[0]+f,a=a[1]+e/c*f);return[b,a]};return c}();k.exports=h},{"./../../../utils/gistools/GisTools":41,"./AvoidUtil":13,"./GDistance":16}],16:[function(h,k,n){h=function(){function g(){_classCallCheck(this,g)}g.prototype.getLengthPoint=function(d,a,c,b,e,f){var m=c-d;b-=a;if(0==m)return d=c,a=0<b?a+e:a-e,null==f?[d,a]:[d,a,f];c=b/m;e=Math.abs(e/Math.sqrt(c*c+1));c=Math.abs(e*c);d=0<m?d+e:d-e;a=0<b?a+c:a-c;return null==f?[d,a]:[d,a,f]};g.prototype.getAngle=function(d,a){return 0==a[0]-d[0]?a[1]>d[0]?90:-90:360*Math.atan((a[1]-d[1])/(a[0]-d[0]))/(2*Math.PI)};g.prototype.length=function(d,a,c,b){d=c-d;a=b-a;return Math.sqrt(d*d+a*a)};g.prototype.getNodePath=function(d,a){for(var c=[],b={},e=[],f=a.length,m=function(b){var a=b[0];b.splice(0,1);return a},r=m(a),p=0;;){if(e.length==f||p>=d.length)return b.index=p,b.pointList=e,b;var l=d[p],g=d[p+1];if(0==c.length)c[0]=l,c[1]=g;else{var h=this.length(c[0],c[1],l,g);h>=r?(r=this.getLengthPoint(c[0],c[1],l,g,r,null),l=this.getAngle(c,[l,g]),90==l&&(l=0),-90==l&&(l=0),0==l&&(l=.5),45<=l?l-=90:-45>=l&&(l+=90),e.push([r,l]),c[0]=r[0],c[1]=r[1],r=m(a)):(r-=h,c[0]=l,c[1]=g,p+=2)}}};return g}();k.exports=h},{}],17:[function(h,k,n){n=h("../../../utils/gistools/BoxSet");var g=new n(0,512,0,512,512,5),d=new n(0,256,0,256,256,5),a=h("../../../utils/gistools/GisTools"),c=h("./Util"),b=h("./AvoidUtil");h=function(){function e(){_classCallCheck(this,e)}e.draw=function(b,a,c,e,d,g,h){var f=null;e&&(f=new Map);for(e=0;e<a.length;e++){var m=a[e];1==m.type?(this.drawPointIcon(b,m,c,f,g,h),this.drawPoint(b,m,c,f,d,g,h)):2==m.type&&this.drawLine(b,m,c,f,d,g,h)}};e.drawPointIcon=function(b,a,c,e,d,g){var f=a.style;if(f.texture){var m=f.graphicWidth,p=f.graphicHeight,r=a.iconImg;if(r){m&&p||(m=r.width,p=r.height,e&&(m/=c,p/=c));var l=f.graphicXOffset-.5*m,q=f.graphicYOffset-.5*p,h=f.pointOffsetX,k=f.pointOffsetY;h||(h=0);k||(k=0);var n=[a.datas[0][0][0],a.datas[0][0][1]];n[0]+=h;n[1]+=k;l=n[0]+l;q=n[1]+q;n=f.pointFillAlpha||1;if(e)if(f=f.texture+"_"+l+"_"+q,null==e.get(f))e.set(f,!0);else return;b.save();b.globalAlpha=n;b.drawImage(r,l*c,q*c,m*c,p*c);b.restore();g&&(d.save(),this.setHitContextStyle(d,a.id),d.fillRect(l,q,m,p),d.restore())}}};e.drawPoint=function(f,e,d,p,l,g,h){if(e.label){var m=e.style,r=m.textPoint;if(p){var q=a.boxToPolyArr(e.box[0],e.box[1],e.box[2],e.box[3]),t=void 0;512==f.canvas.width/d?t=a.boxToPolyArr(-20,-20,532,532):256==f.canvas.width/d&&(t=a.boxToPolyArr(-15,-15,271,271));if(3==a.polyWith(t,q))return;q=e.label+"_"+r[0]+"_"+r[1];if(null==p.get(q))p.set(q,!0);else return}p=e.label.split(" ");var q=p.length,t=m.pointHeight,t=t+2,k=b.formatFont(m.pointFillFont,d,l);l=b.formatFont(m.pointStrokeFont,d,l);if(1==m.pointHashBackground){f.save();f.globalAlpha=m.pointBackgroundAlpha;f.strokeStyle=m.pointBackgroundLineColor;f.lineWidth=m.pointBackgroundLineWidth;f.fillStyle=m.pointBackgroundColor;f.font=m.pointFillFont;for(var n=r[0]-m.pointBackgroundGap,v=r[1]-m.pointBackgroundGap-m.pointHeight/2,z=0,y=0;y<q;y++){var A=c.measureText(p[y],f.font,f);A>z&&(z=A)}this.drawRoundRect(f,n,v,z+2*m.pointBackgroundGap,m.pointHeight*q+2*m.pointBackgroundGap+2*(q-1),m.pointBackgroundRadius,d);f.fill();f.restore();for(y=0;y<q;y++)1==m.pointHashOutline&&(f.save(),f.textBaseline="middle",f.globalAlpha=m.pointStrokeAlpha,f.strokeStyle=m.pointStrokeStyle,f.lineWidth=m.pointLineWidth,f.font=l,f.strokeText(p[y],r[0]*d,(r[1]+t*y)*d),f.restore()),f.save(),f.textBaseline="middle",f.globalAlpha=m.pointFillAlpha,f.fillStyle=m.pointFillStyle,f.font=k,f.fillText(p[y],r[0]*d,(r[1]+t*y)*d),f.restore();h&&(g.save(),this.setHitContextStyle(g,e.id),this.drawHitRoundRect(g,n,v,z+2*m.pointBackgroundGap,m.pointHeight+2*m.pointBackgroundGap,m.pointBackgroundRadius),g.fill(),g.restore())}else{for(v=n=0;v<q;v++)1==m.pointHashOutline&&(f.save(),f.textBaseline="middle",f.globalAlpha=m.pointStrokeAlpha,f.strokeStyle=m.pointStrokeStyle,f.lineWidth=m.pointLineWidth,f.font=l,f.strokeText(p[v],r[0]*d,(r[1]+t*v)*d),f.restore()),f.save(),f.textBaseline="middle",f.globalAlpha=m.pointFillAlpha,f.fillStyle=m.pointFillStyle,f.font=k,f.fillText(p[v],r[0]*d,(r[1]+t*v)*d),z=c.measureText(p[v],f.font,f),n=z>n?z:n,f.restore();h&&(g.save(),this.setHitContextStyle(g,e.id),g.textBaseline="middle",g.fillRect(r[0],r[1]-m.pointHeight/2,n,t*q),g.restore())}}};e.drawLine=function(b,a,c,e,d,g,h){"text"==a.lineType&&this.drawLineText(b,a,c,e,d,g,h);"code"==a.lineType&&this.drawLineCode(b,a,c,e,d,g,h);"arrow"==a.lineType&&this.drawLineArrow(b,a,c,e,g,h)};e.drawLineText=function(a,c,e,p,l,q,h){var f=c.style,m=c.label,r=c.textPoints,t=void 0;p&&(512==a.canvas.width/e?t=g:256==a.canvas.width/e&&(t=d));var k=b.formatFont(f.lineFillFont,e,l),n=b.formatFont(f.lineStrokeFont,e,l);if(1==f.lineHashBackground||1==r.length)p=r[Math.floor(r.length/2)][0],1==r.length?this.drawBgText(a,m,e,p,f.backgroundAlpha,f.backgroundLineColor,f.backgroundLineWidth,f.backgroundColor,f.lineFillFont,f.lineBackgroundGap,f.lineHeight,f.lineBackgroundRadius,f.lineHashOutline,f.lineStrokeAlpha,f.lineStrokeStyle,f.lineLineWidth,f.lineStrokeFont,f.lineFillAlpha,f.lineFillStyle,q,h,c.id,!1,l):this.drawBgText(a,m,e,p,f.backgroundAlpha,f.backgroundLineColor,f.backgroundLineWidth,f.backgroundColor,f.lineFillFont,f.lineBackgroundGap,f.lineHeight,f.lineBackgroundRadius,f.lineHashOutline,f.lineStrokeAlpha,f.lineStrokeStyle,f.lineLineWidth,f.lineStrokeFont,f.lineFillAlpha,f.lineFillStyle,q,h,c.id,!0,l);else for(l=0;l<m.length;l++){var v=r[l],z=v[1],v=v[0],y=m.charAt(l);if(p){var A=y+"_"+v[0]+"_"+v[1]+"_"+z;if(null!=p.get(A))continue;p.set(A,!0);if(!t["in"]([v[0]/e,v[1]/e]))continue}1==f.lineHashOutline&&(a.save(),a.textAlign="center",a.textBaseline="middle",a.globalAlpha=f.lineStrokeAlpha,a.strokeStyle=f.lineStrokeStyle,a.lineWidth=f.lineLineWidth,a.font=n,a.translate(v[0]*e,v[1]*e),a.rotate(z*Math.PI/180),a.strokeText(y,0,0),a.restore());a.save();a.textAlign="center";a.textBaseline="middle";a.globalAlpha=f.lineFillAlpha;a.fillStyle=f.lineFillStyle;a.font=k;a.translate(v[0]*e,v[1]*e);a.rotate(z*Math.PI/180);a.fillText(y,0,0);a.restore();h&&(q.save(),this.setHitContextStyle(q,c.id),q.translate(v[0],v[1]),q.rotate(z*Math.PI/180),q.fillRect(.6*-f.lineHeight,.6*-f.lineHeight,1.2*f.lineHeight,1.2*f.lineHeight),q.restore())}};e.drawLineCode=function(b,a,c,e,d,g,h){e=a.style;var f=a.codePoint,m=a.label;1==e.showRoadCode&&m&&0<m.length&&this.drawBgText(b,m,c,f,e.codeBackgroundAlpha,e.codeBackgroundLineColor,e.codeBackgroundLineWidth,e.codeBackgroundColor,e.codeLineFillFont,e.codeLineBackgroundGap,e.codeLineHeight,e.codeLineBackgroundRadius,e.codeLineHashOutline,e.codeLineStrokeAlpha,e.codeLineStrokeStyle,e.codeLineLineWidth,e.codeLineStrokeFont,e.codeLineFillAlpha,e.codeLineFillStyle,g,h,a.id,!0,d)};e.drawLineArrow=function(b,a,c,e,d,g){e=a.arrowPoint;d=a.style;a=e[0][0];e=e[1][0];b.save();b.lineWidth=2;b.strokeStyle="#666666";b.fillStyle="#666666";b.beginPath();b.moveTo(a[0]*c,a[1]*c);b.lineTo(e[0]*c,e[1]*c);b.stroke();0==d.arrowDirectionValue?(d=Math.atan((e[1]-a[1])/(e[0]-a[0])),d+=(e[0]>a[0]?-90:90)*Math.PI/180,this.drawArrowhead(b,a[0],a[1],d,c)):(d=Math.atan((e[1]-a[1])/(e[0]-a[0])),d+=(e[0]>a[0]?90:-90)*Math.PI/180,this.drawArrowhead(b,e[0],e[1],d,c));b.restore()};e.drawArrowhead=function(b,a,c,e,d){b.beginPath();b.translate(a*d,c*d);b.rotate(e);b.moveTo(0,0);b.lineTo(3*d,6*d);b.lineTo(0,5);b.lineTo(-3*d,6*d);b.closePath();b.fill()};e.drawRoundRect=function(b,a,c,e,d,g,h){b.beginPath();b.arc((a+g)*h,(c+g)*h,g*h,Math.PI,3*Math.PI/2);b.lineTo((e-g+a)*h,c*h);b.arc((e-g+a)*h,(g+c)*h,g*h,3*Math.PI/2,2*Math.PI);b.lineTo((e+a)*h,(d+c-g)*h);b.arc((e-g+a)*h,(d-g+c)*h,g*h,0,1*Math.PI/2);b.lineTo((g+a)*h,(d+c)*h);b.arc((g+a)*h,(d-g+c)*h,g*h,1*Math.PI/2,Math.PI);b.closePath()};e.drawBgText=function(a,e,d,g,h,q,t,k,u,n,B,D,E,v,z,y,A,H,I,C,J,K,M,F){g[0]=Math.round(g[0]);g[1]=Math.round(g[1]);a.save();a.globalAlpha=h;a.strokeStyle=q;a.lineWidth=t;a.fillStyle=k;a.font=b.formatFont(u,1,F);h=c.measureText(e,a.font,a);q=g[0]-h/2-n;t=g[1]-B/2-n;M&&(this.drawRoundRect(a,q,t,h+2*n,B+2*n,D,d),a.fill());a.restore();u=b.formatFont(u,d,F);A=b.formatFont(A,d,F);1==E&&(a.save(),a.textAlign="center",a.textBaseline="middle",a.globalAlpha=v,a.strokeStyle=z,a.lineWidth=y,a.font=A,a.translate(g[0]*d,g[1]*d),a.strokeText(e,0,0),a.restore());a.save();a.textAlign="center";a.textBaseline="middle";a.globalAlpha=H;a.fillStyle=I;a.font=u;a.translate(g[0]*d,g[1]*d);a.fillText(e,0,0);a.restore();J&&(C.save(),this.setHitContextStyle(C,K),this.drawHitRoundRect(C,q,t,h+2*n,B+2*n,D),C.fill(),C.restore())};e.featureIdToHex=function(b){b="000000"+(Number(b)+1).toString(16);var a=b.length;return b="#"+b.substring(a-6,a)};e.setHitContextStyle=function(b,a){var c=this.featureIdToHex(a);b.globalAlpha=1;b.fillStyle=c};e.drawHitRoundRect=function(b,a,c,e,d,g){b.beginPath();b.arc(a+g,c+g,g,Math.PI,3*Math.PI/2);b.lineTo(e-g+a,c);b.arc(e-g+a,g+c,g,3*Math.PI/2,2*Math.PI);b.lineTo(e+a,d+c-g);b.arc(e-g+a,d-g+c,g,0,1*Math.PI/2);b.lineTo(g+a,d+c);b.arc(g+a,d-g+c,g,1*Math.PI/2,Math.PI);b.closePath()};return e}();k.exports=h},{"../../../utils/gistools/BoxSet":40,"../../../utils/gistools/GisTools":41,"./AvoidUtil":13,"./Util":20}],18:[function(h,k,n){function g(a,c,b){var e=this.cells=[];if(a instanceof ArrayBuffer){this.arrayBuffer=a;var f=new Int32Array(this.arrayBuffer);a=f[0];c=f[1];b=f[2];this.d=c+2*b;for(var m=0;m<this.d*this.d;m++){var g=f[d+m],h=f[d+m+1];e.push(g===h?null:f.subarray(g,h))}m=f[d+e.length+1];this.keys=f.subarray(f[d+e.length],m);this.bboxes=f.subarray(m);this.insert=this._insertReadonly}else{this.d=c+2*b;for(f=0;f<this.d*this.d;f++)e.push([]);this.keys=[];this.bboxes=[]}this.n=c;this.extent=a;this.padding=b;this.scale=c/a;this.uid=0;c=b/c*a;this.min=-c;this.max=a+c}k.exports=g;var d=3;g.prototype.insert=function(a,c,b,e,f){this._forEachCell(c,b,e,f,this._insertCell,this.uid++);this.keys.push(a);this.bboxes.push(c);this.bboxes.push(b);this.bboxes.push(e);this.bboxes.push(f)};g.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer.";};g.prototype._insertCell=function(a,c,b,e,f,d){this.cells[f].push(d)};g.prototype.query=function(a,c,b,e){var f=this.min,d=this.max;if(a<=f&&c<=f&&d<=b&&d<=e)return Array.prototype.slice.call(this.keys);f=[];this._forEachCell(a,c,b,e,this._queryCell,f,{});return f};g.prototype._queryCell=function(a,c,b,e,f,d,g){f=this.cells[f];if(null!==f)for(var m=this.keys,h=this.bboxes,r=0;r<f.length;r++){var t=f[r];if(void 0===g[t]){var k=4*t;a<=h[k+2]&&c<=h[k+3]&&b>=h[k+0]&&e>=h[k+1]?(g[t]=!0,d.push(m[t])):g[t]=!1}}};g.prototype._forEachCell=function(a,c,b,e,f,d,g){for(var m=this._convertToCellCoord(a),h=this._convertToCellCoord(c),r=this._convertToCellCoord(b),t=this._convertToCellCoord(e);m<=r;m++)for(var k=h;k<=t;k++)if(f.call(this,a,c,b,e,this.d*k+m,d,g))return};g.prototype._convertToCellCoord=function(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))};g.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var a=this.cells,c=d+this.cells.length+1+1,b=0,e=0;e<this.cells.length;e++)b+=this.cells[e].length;b=new Int32Array(c+b+this.keys.length+this.bboxes.length);b[0]=this.extent;b[1]=this.n;b[2]=this.padding;for(e=0;e<a.length;e++){var f=a[e];b[d+e]=c;b.set(f,c);c+=f.length}b[d+a.length]=c;b.set(this.keys,c);c+=this.keys.length;b[d+a.length+1]=c;b.set(this.bboxes,c);return b.buffer}},{}],19:[function(h,k,n){var g=h("./AvoidUtil"),d=h("./Util");h=function(){function a(c,b){_classCallCheck(this,a);this.boxDistance=0;this.ctx=c;this.formatFont=b}a.prototype.setBox=function(a,b){a.forEach(function(a,c){a.hidden=!1;a.label=g.formatLabel(a.label);0==a.style.show?a.hidden=!0:(1==a.type&&(b?this.setPointBox(a,a.sourceAngleData,this.ctx):this.setPointBox(a,a.datas,this.ctx)),2==a.type&&("text"==a.lineType&&(b?this.setTextLineBox(a,a.sourceAngleData,this.ctx):this.setTextLineBox(a,a.datas,this.ctx)),"code"==a.lineType&&(b?this.setCodeLineBox(a,a.sourceAngleData,this.ctx):this.setCodeLineBox(a,a.datas,this.ctx)),"arrow"==a.lineType&&(b?this.setArrowLineBox(a,a.sourceAngleData):this.setArrowLineBox(a,a.datas))))}.bind(this));return this.filterFeature(a)};a.prototype.setPointBox=function(a,b,e){var c=a.style,m,h,p=c.graphicWidth,l=c.graphicHeight;(m=a.iconImg)?p&&l||(p=m.width,l=m.height):l=p=0;m=p;h=l;if(c.labelFunction){var q=new Function("label",c.labelFunction);try{a.label=q.call({},a.attributes[c.labelfield])}catch(G){console.warn(a.label+": \u8c03\u7528labelFunction\u5931\u8d25!")}}if((q=g.isNotNull(a.label))||0!=p&&0!=l){if(q){a.label+="";h=a.label.split(" ");m=0;e.save();e.font=this.formatFont?d.formatFont(c.pointFillFont,1,!0):c.pointFillFont;for(q=0;q<h.length;q++){var k=d.measureText(h[q],e.font,e);m=k>m?k:m}e.restore();h=c.pointHeight*h.length+2*(h.length-1);h=h>l?h:l}e=c.pointOffsetX;q=c.pointOffsetY;e||(e=0);q||(q=0);b=[b[0][0][0],b[0][0][1]];b[0]+=e;b[1]+=q;1!=c.pointHashBackground&&(c.pointBackgroundGap=0);if(0==l||0==p)c.graphicDistance=0;c.direction||(c.direction=0);e=l;c.pointHeight>l&&(e=c.pointHeight);if(a.style.texture)var q=[b[0]-.5*p,b[1]-c.pointBackgroundGap-.5*h,b[0]+.5*p+c.graphicDistance+m+2*c.pointBackgroundGap,b[1]+.5*h+c.pointBackgroundGap],k=[b[0]-.5*p-c.graphicDistance-m-2*c.pointBackgroundGap,q[1],b[0]+.5*p,q[3]],n=[b[0]-.5*m-c.pointBackgroundGap,b[1]-.5*l,b[0]+.5*m+c.pointBackgroundGap,b[1]+.5*l+c.graphicDistance+2*c.pointBackgroundGap+h],u=[n[0],b[1]-c.graphicDistance-2*c.pointBackgroundGap-h-.5*l,n[2],b[1]+.5*l],q=this.boxScale(q,c.pointBoxDisance),k=this.boxScale(k,c.pointBoxDisance),n=this.boxScale(n,c.pointBoxDisance),u=this.boxScale(u,c.pointBoxDisance),q=[q,k,n,u],k=[b[0]-.5*m,b[1]+c.graphicDistance+c.pointBackgroundGap+.5*e+.5*l],p=[[b[0]+.5*p+c.graphicDistance+c.pointBackgroundGap,b[1]-.5*h+.5*e],[b[0]-.5*p-c.graphicDistance-c.pointBackgroundGap-m,b[1]-.5*h+.5*e],k,[k[0],b[1]-c.graphicDistance-c.pointBackgroundGap-h+.5*e-.5*l]];else c.direction=0,p=[b[0]-.5*m-c.pointBackgroundGap,b[1]-c.pointBackgroundGap-.5*h,b[0]+.5*m+c.pointBackgroundGap,b[1]+c.pointBackgroundGap+.5*h],p=this.boxScale(p,c.pointBoxDisance),q=[p],p=[[b[0]-.5*m,b[1]-.5*h+.5*e]];a.boxs=q;a.box=q[c.direction];a.fourPoints=p;a.style.textPoint=p[c.direction]}else a.hidden=!0};a.prototype.setTextLineBox=function(a,b,e){var c=a.label;if(0==b.length)a.hidden=!0;else{var m=a.style;a.textPoints=b;var g=[];if(1==m.lineHashBackground||1==b.length){var h=b[0][0];1<b.length&&(h=b[Math.floor(c.length/2)][0]);e.save();e.font=this.formatFont?d.formatFont(m.lineFillFont,1,!0):m.lineFillFont;b=d.measureText(a.label,e.font,e);e.restore();b=[h[0]-b/2-m.lineBackgroundGap,h[1]-.5*m.lineHeight-m.lineBackgroundGap,h[0]+b/2+m.lineBackgroundGap,h[1]+.5*m.lineHeight+m.lineBackgroundGap];this.boxScale(b,m.lineTextBoxDisance);g.push(b)}else{if(m.lineTextRotate||0==m.lineTextRotate)for(e=0;e<b.length;e++)b[e][1]=m.lineTextRotate;else if(this.textToSameBearing(a.angle,b),!m.isImportant&&this.isMessy(b,m,c)){a.hidden=!0;return}if(m=this.getLineBoxs(c,b,m))g=g.concat(m);else{a.hidden=!0;return}}a.boxs=g}};a.prototype.setCodeLineBox=function(a,b,e){if(0==b.length)a.hidden=!0;else{var c=a.style;b=b[0][0];e.save();e.font=this.formatFont?d.formatFont(c.codeLineFillFont,1,!0):c.codeLineFillFont;var m=d.measureText(a.label,e.font,e);e.restore();e=[b[0]-m/2-c.codeLineBackgroundGap,b[1]-.5*c.codeLineHeight-c.codeLineBackgroundGap,b[0]+m/2+c.codeLineBackgroundGap,b[1]+.5*c.codeLineHeight+c.codeLineBackgroundGap];this.boxScale(e,c.lineCodeBoxDisance);a.boxs=[e];a.codePoint=b}};a.prototype.setArrowLineBox=function(a,b){if(2!=b.length)a.hiden=!0;else{var c=b[0][0],f=b[1][0],c=[c[0]<f[0]?c[0]:f[0],c[1]<f[1]?c[1]:f[1],c[0]>f[0]?c[0]:f[0],c[1]>f[1]?c[1]:f[1]];this.boxScale(c,a.style.lineArrowBoxDisance);a.boxs=[c];a.arrowPoint=b}};a.prototype.filterFeature=function(a){for(var b=[],c=0;c<a.length;c++)a[c].hidden||b.push(a[c]);return b};a.prototype.isMessy=function(a,b,e){for(var c=a[0][0],d=c[0],g=c[1],h=c[0],c=c[1],l=a[0][1],q=a[0][1],k=0;k<e.length;k++){var n=a[k][0],u=a[k][1];n[0]>h&&(h=n[0]);n[0]<d&&(d=n[0]);n[1]>c&&(c=n[1]);n[1]<g&&(g=n[1]);u>q&&(q=u);u<l&&(l=u)}if(q-l>b.angle)if(0==b.angleSwitch&&b.angleColor)b.lineFillStyle=b.angleColor;else return!0;return!1};a.prototype.getLineBoxs=function(a,b,e){for(var c=[],d=[],g=0;g<a.length;g++){var h=b[g][0];0==b[g][1]&&(b[g][1]=.5);var l=[h[0]-.6*e.lineHeight,h[1]-.6*e.lineHeight,h[0]+.6*e.lineHeight,h[1]+.6*e.lineHeight];this.boxScale(l,e.lineTextBoxDisance);d.push([h[0]-.5*e.lineHeight,h[1]-.6*e.lineHeight,h[0]+.5*e.lineHeight,h[1]+.5*e.lineHeight]);c.push(l)}if(!e.isImportant)for(a=0;a<d.length-1;a++)for(b=d[a],e=a+1;e<d.length;e++)if(this.crashBox(b,d[e]))return null;return c};a.prototype.crashBox=function(a,b){return a[0]<=b[2]&&a[2]>=b[0]&&a[1]<=b[3]&&a[3]>=b[1]};a.prototype.boxScale=function(a,b){b||0==b||(b=this.boxDistance);a[0]-=.5*b;a[1]-=.5*b;a[2]+=.5*b;a[3]+=.5*b;return a};a.prototype.textToSameBearing=function(a,b){45<=a?a-=90:-45>=a&&(a+=90);for(var c=0;c<b.length;c++){var f=b[c][1],d=a-f;45<d&&(b[c][1]=f+90);-45>d&&(b[c][1]=f-90)}};return a}();k.exports=h},{"./AvoidUtil":13,"./Util":20}],20:[function(h,k,n){h=function(){function g(){_classCallCheck(this,g)}g.measureText=function(d,a,c){return c.measureText(d).width};return g}();k.exports=h},{}],21:[function(h,k,n){var g=h("../../../utils/Cache"),d=h("../avoid/GDrawGeomerty"),a=h("./../../../utils/es6-promise").getParamJSON,c=h("./LabelDrawer"),b=h("./../avoid/GAnnoAvoid"),e=h("./../avoid/GCutLine");h=function(){function f(){_classCallCheck(this,f);this.height=this.width=0;this.grid=[];this.cache=new g(256);this.gwvtAnno=null;this.dataSource=[];this.isReady=!1;this.maxExtent=[];this.extent=[];this.res=0;this.tileSize=256;this.hitDetection=!1;this.features=[];this.requestingTiles={};this.hasImportant=!0;this.ratio=1;var a=document.createElement("CANVAS").getContext("2d",{isQuality:!0});this.GAnnoAvoid=new b(a,!1)}f.prototype.init=function(a,b,c,e){this.tileSize=c;this.gwvtAnno=e;this.initCanvas(a,b);this.loadResources()};f.prototype.loadResources=function(){if(0==this.dataSource.length)this.isReady=!1;else{this.cache.clean();for(var a=[],b=0;b<this.dataSource.length;b++){var c=this.dataSource[b];"URLDataSource"==c.type&&(a=a.concat(c.loadStyle()));"LocalDataSource"==c.type&&(a=a.concat(c.loadTexture()))}0<a.length?Promise.all(a).then(function(){this.isReady=!0;0<this.grid.length&&this.requestLabelTiles(this.grid)}.bind(this)):this.isReady=!0}};f.prototype.initCanvas=function(a,b){this.width=a;this.height=b;this.root||(this.root=document.createElement("canvas"));this.root.style.width=this.width+"px";this.root.style.height=this.height+"px";this.root.width=this.width*this.ratio;this.root.height=this.height*this.ratio;this.root.id="labelCanvas";this.canvas=this.root.getContext("2d",{isQuality:!0});this.hitDetection&&(this.hitCanvas||(this.hitCanvas=document.createElement("canvas")),this.hitCanvas.style.width=this.width+"px",this.hitCanvas.style.height=this.height+"px",this.hitCanvas.width=this.width,this.hitCanvas.height=this.height,this.hitContext=this.hitCanvas.getContext("2d",{isQuality:!0}))};f.prototype.addDataSource=function(a){"URLDataSource"==a.type&&(a.url=a.url+"\x26tilesize\x3d"+this.tileSize);"URLDataSource"!=a.type&&"LocalDataSource"!=a.type||this.dataSource.push(a)};f.prototype.removeDataSourceById=function(a){for(var b=0;b<this.dataSource.length;b++)if(this.dataSource[b].id==a){this.dataSource.splice(b,1);break}};f.prototype.getDataSourceById=function(a){for(var b=0;b<this.dataSource.length;b++)if(this.dataSource[b].id==a)return this.dataSource[b]};f.prototype.clean=function(){this.canvas.clearRect(0,0,this.width*this.ratio,this.height*this.ratio);this.hitContext&&this.hitContext.clearRect(0,0,this.width,this.height)};f.prototype.redraw=function(){0!=this.grid.length&&(this.cache.clean(),this.loadResources())};f.prototype.requestLabelTiles=function(a,b){this.grid=a;if(this.isReady){var c=this.getRequestTileUrls(a);this.sendRequest(c)}};f.prototype.getLocalLabelDatas=function(){for(var a=[],b=0;b<this.dataSource.length;b++){var c=this.dataSource[b];if("LocalDataSource"==c.type)for(var e=0;e<c.features.length;e++){var f=c.features[e];f.inBounds(this.extent)&&(1==f.type&&(f.sourceAngleData=[[f.sourceData,0]],f.transformData(this.extent,this.res),f.label=f.getFeatureLabel(),f.textures=c.textures,a.push(f)),2==f.type&&(f.label=f.getFeatureLabel(),f.textures=c.textures,a=a.concat(this.cutLineFeature(f,!0))))}}return a};f.prototype.getRequestTileUrls=function(a){this.hitCacheUrls=[];this.currentTileDatas=[];for(var b={},c={},e=0;e<this.dataSource.length;e++){var f=this.dataSource[e];if("URLDataSource"==f.type)for(var d=f.url,m=0;m<a.length;m++){var g=a[m],h=d.replace("${x}",g.col).replace("{x}",g.col),h=h.replace("${y}",g.row).replace("{y}",g.row),h=h.replace("${z}",g.level).replace("{z}",g.level);if(0<f.urlArray.length)var k=f.urlArray[Math.round(Math.random()*(f.urlArray.length-1))],h=h.split("/mapserver")[1],h=k+"/mapserver"+h;this.cache.getItem(h)?this.hitCacheUrls.push(h):this.requestingTiles[h]?c[h]=!0:b[h]={url:h,xyz:g,dataSourceId:f.id,dataType:"json"}}}this.cancelRequest(c);return b};f.prototype.cancelRequest=function(a){for(var b in this.requestingTiles)if(!a[b]){var c=this.requestingTiles[b];delete this.requestingTiles[b];c.xhr.abort();c.requestItem.cancel=!0}};f.prototype.sendRequest=function(b){var c=0,e;for(e in b){var f=b[e],d=a(f);this.requestingTiles[f.url]={xhr:d.xhr,requestItem:f};d.then(this.tileSuccessFunction.bind(this),this.tileFailFunction.bind(this));c++}0==c&&this.sendSuccess([])};f.prototype.tileSuccessFunction=function(a){if(1!=a.param.cancel){var b=a.param.url;delete this.requestingTiles[b];a=this.parseFeature(a);var c=this.GAnnoAvoid.GLabelBox.setBox(a.labelFeatures,!0),c=this.GAnnoAvoid.avoid(c,a.avoidLineFeatures);this.currentTileDatas.push({url:b,labelFeatures:c,avoidLineFeatures:a.avoidLineFeatures});this.isEmptyObject(this.requestingTiles)&&this.sendSuccess(this.currentTileDatas)}};f.prototype.isEmptyObject=function(a){for(var b in a)return!1;return!0};f.prototype.tileFailFunction=function(a){1!=a.param.cancel&&(delete this.requestingTiles[a.param.url],this.isEmptyObject(this.requestingTiles)&&this.sendSuccess(this.currentTileDatas))};f.prototype.sendSuccess=function(a){if(!this.gwvtAnno.animating){for(var b=this.mergeLabelData(a,this.hitCacheUrls).labelFeatures,c=0;c<a.length;c++){var e=a[c];this.cache.push(e.url,e)}a=this.getLocalLabelDatas();b=b.concat(a);this.avoidlabelDatas=this.GAnnoAvoid.defaultAvoid(b,this.hasImportant);this.gwvtAnno.resetCanvasDiv();this.clean();if(this.hitDetection)for(this.features=[],b=0;b<this.avoidlabelDatas.length;b++)a=this.avoidlabelDatas[b],this.features[a.id]=a;d.draw(this.canvas,this.avoidlabelDatas,this.ratio,!1,!1,this.hitContext,this.hitDetection)}};f.prototype.drawAvoidLine=function(a){this.canvas.save();this.canvas.beginPath();for(var b=0;b<a.length;b++){var c=a[b];this.canvas.lineWidth=1;this.canvas.strokeStyle="#fff000";this.canvas.moveTo(c.datas[0],c.datas[1]);for(j=1;j<c.datas.length/2;j++)this.canvas.lineTo(c.datas[2*j],c.datas[2*j+1])}this.canvas.stroke();this.canvas.restore()};f.prototype.parseFeature=function(a){var b=a.data,e=a.param.xyz,f=0,d;for(d in b)b[d].xyz=e,f++;d=[];var g=this.getDataSourceById(a.param.dataSourceId);if(0<f&&g&&g.styleFun){f=[];a=a.param.xyz.level;var m=new c(b,a,f);g.styleFun.call({},m,a);for(a=0;a<f.length;a++)m=f[a],m.textures=g.textures,d=d.concat(this.parseItemData(m))}b=this.parseAvoidLine(b._layerAvoids,e);return{labelFeatures:d,avoidLineFeatures:b}};f.prototype.parseAvoidLine=function(a,b){var c=[],e;for(e in a){var f=a[e];e=parseInt(e);for(var d=0;d<f.length;d++){var g={};g.weight=e;g.sourceDatas=f[d];g.datas=this.transformAvoidLine(f[d],b);g.xyz=b;c.push(g)}}return c};f.prototype.transformAvoidLine=function(a,b){for(var c=(this.extent[0]-this.maxExtent[0])/this.res,e=(this.maxExtent[3]-this.extent[3])/this.res,f=[],d=0;d<a.length/2;d++){var g=a[2*d+1]+b.row*this.tileSize;f.push(a[2*d]+b.col*this.tileSize-c);f.push(g-e)}return f};f.prototype.parseItemData=function(a){var b=[];1==a.type&&(b=this.parsePoint(a));2==a.type&&("LINESTRING"==a[0]&&(b=b.concat(this.parseLine(a))),"MULTILINESTRING"==a[0]&&(b=b.concat(this.parseMultiLine(a,a[2][0][0]))));return b};f.prototype.parsePoint=function(a){var b=[],c=a[2],e=[[c,0]],f=this.transformData(e,a.xyz),d=a.style,g=a.fieldValueMap[d.labelfield],h=a.fieldValueMap.attributeId+"_row_"+a.xyz.row+"_col_"+a.xyz.col+"_level_"+a.xyz.level+"_x_"+e[0][0][0]+"_y_"+e[0][0][1],m=0;a.fieldValueMap[d.avoidField]&&(m=parseInt(a.fieldValueMap[d.avoidField]),isNaN(m)&&(m=0));var k={0:1};d.texture&&(k={0:1,1:1,2:1,3:1});b.push({id:Math.round(16777216*Math.random()),type:a.type,datas:f,sourceData:c,sourceAngleData:e,label:g,attributeId:a.fieldValueMap.attributeId,primaryId:h,style:d,iconImg:a.textures[d.texture],xyz:a.xyz,weight:m,directions:k,attributes:a.fieldValueMap});return b};f.prototype.parseLine=function(a){return 0==a[2].length?[]:Array.isArray(a[2][0][0])?this.parseMultiLine(a,a[2][0]):this.parseMultiLine(a,a[2])};f.prototype.parseMultiLine=function(a,b){for(var c=[],e=a.style,f=0;f<b.length;f++){var d=b[f];if(0!=d.length){var g=a.fieldValueMap[e.labelfield],h=a.fieldValueMap[e.roadCodeLabel],m=0;a.fieldValueMap[e.avoidField]&&(m=parseInt(a.fieldValueMap[e.avoidField]));d={type:a.type,sourceData:d,label:g,weight:m,roadCodeLabel:h,attributeId:a.fieldValueMap.attributeId,style:this.cloneStyle(e),textures:a.textures,xyz:a.xyz,attributes:a.fieldValueMap};c=c.concat(this.cutLineFeature(d,!1))}}return c};f.prototype.cloneStyle=function(a){var b={},c;for(c in a)b[c]=a[c];return b};f.prototype.cutLineFeature=function(a,b){for(var c=e.cutLineFeature(a),f=0;f<c.length;f++){var d=c[f];d.datas=b?a.transformData(this.extent,this.res):this.transformData(d.sourceAngleData,d.xyz);d.primaryId=d.attributeId+"_row_"+a.xyz.row+"_col_"+a.xyz.col+"_level_"+a.xyz.level+"_x_"+d.sourceAngleData[0][0][0]+"_y_"+d.sourceAngleData[0][0][1];d.id=Math.round(16777216*Math.random());"text"==d.lineType&&(d.centerPoint=d.datas[Math.floor(d.datas.length/2)][0]);"code"==d.lineType&&(d.centerPoint=d.datas[0][0])}return c};f.prototype.transformData=function(a,b){for(var c=(this.extent[0]-this.maxExtent[0])/this.res,e=(this.maxExtent[3]-this.extent[3])/this.res,f=[],d=0;d<a.length;d++){var g=a[d][0];f.push([[g[0]+b.col*this.tileSize-c,g[1]+b.row*this.tileSize-e],a[d][1]])}return f};f.prototype.mergeLabelData=function(a,b){for(var c=[],e=[],f=0;f<a.length;f++)var d=a[f],c=c.concat(d.labelFeatures),e=e.concat(d.avoidLineFeatures);for(f=0;f<b.length;f++){for(var d=this.cache.getItem(b[f]).labelFeatures,g=0;g<d.length;g++){var h=d[g];h.datas=this.transformData(h.sourceAngleData,h.xyz);"text"==h.lineType&&(h.centerPoint=h.datas[Math.floor(h.datas.length/2)][0]);"code"==h.lineType&&(h.centerPoint=h.datas[0][0])}c=c.concat(d);d=this.cache.getItem(b[f]).avoidLineFeatures;for(g=0;g<d.length;g++)h=d[g],h.datas=this.transformAvoidLine(h.sourceDatas,h.xyz);e=e.concat(d)}return{labelFeatures:c,avoidLineFeatures:e}};f.prototype.getFeatureByXY=function(a,b){var c=null;if(this.hitDetection){var e=this.hitContext.getImageData(a,b,1,1).data;if(255===e[3]&&(e=e[2]+256*(e[1]+256*e[0])))try{c=this.features[e-1]}catch(q){}}return c};return f}();k.exports=h},{"../../../utils/Cache":37,"../avoid/GDrawGeomerty":17,"./../../../utils/es6-promise":39,"./../avoid/GAnnoAvoid":14,"./../avoid/GCutLine":15,"./LabelDrawer":22}],22:[function(h,k,n){h=function(){function g(d,a,c){_classCallCheck(this,g);this.layerDataMap=d;this.level=a;this.features=c}g.prototype.getLayer=function(d){this.labelDatas=[];var a=this.layerDataMap[d];if(null==a||null==a.features)return this;for(var c=0;c<a.features.length;c++){var b=a.features[c];b.layerName=d;b.xyz=a.xyz;b.type=a.type;b.fieldValueMap||(b.fieldValueMap=this.getFieldValueMap(a,b));this.labelDatas.push(b)}return this};g.prototype.getGroupLayer=function(d,a){this.labelDatas=[];var c=a.split(","),b=c.length;if(0==b)return this;var e=this.layerDataMap[d];if(null==e||null==e.features)return this;for(var f=0;f<b;f++)if(null!=e.features[c[f]]){var g=e.features[i];g.layerName=d;g.xyz=e.xyz;g.type=e.type;g.fieldValueMap||(g.fieldValueMap=this.getFieldValueMap(e,g));this.labelDatas.push(g)}return this};g.prototype.setStyle=function(d){for(var a=this,c=function(b){var c=a.labelDatas[b];(b=d.call({},a.level,function(a){return c.fieldValueMap[a]}))&&1==b.show&&(c.style=b,c.fieldValueMap.avoidWeight=b.avoidWeight,a.features.push(c))},b=0;b<this.labelDatas.length;b++)c(b)};g.prototype.getFieldValueMap=function(d,a){for(var c={},b=0;b<d.fieldsConfig.length;b++){var e=d.fieldsConfig[b].name,f=d.fieldsConfig[b].index;1==d.fieldsConfig[b].id&&(c.attributeId=a.layerName+a[1][f]);c[e]=a[1][f]}return c};g.prototype.draw=function(){};return g}();k.exports=h},{}],23:[function(h,k,n){h=function(){function g(){_classCallCheck(this,g);this.id=Math.round(16777216*Math.random());this.type=1;this.sourceData=[];this.datas=[];this.sourceAngleData=[];this.attributes={};this.style={}}g.prototype.addAttribute=function(d,a){this.attributes[d]=a};g.prototype.removeAttributeByKey=function(d){delete this.attributes[d]};g.prototype.getMaxExtent=function(){if(0==this.sourceData.length)return null;for(var d=this.sourceData[0],a=this.sourceData[0],c=this.sourceData[1],b=this.sourceData[1],e=2;e<this.sourceData.length;e++){var f=this.sourceData[e],g=this.sourceData[e+1];f>a&&(a=f);f<d&&(d=f);g>b&&(b=g);g<c&&(c=g);e++}return[d,c,a,b]};g.prototype.inBounds=function(d){var a=this.getMaxExtent();return a?a[0]<=d[2]&&a[2]>=d[0]&&a[1]<=d[3]&&a[3]>=d[1]:!1};g.prototype.transformData=function(d,a){this.datas=[];if(0!=this.sourceData.length){for(var c=d[0],b=d[3],e=[],f=0;f<this.sourceAngleData.length;f++){var g=this.sourceAngleData[f][0];e.push([[(g[0]-c)/a,(b-g[1])/a],this.sourceAngleData[f][1]])}this.datas=e}};g.prototype.getFeatureLabel=function(){var d=this.style.labelfield;return d&&this.attributes[d]?this.attributes[d]+"":null};return g}();k.exports=h},{}],24:[function(h,k,n){n=h("./GVMapGrid");var g=h("./draw/GVMapGridUtil"),d=h("../../ext/Version");h=n.extend({styleObj:{},styleJs:null,initialize:function(a,c){c.isDynamicMap=!0;1.5<window.devicePixelRatio&&(this.ratio=2);this.sourceUrl||(this.sourceUrl=a);c&&c.tileSize&&(this.tilesize=c.tileSize);this.gVMapGridUtil=new g(c.isDynamicMap);this.gVMapGridUtil.tileSize=this.tilesize;this.gVMapGridUtil.parseUrl(a);this._url=a+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d;L.setOptions(this,c);this.on("tileunload",this._onTileRemove);this.on("tileload",this._onTileLoad);this.on("tileerror",this._onTileError)},onAdd:function(){this.control&&(this._url=this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26control\x3d"+this.control);this.controlId&&(this._url=this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26controlId\x3d"+this.controlId);this._initContainer();this._levels={};this._tiles={};this.gVMapGridUtil.setStyle(this.styleObj);var a=this.gVMapGridUtil.loadStyle("layer");Promise.all(a).then(function(){this._resetView();this._update()}.bind(this))},addLevels:function(a){this.styleObj[a.levelsKey]=a.levelsData},redraw:function(){this.gVMapGridUtil.formatStyle(this.styleObj,function(){this._map&&(this._removeAllTiles(),this._update())});return this}});k.exports=h},{"../../ext/Version":3,"./GVMapGrid":25,"./draw/GVMapGridUtil":31}],25:[function(h,k,n){var g=h("./../../utils/es6-promise").getJSON,d=h("./draw/GVMapGridUtil"),a=h("./draw/DataHolder"),c=h("../../ext/Version");h=L.TileLayer.extend({urlArray:[],sourceUrl:null,textures:{},tileQueue:[],ratio:1,control:null,controlId:null,tilesize:256,initialize:function(a,e){1.5<window.devicePixelRatio&&(this.ratio=2);this.sourceUrl||(this.sourceUrl=a);e&&e.tileSize&&(this.tilesize=e.tileSize);this.gVMapGridUtil=new d;this.gVMapGridUtil.tileSize=this.tilesize;this.gVMapGridUtil.parseUrl(a);this._url=a+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+c;L.setOptions(this,e);this.on("tileunload",this._onTileRemove);this.on("tileload",this._onTileLoad);this.on("tileerror",this._onTileError)},onAdd:function(){this.control&&(this._url=this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+c+"\x26control\x3d"+this.control);this.controlId&&(this._url=this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+c+"\x26controlId\x3d"+this.controlId);this._initContainer();this._levels={};this._tiles={};var a=this.gVMapGridUtil.loadStyle("layer");Promise.all(a).then(function(){this._resetView();this._update()}.bind(this))},createTile:function(a,c){var b=this.tileQueue.pop();b?this._cleanTile(b):b=this.initTile();var e=this.getTileUrl(a);g({url:e,dataType:"json"}).then(function(a){b.data=a;this._tileOnLoad.apply(this,[c,b])}.bind(this),function(a){this._tileOnError.apply(this,[c,b,a])}.bind(this));return b},getTileUrl:function(a){var b={r:L.Browser.retina?"@2x":"",s:this._getSubdomain(a),x:a.x,y:a.y,z:this._getZoomForUrl()};this._map&&!this._map.options.crs.infinite&&(a=this._globalTileRange.max.y-a.y,this.options.tms&&(b.y=a),b["-y"]=a);if(0==this.urlArray.length)return L.Util.template(this._url,L.extend(b,this.options));a=this.urlArray[Math.round(Math.random()*(this.urlArray.length-1))];var c=this._url.split("/mapserver")[1];return L.Util.template(a+"/mapserver"+c,L.extend(b,this.options))},initTile:function(){var a=document.createElement("canvas");a.style.width=this.tilesize+"px";a.style.height=this.tilesize+"px";a.width=this.tilesize;a.height=this.tilesize;var c=a.getContext("2d",{isQuality:!0});a.ctx=c;return a},_onTileRemove:function(a){this.tileQueue.push(a.tile)},_abortLoading:function(){var a,c;for(a in this._tiles)this._tiles[a].coords.z!==this._tileZoom&&(c=this._tiles[a].el,c.complete||L.DomUtil.remove(c))},_onTileLoad:function(a){a=a.tile;this._drawTile(a,a.data);a.complete=!0},_onTileError:function(a){a=a.tile;a.complete=!0;this.tileQueue.push(a)},_tileOnError:function(a,c,d){a(d,c)},_drawTile:function(b,c){var e=b.ctx,d=Math.floor(this._map.getZoom()),e=new a({layerDataMap:c,ctx:e,ratio:1,control:null,textures:this.gVMapGridUtil.textures,extent:{level:d}});this.gVMapGridUtil.styleFun.call({},e,d)},_cleanTile:function(a){a.ctx.clearRect(0,0,this.tilesize,this.tilesize)},setFilter:function(a){!this._url||!a||0==a.layers.length&&0==a.order.length?(this.control=this.controlId=null,this.setUrl(this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+c)):this.gVMapGridUtil.setFilter(a,function(a){a.isIE?(this.controlId=a.id,this.setUrl(this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+c+"\x26controlId\x3d"+a.id)):(this.control=a.id,this.setUrl(this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+c+"\x26control\x3d"+a.id))}.bind(this))},getFeatureByXY:function(a,c,d){a=this._map.containerPointToLatLng(new L.point(a,c));this.getFeatureByLonlat(a,d)},getFeatureByLonlat:function(a,c){var b=this._map.options.crs.projection.bounds,e=this._map.getBounds(),d=this._map.getPixelBounds(),g=(e._northEast.lat-e._southWest.lat)/(d.max.y-d.min.y),e=this.options.tileSize,d=(b.max.y-a.lat)/(g*e),b=(a.lng-b.min.x)/(g*e),g=this._map.getZoom();this.gVMapGridUtil.pickupFeatures(d,b,g,(b-Math.floor(b))*e,(d-Math.floor(d))*e,this.control,this.controlId,function(a){c(a)})},highlightFeatures:function(a,c){var b=this.gVMapGridUtil.CreateHighlightFilter(a,c);if(0!=b.layers.length){c.color=c.color.replace("#","%23");if(!this.highlightLayer){var e=this.gVMapGridUtil.host+"/mapserver/vmap/"+this.gVMapGridUtil.servername+"/getMAP?x\x3d{x}\x26y\x3d{y}\x26l\x3d{z}\x26styleId\x3d"+this.gVMapGridUtil.styleId;this.control&&(e=e+"\x26control\x3d"+this.control);this.controlId&&(e=e+"\x26controlId\x3d"+this.controlId);this.highlightLayer=new L.GXYZ(e,this.options);this._map.addLayer(this.highlightLayer)}this.highlightLayer.options.opacity=c.opacity;this.highlightLayer._updateOpacity();this.highlightLayer.setFilter(b);this.highlightLayer.setZIndex(this.options.zIndex+1)}},cancelHighlight:function(){this.highlightLayer&&(this._map.removeLayer(this.highlightLayer),this.highlightLayer=null)}});k.exports=h},{"../../ext/Version":3,"./../../utils/es6-promise":39,"./draw/DataHolder":29,"./draw/GVMapGridUtil":31}],26:[function(h,k,n){var g=h("./draw/GXYZUtil"),d=h("../../ext/Version");h=L.TileLayer.extend({urlArray:[],sourceUrl:null,gxyzUtil:null,highlightLayer:null,ratio:1,control:null,controlId:null,tilesize:256,initialize:function(a,c){1.5<window.devicePixelRatio&&(this.ratio=2);this.sourceUrl||(this.sourceUrl=a);c&&c.tileSize&&(this.tilesize=c.tileSize);this.gxyzUtil=new g;this.gxyzUtil.tileSize=this.tilesize;this.gxyzUtil.parseUrl(a);this._url=a+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d;L.setOptions(this,c)},onAdd:function(){this.control&&(this._url=this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26control\x3d"+this.control);this.controlId&&(this._url=this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26controlId\x3d"+this.controlId);this._initContainer();this._levels={};this._tiles={};this._resetView();this._update()},getTileUrl:function(a){var c={r:L.Browser.retina?"@2x":"",s:this._getSubdomain(a),x:a.x,y:a.y,z:this._getZoomForUrl()};this._map&&!this._map.options.crs.infinite&&(a=this._globalTileRange.max.y-a.y,this.options.tms&&(c.y=a),c["-y"]=a);if(0==this.urlArray.length)return L.Util.template(this._url,L.extend(c,this.options));a=this.urlArray[Math.round(Math.random()*(this.urlArray.length-1))];var b=this._url.split("/mapserver")[1];return L.Util.template(a+"/mapserver"+b,L.extend(c,this.options))},setFilter:function(a){!this._url||!a||0==a.layers.length&&0==a.order.length?(this.control=this.controlId=null,this.setUrl(this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d)):this.gxyzUtil.setFilter(a,function(a){a.isIE?(this.controlId=a.id,this.setUrl(this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26controlId\x3d"+a.id)):(this.control=a.id,this.setUrl(this.sourceUrl+"\x26ratio\x3d"+this.ratio+"\x26tilesize\x3d"+this.tilesize+"\x26clientVersion\x3d"+d+"\x26control\x3d"+a.id))}.bind(this))},getFeatureByXY:function(a,c,b){a=this._map.containerPointToLatLng(new L.point(a,c));this.getFeatureByLonlat(a,b)},getFeatureByLonlat:function(a,c){var b=this._map.options.crs.projection.bounds,e=this._map.getBounds(),d=this._map.getPixelBounds(),g=(e._northEast.lat-e._southWest.lat)/(d.max.y-d.min.y),e=this.options.tileSize,d=(b.max.y-a.lat)/(g*e),b=(a.lng-b.min.x)/(g*e),g=this._map.getZoom();this.gxyzUtil.pickupFeatures(d,b,g,(b-Math.floor(b))*e,(d-Math.floor(d))*e,this.control,this.controlId,function(a){c(a)})},highlightFeatures:function(a,c){var b=this.gxyzUtil.CreateHighlightFilter(a,c);0!=b.layers.length&&(c.color=c.color.replace("#","%23"),this.highlightLayer||(this.highlightLayer=new L.GXYZ(this.sourceUrl,this.options),this._map.addLayer(this.highlightLayer)),this.highlightLayer.options.opacity=c.opacity,this.highlightLayer._updateOpacity(),this.highlightLayer.setFilter(b),this.highlightLayer.setZIndex(this.options.zIndex+1))},highlightEveryFeatures:function(a,c){var b=this.gxyzUtil.CreateEveryHighlightFilter(a);0!=b.layers.length&&(this.highlightLayer||(this.highlightLayer=new L.GXYZ(this.sourceUrl,this.options),this._map.addLayer(this.highlightLayer)),this.highlightLayer.options.opacity=c,this.highlightLayer._updateOpacity(),this.highlightLayer.setFilter(b),this.highlightLayer.setZIndex(this.options.zIndex+1))},cancelHighlight:function(){this.highlightLayer&&(this._map.removeLayer(this.highlightLayer),this.highlightLayer=null)}});k.exports=h},{"../../ext/Version":3,"./draw/GXYZUtil":32}],27:[function(h,k,n){var g=h("./PropertyGetter");h=function(){function d(a,c){_classCallCheck(this,d);this.layerDataMap=a.layerDataMap;this.extent=a.extent;this.ctx=a.ctx;this.ratio=a.ratio;this.control=a.control;this.drawerCalss=c;this.config=a;this.textures=a.textures}d.prototype._emptyDrawer=function(a){return new this.drawerCalss(null)};d.prototype.getLayer=function(a,c){null==c&&(c=a);if(null==this.layerDataMap||null!=this.control&&0==this.control.controlObj.otherDisplay&&-1==this.control.controlObj.controlLayersArr.indexOf(c))return this._emptyDrawer(c);var b=this.layerDataMap[a];if(null==b)return this._emptyDrawer(c);b.datas&&(b.features=b.datas);if(null==b.features)return this._emptyDrawer(c);var e=null;null!==b.fieldsConfig&&(e=new g(b.fieldsConfig));this.config.dataLayerID=a;this.config.styleLayerID=c;this.config.propertyGetter=e;this.config.control=this.control;this.config.textures=this.textures;e=new this.drawerCalss(this.config);if(Array.isArray(b.features)){var d=b.features;d.type=b.type;e.addFeatures(d)}else for(d in b.features){var h=b.features[d];h.type=b.type;e.addFeatures(h)}return e};d.prototype.getGroupLayer=function(a,c,b){if(null==this.layerDataMap)return this._emptyDrawer(b);null==b&&(b=a);if(null!=this.control&&0==this.control.controlObj.otherDisplay&&-1==this.control.controlObj.controlLayersArr.indexOf(b))return this._emptyDrawer(b);var e=this.layerDataMap[a];if(null==this.layerDataMap||null==e||null==e.datas&&null==e.data)return this._emptyDrawer(b);c=c.split(",");var d=c.length;if(0==d)return this._emptyDrawer(b);var h=null;null!=e.fieldsConfig&&(h=new g(e.fieldsConfig));this.config.dataLayerID=a;this.config.styleLayerID=b;this.config.propertyGetter=h;this.config.control=this.control;this.config.textures=this.textures;a=new this.drawerCalss(this.config);e.features=null==e.data?e.datas:e.data;for(b=0;b<d;b++)h=e.features[c[b]],null!=h&&(h.type=e.type,a.addFeatures(h));return a};return d}();k.exports=h},{"./PropertyGetter":33}],28:[function(h,k,n){(function(g){g=function(){function d(a){_classCallCheck(this,d);a&&(this.featuresArr=[],this.propertyGetter=a.propertyGetter,this.extent=a.extent,this.ratio=a.ratio,this.resize=!1,1!=this.ratio&&(this.resize=!0),this.level=this.extent.level,this.dataLayerID=a.dataLayerID,this.styleLayerID=a.styleLayerID,this.control=a.control)}d.prototype.addFeatures=function(a){this.featuresArr.push(a)};d.prototype.setStyle=function(a){this.styleOperator=a};d.prototype.process=function(){if(null!=this.featuresArr){var a=this.featuresArr.length;if(0!=a)for(var c=0;c<a;c++)this._processFeatures(this.featuresArr[c])}};d.prototype._processFeature=function(a){throw"\u62bd\u8c61\u65b9\u6cd5";};d.prototype._processFeatures=function(a){for(var c=0;c<a.length;c++)this._processFeature(a[c])};d.prototype._getProperty=function(a){return a[1]};d.prototype._getPoints=function(a){return a[2]};d.prototype._getType=function(a){return a[0]};d.prototype._filterByStyle=function(a){var c=this._getType(a),b=this._getPoints(a),e=this._getProperty(a);if(null==b)throw"\u7ed8\u5236\u5931\u8d25,\u6570\u636e\u4e2d\u7f3a\u5c11Geometry";null==c&&(c="POLYGON");c=a=null;if(null==this.styleOperator)return null;this.propertyGetter;var c=this.propertyGetter.getId(e),d=this.propertyGetter,b=function(a){return d.get(e,a)};if(this.control&&"function"==typeof this.control.controlFn&&(a=this.control.controlFn.call({},c,b,this.styleLayerID),0==a||null==a))return{display:!1};c=this.styleOperator.call({},this.level,b);if(null==c)return null;if(null!=c.display&&0==c.display)return{display:!1};null!=a&&(c.customeColor=a);return c};return d}();k.exports=g}).call(this,h("_process"))},{_process:42}],29:[function(h,k,n){n=h("./AbstractDataHolder");var g=h("./Drawer");h=function(d){function a(c){_classCallCheck(this,a);return _possibleConstructorReturn(this,d.call(this,c,g))}_inherits(a,d);a.prototype.getBackground=function(){return new BackgroundDrawer({extent:this.extent,ctx:this.ctx,control:this.control,ratio:this.ratio})};a.prototype.getWatermark=function(){};return a}(n);k.exports=h},{"./AbstractDataHolder":27,"./Drawer":30}],30:[function(h,k,n){h=function(g){function d(a){_classCallCheck(this,d);var c=_possibleConstructorReturn(this,g.call(this,a));a&&(c.ctx=a.ctx,c.shadowDatas=[],c.textures=a.textures);return c}_inherits(d,g);d.prototype.draw=function(){if(null!=this.featuresArr){this.process();for(var a=0;a<this.shadowDatas.length;a++){var c=this.shadowDatas[a];this._drawShape(c.data);this._processShadowEnd(c.style)}}};d.prototype._processShadowEnd=function(a){this.ctx.closePath();a.shadowColor&&(this.ctx.globalAlpha=1,this.ctx.fillStyle=a.shadowColor,this.ctx.fill())};d.prototype._drawShape=function(a){var c=this.ctx;if(a.length){c.beginPath();if(this.resize){c.moveTo(a[0]*this.ratio,a[1]*this.ratio);for(var b=2,e=a.length;b<e;b+=2)c.lineTo(a[b]*this.ratio,a[b+1]*this.ratio)}else for(c.moveTo(a[0],a[1]),b=2,e=a.length;b<e;b+=2)c.lineTo(a[b],a[b+1]);c.closePath()}};d.prototype._processFeature=function(a){var c=this._filterByStyle(a);null!=c&&0!=c.display&&(this._beginDraw(),this._drawFeature(a,c))};d.prototype._beginDraw=function(){this.ctx.beginPath()};d.prototype._drawFeature=function(a,c){var b=this._getType(a),e=this._getPoints(a);this._getProperty(a);if(null==e)throw"\u7ed8\u5236\u5931\u8d25,\u6570\u636e\u4e2d\u7f3a\u5c11Geometry";null==b&&(b="POLYGON");var d=null;null!=c.sparsity&&(d=parseFloat(c.sparsity));switch(b){case "PT":this._processPoint(e);break;case "LINESTRING":this._processLineString(e,d);this._processLineStringEnd(c);break;case "MULTILINESTRING":this._processLineString(e,d);this._processLineStringEnd(c);break;case "MULTIPOLYGON":this._processPolygon(e,d);this._processPolygonEnd(c);break;case "POLYGON":this._processPolygon(e,d),this._processPolygonEnd(c)}c.shadowColor&&this._processShadow(e,c,b)};d.prototype._processShadow=function(a,c,b){for(var e=a.length,d=0;d<e;d++){var g=a[d];if(Array.isArray(g)){if(0==g.length)break;Array.isArray(g[0])?this._processShadow(g):this._drawShadow(g,c,b)}else this._drawShadow(g.PS,c,b)}};d.prototype._drawShadow=function(a,c,b){if("MULTIPOLYGON"==b||"POLYGON"==b)for(b=0;b<a.length-3;b+=2){var e,d,g,h;e=a[b];d=a[b+1];g=a[b+2];h=a[b+3];var p=e,l=d+-3.5,q=g,k=h+-3.5;if((q-p)*(d-l)<(e-p)*(k-l)){var n={};n.data=[q,k,p,l,e,d,g,h];n.style=c;this.shadowDatas.push(n)}}};d.prototype._processPoint=function(a){};d.prototype._processLineString=function(a,c){if(Array.isArray(a[0]))for(var b=a.length,e=0;e<b;e++)this._processLineString(a[e],c);else this._renderLinePath(a,!1,c)};d.prototype._processLineStringEnd=function(a){var c=!0;0==a.stroke&&(c=!1);0!=c&&(this.ctx.lineWidth=this.resize?a.strokeWidth*this.ratio:a.strokeWidth,this.ctx.strokeStyle=a.strokeColor,this.ctx.globalAlpha=a.strokeOpacity,null!=a.dash&&this.ctx.setLineDash(a.dash),a.lineCap&&(this.ctx.lineCap=a.lineCap),this.ctx.stroke(),a=a.customeColor,"object"==("undefined"===typeof a?"undefined":_typeof(a))&&null!=a.color&&(this.ctx.strokeStyle=a.color,this.ctx.globalAlpha=a.opacity,this.ctx.stroke()),this.ctx.setLineDash([]),this.ctx.lineJoin="round",this.ctx.lineCap="butt")};d.prototype._processPolygon=function(a,c){if(Array.isArray(a[0]))for(var b=a.length,e=0;e<b;e++)this._processPolygon(a[e],c);else this._renderLinePath(a,!0,c)};d.prototype._processPolygonEnd=function(a){var c=!1,b=!1;1==a.stroke&&(c=!0);1==a.fill&&(b=!0);b&&(a.fillColor&&(this.ctx.fillStyle=a.fillColor),this.ctx.globalAlpha=a.fillOpacity?a.fillOpacity:1,this.ctx.fill());c&&(a.strokeWidth&&(this.ctx.lineWidth=this.resize?a.strokeWidth*this.ratio:a.strokeWidth),a.strokeColor&&(this.ctx.strokeStyle=a.strokeColor),this.ctx.globalAlpha=a.strokeOpacity?a.strokeOpacity:1,this.ctx.stroke());a.texture&&(c=this.textures(a.texture),null!=c&&(c=this.ctx.createPattern(c.toPattern(a.textureratio),"repeat"),this.ctx.fillStyle=c,this.ctx.fill()));a=a.customeColor;"object"==("undefined"===typeof a?"undefined":_typeof(a))&&null!=a.color&&(this.ctx.fillStyle=a.color,this.ctx.globalAlpha=a.opacity,this.ctx.fill())};d.prototype._isSavePoint=function(a,c,b,e){if(null==a||null==b)return!0;var d=c[0]-a[0];a=c[1]-a[1];var g=b[0]-c[0];c=b[1]-c[1];return Math.sqrt(d*d+a*a)<e&&Math.sqrt(g*g+c*c)<e?!1:!0};d.prototype._renderLinePath=function(a,c,b){this.resize?this.ctx.moveTo(a[0]*this.ratio,a[1]*this.ratio):this.ctx.moveTo(a[0],a[1]);var e=2,d=a.length;0!=d%2&&--d;for(var g=[a[0],a[1]],h,p;e<d;){var l=0;h=[a[e],a[e+1]];if(null!=b)for(p=e+2>d?null:[a[e+2],a[e+3]];!this._isSavePoint(g,h,p,b*this.ratio);)l+=2,h=[a[e+l],a[e+1+l]],p=e+2+l>d?null:[a[e+2+l],a[e+3+l]];this.resize?this.ctx.lineTo(h[0]*this.ratio,h[1]*this.ratio):this.ctx.lineTo(h[0],h[1]);g=h;e=e+l+2}c&&(this.resize?this.ctx.lineTo(a[0]*this.ratio,a[1]*this.ratio):this.ctx.lineTo(a[0],a[1]),this.ctx.closePath())};return d}(h("./AbstractVTileProcess"));k.exports=h},{"./AbstractVTileProcess":28}],31:[function(h,k,n){n=h("./GXYZUtil");h=h("./../../../utils/es6-promise");var g=h.Deferred,d=h.getJSON;h=function(a){function c(b){_classCallCheck(this,c);var e=_possibleConstructorReturn(this,a.call(this));e.textures={};e.isDynamicMap=b;e.styleObj={};return e}_inherits(c,a);c.prototype.setStyle=function(a){this.styleObj=a};c.prototype.formatStyle=function(a,c){this.styleObj=a;var b=JSON.stringify(this.styleObj);d({type:"post",url:this.host+"/mapserver/styleInfo/format.do",data:"styleJson\x3d "+b,dataType:"json"}).then(function(a){this.styleFun=new Function("drawer","level",a.styleJs);c()}.bind(this))};c.prototype.loadStyle=function(a){var b=new g,c=new g;a||(a="label");this.isDynamicMap?(a=JSON.stringify(this.styleObj),d({type:"post",url:"http://127.0.0.1/mapserver/styleInfo/format.do",data:"styleJson\x3d "+a,dataType:"json"}).then(function(a){this.styleFun=new Function("drawer","level",a.styleJs);b.resolve()}.bind(this))):d({url:this.host+"/mapserver/styleInfo/"+this.servername+"/"+this.styleId+"/"+a+"/style.js?"+Math.random(),dataType:"text"}).then(function(a){this.styleFun=new Function("drawer","level",a);b.resolve()}.bind(this));d({url:this.host+"/mapserver/styleInfo/"+this.servername+"/"+this.styleId+"/label/texture.js?"+Math.random(),dataType:"text"}).then(function(a){a=JSON.parse(a);var b=0,d;for(d in a)b++;if(0==b)c.resolve();else{var e=0,f;for(f in a)d=new Image,d.name=f,d.onload=function(a){e++;this.textures[a.target.name]=a.target;e==b&&c.resolve()}.bind(this),d.src=a[f]}}.bind(this));return[b,c]};return c}(n);k.exports=h},{"./../../../utils/es6-promise":39,"./GXYZUtil":32}],32:[function(h,k,n){var g=h("./../../../utils/es6-promise").getJSON,d=h("./../../../filter/Filter"),a=h("./../../../filter/FilterLayer"),c=h("../../../ext/Version");h=function(){function b(){_classCallCheck(this,b);this.tileSize=256}b.prototype.setFilter=function(a,b){for(var c=0;c<a.layers.length;c++)a.layers[c].id||a.layers.splice(c,1);c=JSON.stringify(a);this.isIE()?g({type:"post",url:this.host+"/mapserver/vmap/"+this.servername+"/setControl",data:"control\x3d "+c,dataType:"json"}).then(function(a){a.isIE=!0;b(a)}.bind(this)):b({isIE:!1,id:c})};b.prototype.parseUrl=function(a){a=a.split("?");var b=a[0].split("/mapserver/");this.host=b[0];this.servername=b[1].split("/")[1];a=a[1].split("\x26");for(b=0;b<a.length;b++){var c=a[b].split("\x3d");if("styleId"==c[0]){this.styleId=c[1];break}}};b.prototype.pickupFeatures=function(a,b,d,h,p,l,k,n){a=this.host+"/mapserver/pickup/"+this.servername+"/getData?x\x3d"+b+"\x26y\x3d"+a+"\x26l\x3d"+d+"\x26pixelX\x3d"+h+"\x26pixelY\x3d"+p+"\x26styleId\x3d"+this.styleId+"\x26tilesize\x3d"+this.tileSize+"\x26clientVersion\x3d"+c;l&&(a=a+"\x26control\x3d"+l);k&&(a=a+"\x26controlId\x3d"+k);g({url:a,dataType:"json"}).then(function(a){n(a)},function(){n([])})};b.prototype.CreateHighlightFilter=function(b,c){var e=new d;e.otherDisplay=!1;for(var f in b){var g=b[f],h=new a;h.id=f;h.color=c;var k="",n;for(n in g)k=k+n+",";0<k.length&&(k=k.substr(0,k.length-1),h.idFilter=k);e.addFilterLayer(h)}return e};b.prototype.CreateEveryHighlightFilter=function(b){var c=new d;c.otherDisplay=!1;for(var e in b){var g=b[e],h=g.style,l=!1,k;for(k in g){l=g[k].style;l.color=l.color.replace("#","%23");var n=new a;n.id=e;n.idFilter=k;n.color=l;c.addFilterLayer(n);l=!0}!l&&h&&(h.color=h.color.replace("#","%23"),n=new a,n.id=e,n.color=h,c.addFilterLayer(n))}return c};b.prototype.isIE=function(){return window.ActiveXObject||"ActiveXObject"in window?!0:!1};return b}();k.exports=h},{"../../../ext/Version":3,"./../../../filter/Filter":4,"./../../../filter/FilterLayer":5,"./../../../utils/es6-promise":39}],33:[function(h,k,n){h=function(){function g(d){_classCallCheck(this,g);this.propertyConfig={};for(var a=0;a<d.length;a++){if("true"==d[a].id||1==d[a].id)this.idIndex=d[a].index;this.propertyConfig[d[a].name]=parseInt(d[a].index)}}g.prototype.get=function(d,a){return d[this.propertyConfig[a]]};g.prototype.getId=function(d){return d[this.idIndex]};return g}();k.exports=h},{}],34:[function(h,k,n){h=function(){function g(d){_classCallCheck(this,g);this.group={};this.group.id=d;this.group.type="group";this.group.children=[]}g.prototype.addStyle=function(d){this.group.children.push(d.style)};return g}();k.exports=h},{}],35:[function(h,k,n){h=function(){function g(d,a){_classCallCheck(this,g);this.levelsData=[];this.levelsKey=d+"-"+a}g.prototype.addGroup=function(d){this.levelsData.push(d.group)};g.prototype.addStyleItem=function(d){this.levelsData.push(d.style)};return g}();k.exports=h},{}],36:[function(h,k,n){h=function(){function g(d,a){_classCallCheck(this,g);this.style={};this.style.id=d;this.style.layer=a;this.style.type="style";this.style.children=[]}g.prototype.queryFilter=function(d,a){d?(this.style.query=d,this.style.fields=a):this.style.query=""};g.prototype.setStyle=function(d){this.style.style=d};g.prototype.addSubStyle=function(d){this.style.children.push(d.style)};return g}();k.exports=h},{}],37:[function(h,k,n){h=function(){function g(d){_classCallCheck(this,g);this.size=d;this.map={};this.list=[]}g.prototype.push=function(d,a){if(this.list.length>this.size-1){var c=this.list.shift();delete this.map[c]}this.list.push(d);this.map[d]=a};g.prototype.getItem=function(d){return this.map[d]};g.prototype.clean=function(){this.map={};this.list=[]};g.prototype.length=function(){return this.list.length};return g}();k.exports=h},{}],38:[function(h,k,n){function g(){this.id=this.createUUID()}g.prototype.valueOf=function(){return this.id};g.prototype.toString=function(){return this.id};g.prototype.createUUID=function(){var d=new Date(1582,10,15,0,0,0,0),a=(new Date).getTime()-d.getTime(),d=g.getIntegerBits(a,0,31),c=g.getIntegerBits(a,32,47),a=g.getIntegerBits(a,48,59)+"2",b=g.getIntegerBits(g.rand(4095),0,7),e=g.getIntegerBits(g.rand(4095),0,7),f=g.getIntegerBits(g.rand(8191),0,7)+g.getIntegerBits(g.rand(8191),8,15)+g.getIntegerBits(g.rand(8191),0,7)+g.getIntegerBits(g.rand(8191),8,15)+g.getIntegerBits(g.rand(8191),0,15);return d+c+a+b+e+f};g.getIntegerBits=function(d,a,c){d=g.returnBase(d,16);var b=[],e="",f;for(f=0;f<d.length;f++)b.push(d.substring(f,f+1));for(f=Math.floor(a/4);f<=Math.floor(c/4);f++)e=b[f]&&""!=b[f]?e+b[f]:e+"0";return e};g.returnBase=function(d,a){var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");if(d<a)c=c[d];else var b=""+Math.floor(d/a),e=d-b*a,c=b>=a?this.returnBase(b,a)+c[e]:c[b]+c[e];return c};g.rand=function(d){return Math.floor(Math.random()*d)};k.exports=g},{}],39:[function(h,k,n){k.exports={Deferred:function(){this.promise=new Promise(function(g,d){this.resolve=g;this.reject=d}.bind(this));this.then=this.promise.then.bind(this.promise);this["catch"]=this.promise["catch"].bind(this.promise)},getJSON:function(g){g.type||(g.type="GET");g.dataType||(g.dataType="json");return new Promise(function(d,a){var c=new XMLHttpRequest;c.overrideMimeType&&c.overrideMimeType("text/html");c.open(g.type,g.url);c.onreadystatechange=function(){if(this.readyState===this.DONE)if(200===this.status){var b=this.responseText;"json"==g.dataType&&"string"==typeof b&&(b=JSON.parse(b));d(b)}else a(Error("getJSON: "+g.url+" failed with status: ["+this.status+"]"))};c.responseType="text";"GET"==g.type.toUpperCase()&&c.setRequestHeader("Content-Type","text/plain; charset\x3dutf-8");"POST"==g.type.toUpperCase()&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");c.send(g.data)})},getParamJSON:function(g){g.type||(g.type="GET");g.dataType||(g.dataType="json");var d=new XMLHttpRequest,a=new Promise(function(a,b){d.overrideMimeType&&d.overrideMimeType("text/html");var c=!1;setTimeout(function(){"200"!=d.status&&(c=!0,d.abort())},3E4);d.open(g.type,g.url);d.onreadystatechange=function(){if(c)b({param:g,data:"getParamJSON: "+g.url+" timeout"});else if(this.readyState===this.DONE)if(200===this.status){var d=this.responseText;"json"==g.dataType&&"string"==typeof d&&(d=JSON.parse(d));a({param:g,data:d})}else b({param:g,data:"getParamJSON: "+g.url+" failed with status: ["+this.status+"]"})};d.responseType="text";"GET"==g.type.toUpperCase()&&d.setRequestHeader("Content-Type","text/plain; charset\x3dutf-8");"POST"==g.type.toUpperCase()&&d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(g.data)});a.xhr=d;return a}}},{}],40:[function(h,k,n){h=function(){function g(d,a,c,b,e,f){_classCallCheck(this,g);e=5*e/100;this.left=d-e;this.right=a+e;this.bottom=c-e;this.top=b+e;this.previous=g.createEmptyDoubleArray();this.now=g.createEmptyDoubleArray();this.question=g.createEmptyDoubleArray();this.point_question_quadrant=this.point_now_quadrant=this.point_previous_quadrant=-1}g.createEmptyDoubleArray=function(){return[NaN,NaN]};g.prototype.copy=function(d,a){a[0]=d[0];a[1]=d[1]};g.isEmpty=function(d){return null==d?!0:isNaN(d[0])||isNaN(d[1])?!0:!1};g.prototype.isQuadrant=function(d){var a=d[0];d=d[1];return a<this.left?d>this.top?8:d<this.bottom?2:1:a>this.right?d>this.top?6:d<this.bottom?4:5:d>this.top?7:d<this.bottom?3:9};g.prototype.passrule=function(d,a){return 1==d?1==a||2==a||8==a?2:1:2==d?1==a||2==a||8==a||3==a||4==a?2:1:3==this.point_previous_quadrant?2==this.point_now_quadrant||3==this.point_now_quadrant||4==this.point_now_quadrant?2:1:4==d?2==a||3==a||4==a||5==a||6==a?2:1:5==d?4==a||5==a||6==a?2:1:6==d?4==a||5==a||6==a||7==a||8==a?2:1:7==d?6==a||7==a||8==a?2:1:8==d?6==a||7==a||8==a||1==a||2==a?2:1:1};g.prototype.reset=function(){this.previous[0]=NaN;this.previous[1]=NaN;this.question[0]=NaN;this.question[1]=NaN;this.now[0]=NaN;this.now[1]=NaN;this.point_question_quadrant=this.point_now_quadrant=this.point_previous_quadrant=-1};g.prototype["in"]=function(d){return d[0]<this.left||d[0]>this.right||d[1]<this.bottom||d[1]>this.top?!1:!0};g.length=function(d,a,c,b){d=c-d;a=b-a;return Math.sqrt(d*d+a*a)};g.prototype.push=function(d,a){this.now[0]=d;this.now[1]=a;if(g.isEmpty(this.previous))return this.copy(this.now,this.previous),this.point_previous_quadrant=this.isQuadrant(this.now),[this.now];this.point_now_quadrant=this.isQuadrant(this.now);var c=this.passrule(this.point_previous_quadrant,this.point_now_quadrant);if(1==c){this.point_previous_quadrant=this.isQuadrant(this.now);this.copy(this.now,this.previous);if(g.isEmpty(this.question))return[this.now];c=[];this.copy(this.question,c);this.question=g.createEmptyDoubleArray();return[c,this.now]}if(2==c){if(!g.isEmpty(this.question)&&(c=this.passrule(this.point_question_quadrant,this.point_now_quadrant),1==c))return c=[],this.copy(this.question,c),this.question=g.createEmptyDoubleArray(),[c,this.now];this.copy(this.now,this.question);this.point_question_quadrant=this.point_now_quadrant}return null};return g}();k.exports=h},{}],41:[function(h,k,n){h=function(){function g(){_classCallCheck(this,g)}g.pointDistToLine=function(d,a,c,b,e,f){var g=((d-c)*(e-c)+(a-b)*(f-b))/((c-e)*(c-e)+(b-f)*(b-f));c+=g*(e-c);b+=g*(f-b);return Math.sqrt((d-c)*(d-c)+(a-b)*(a-b))};g.isPointOnSegment=function(d,a,c,b,e,f){return d-3>c&&d+3>e||d+3<c&&d-3<e||a-3>b&&a+3>f||a+3<b&&a-3<f?0:3>g.pointDistToLine(d,a,c,b,e,f)?1:0};g.pointInLine=function(d,a,c){var b=[];Array.isArray(c[0])?b=c:b.push(c);for(c=0;c<b.length;c++)for(var e=b[c],f=e.length/2,h=0;h<f-1;h++){var k;k=h+1;if(1==g.isPointOnSegment(d,a,e[2*h],e[2*h+1],e[2*k],e[2*k+1]))return 1}return 0};g.pointInPolygon=function(d,a,c){var b=0,e=[];Array.isArray(c[0])?e=c:e.push(c);for(c=0;c<e.length;c++)for(var f=e[c],g=0,h=f.length/2,k=h-1;g<h;k=g,g++){var l=f[2*g],q=f[2*g+1],n=f[2*k],k=f[2*k+1];if(l===d&&q===a||n===d&&k===a)return 1;if(q<a&&k>=a||q>=a&&k<a){l+=(a-q)*(n-l)/(k-q);if(l===d)return 1;l>d&&(b=!b)}}return b?1:0};g.lineIntersects=function(d,a,c,b,e,f,g,h){var k,l,m,n,r=[null,null];k=(h-f)*(c-d)-(g-e)*(b-a);if(0===k)return null!==r[0]&&null!==r[1]?r:!1;l=a-f;m=d-e;n=(c-d)*l-(b-a)*m;l=((g-e)*l-(h-f)*m)/k;m=n/k;r[0]=d+l*(c-d);r[1]=a+l*(b-a);return 0<m&&1>m?r:!1};g.polyWith=function(d,a){for(var c=d.length/2,b=a.length/2,e,f,h,k,p,l,n,t,x=0;x<c;x++){x!=c-1?(f=d[2*x],h=d[2*x+1],k=d[2*x+2],e=d[2*x+3]):(f=d[2*x],h=d[2*x+1],k=d[0],e=d[1]);for(var u=0;u<b;u++)if(u!=b-1?(l=a[2*u],n=a[2*u+1],t=a[2*u+2],p=a[2*u+3]):(l=a[2*u],n=a[2*u+1],t=a[0],p=a[1]),0!=g.lineIntersects(f,h,k,e,l,n,t,p))return 1}return g.pointInPolygon(a[0],a[1],d)?2:3};g.boxToPolyArr=function(d,a,c,b){var e=[];e.push(d);e.push(a);e.push(d);e.push(b);e.push(c);e.push(b);e.push(c);e.push(a);e.push(d);e.push(a);return e};g.getExtensionPoint=function(d,a,c){var b=a[0]-d[0],e=a[1]-d[1];d=a[0];0==b?a=0<e?a[1]+c:a[1]-c:(c=Math.sqrt(c*c/(e/b*(e/b)+1)),0>b&&(c=-c),d=a[0]+c,a=a[1]+e/b*c);return[d,a]};g.lineOffset=function(d,a){var c=[],b=[];d.forEach(function(e,f){if(f!==d.length-1){var h=g.processSegment(e,d[f+1],a);c.push(h);if(0<f){var k=c[f-1],n=g.lineIntersects(h[0][0],h[0][1],h[1][0],h[1][1],k[0][0],k[0][1],k[1][0],k[1][1]);!1!==n&&(k[1]=n,h[0]=n);b.push(k[0]);f===d.length-2&&(b.push(h[0]),b.push(h[1]))}2===d.length&&(b.push(h[0]),b.push(h[1]))}});return b};g.processSegment=function(d,a,c){var b=d[0],e=a[0],f=Math.sqrt((b[0]-e[0])*(b[0]-e[0])+(b[1]-e[1])*(b[1]-e[1]));return[[[b[0]+c*(e[1]-b[1])/f,b[1]+c*(b[0]-e[0])/f],d[1]],[[e[0]+c*(e[1]-b[1])/f,e[1]+c*(b[0]-e[0])/f],a[1]]]};return g}();k.exports=h},{}],42:[function(h,k,n){function g(){throw Error("setTimeout has not been defined");}function d(){throw Error("clearTimeout has not been defined");}function a(a){if(r===setTimeout)return setTimeout(a,0);if((r===g||!r)&&setTimeout)return r=setTimeout,setTimeout(a,0);try{return r(a,0)}catch(G){try{return r.call(null,a,0)}catch(B){return r.call(this,a,0)}}}function c(a){if(p===clearTimeout)return clearTimeout(a);if((p===d||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(a);try{return p(a)}catch(G){try{return p.call(null,a)}catch(B){return p.call(this,a)}}}function b(){q&&t&&(q=!1,t.length?l=t.concat(l):x=-1,l.length&&e())}function e(){if(!q){var d=a(b);q=!0;for(var e=l.length;e;){t=l;for(l=[];++x<e;)t&&t[x].run();x=-1;e=l.length}t=null;q=!1;c(d)}}function f(a,b){this.fun=a;this.array=b}function m(){}h=k.exports={};var r,p;try{r="function"===typeof setTimeout?setTimeout:g}catch(u){r=g}try{p="function"===typeof clearTimeout?clearTimeout:d}catch(u){p=d}var l=[],q=!1,t,x=-1;h.nextTick=function(b){var c=Array(arguments.length-1);if(1<arguments.length)for(var d=1;d<arguments.length;d++)c[d-1]=arguments[d];l.push(new f(b,c));1!==l.length||q||a(e)};f.prototype.run=function(){this.fun.apply(null,this.array)};h.title="browser";h.browser=!0;h.env={};h.argv=[];h.version="";h.versions={};h.on=m;h.addListener=m;h.once=m;h.off=m;h.removeListener=m;h.removeAllListeners=m;h.emit=m;h.prependListener=m;h.prependOnceListener=m;h.listeners=function(a){return[]};h.binding=function(a){throw Error("process.binding is not supported");};h.cwd=function(){return"/"};h.chdir=function(a){throw Error("process.chdir is not supported");};h.umask=function(){return 0}},{}]},{},[6])(6)});