@dvgis/cesium-map
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(6);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(7).default,i=r(8);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(9)},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(4),a=r.n(o),s=r(2),u=r.n(s),l=r(3),c=r.n(l),f=r(1),h=r.n(f),p=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],y=[75,60,45,30,15,0],g=[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],m=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],v=function(){function t(){i()(this,t),this.isWgs84=!1}return a()(t,[{key:"getDistanceByMC",value:function(t,e){if(!t||!e)return 0;if(!(t=this.convertMC2LL(t)))return 0;var r=this.toRadians(t.lng),n=this.toRadians(t.lat);if(!(e=this.convertMC2LL(e)))return 0;var i=this.toRadians(e.lng),o=this.toRadians(e.lat);return this.getDistance(r,i,n,o)}},{key:"getDistanceByLL",value:function(t,e){if(!t||!e)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74);var r=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.toRadians(e.lng),o=this.toRadians(e.lat);return this.getDistance(r,i,n,o)}},{key:"convertMC2LL",value:function(t){if(!t)return{lng:0,lat:0};var e={};if(this.isWgs84){e.lng=t.lng/20037508.34*180;var r=t.lat/20037508.34*180;return e.lat=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),{lng:e.lng.toFixed(6),lat:e.lat.toFixed(6)}}Math.abs(t.lng);for(var n=Math.abs(t.lat),i=void 0,o=0;o<p.length;o++)if(n>=p[o]){i=g[o];break}return{lng:(e=this.convertor(t,i)).lng.toFixed(6),lat:e.lat.toFixed(6)}}},{key:"convertLL2MC",value:function(t){if(!t)return{lng:0,lat:0};if(t.lng>180||t.lng<-180||t.lat>90||t.lat<-90)return t;if(this.isWgs84){var e={};e.lng=t.lng*Math.PI/180*6378137;var r=t.lat*Math.PI/180;return e.lat=3189068.5*Math.log((1+Math.sin(r))/(1-Math.sin(r))),{lng:parseFloat(e.lng.toFixed(2)),lat:parseFloat(e.lat.toFixed(2))}}t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74);t.lng;for(var n=t.lat,i=void 0,o=0;o<y.length;o++)if(n>=y[o]){i=m[o];break}if(!i)for(var a=0;a<y.length;a++)if(n<=-y[a]){i=m[a];break}var s=this.convertor(t,i);return{lng:parseFloat(s.lng.toFixed(2)),lat:parseFloat(s.lat.toFixed(2))}}},{key:"convertor",value:function(t,e){if(!t||!e)return{lng:0,lat:0};var r=e[0]+e[1]*Math.abs(t.lng),n=Math.abs(t.lat)/e[9],i=e[2]+e[3]*n+e[4]*n*n+e[5]*n*n*n+e[6]*n*n*n*n+e[7]*n*n*n*n*n+e[8]*n*n*n*n*n*n;return{lng:r*=t.lng<0?-1:1,lat:i*=t.lat<0?-1:1}}},{key:"getDistance",value:function(t,e,r,n){return 6370996.81*Math.acos(Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos(e-t))}},{key:"toRadians",value:function(t){return Math.PI*t/180}},{key:"toDegrees",value:function(t){return 180*t/Math.PI}},{key:"getRange",value:function(t,e,r){return null!=e&&(t=Math.max(t,e)),null!=r&&(t=Math.min(t,r)),t}},{key:"getLoop",value:function(t,e,r){for(;t>r;)t-=r-e;for(;t<e;)t+=r-e;return t}},{key:"lngLatToMercator",value:function(t){return this.convertLL2MC(t)}},{key:"lngLatToPoint",value:function(t){var e=this.convertLL2MC(t);return{x:e.lng,y:e.lat}}},{key:"mercatorToLngLat",value:function(t){return this.convertMC2LL(t)}},{key:"pointToLngLat",value:function(t){var e={lng:t.x,lat:t.y};return this.convertMC2LL(e)}},{key:"pointToPixel",value:function(t,e,r,n){if(t){t=this.lngLatToMercator(t);var i=this.getZoomUnits(e);return{x:Math.round((t.lng-r.lng)/i+n.width/2),y:Math.round((r.lat-t.lat)/i+n.height/2)}}}},{key:"pixelToPoint",value:function(t,e,r,n){if(t){var i=this.getZoomUnits(e),o={lng:r.lng+i*(t.x-n.width/2),lat:r.lat-i*(t.y-n.height/2)};return this.mercatorToLngLat(o)}}},{key:"getZoomUnits",value:function(t){return Math.pow(2,18-t)}}]),t}(),d=52.35987755982988,x=3.141592653589793,M=.006693421622965943,b=function(){function t(){i()(this,t)}return a()(t,null,[{key:"BD09ToGCJ02",value:function(t,e){var r=+t-.0065,n=+e-.006,i=Math.sqrt(r*r+n*n)-2e-5*Math.sin(n*d),o=Math.atan2(n,r)-3e-6*Math.cos(r*d);return[i*Math.cos(o),i*Math.sin(o)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var r=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*d),n=Math.atan2(e,t)+3e-6*Math.cos(t*d);return[r*Math.cos(n)+.0065,r*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var r=this.delta(t,e);return[t+r[0],e+r[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var r=this.delta(t,e);return[2*t-(t+r[0]),2*e-(e+r[1])]}},{key:"delta",value:function(t,e){var r=this.transformLng(t-105,e-35),n=this.transformLat(t-105,e-35),i=e/180*x,o=Math.sin(i);o=1-M*o*o;var a=Math.sqrt(o);return[r=180*r/(6378245/a*Math.cos(i)*x),n=180*n/(6378245*(1-M)/(o*a)*x)]}},{key:"transformLng",value:function(t,e){var r=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*x)+20*Math.sin(2*t*x))/3,r+=2*(20*Math.sin(t*x)+40*Math.sin(t/3*x))/3,r+=2*(150*Math.sin(t/12*x)+300*Math.sin(t/30*x))/3}},{key:"transformLat",value:function(t,e){var r=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*x)+20*Math.sin(2*t*x))/3,r+=2*(20*Math.sin(e*x)+40*Math.sin(e/3*x))/3,r+=2*(160*Math.sin(e/12*x)+320*Math.sin(e*x/30))/3}},{key:"out_of_china",value:function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)}}]),t}();function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h()(t);if(e){var i=h()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c()(this,r)}}var _=function(t){u()(r,t);var e=C(r);function r(t){var n;i()(this,r),n=e.call(this,t);var o=new v;return n._projection.project=function(t,e){return e=e||{},e=b.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),(e=b.GCJ02ToBD09(e[0],e[1]))[0]=Math.min(e[0],180),e[0]=Math.max(e[0],-180),e[1]=Math.min(e[1],74.000022),e[1]=Math.max(e[1],-71.988531),e=o.lngLatToPoint({lng:e[0],lat:e[1]}),new Cesium.Cartesian2(e.x,e.y)},n._projection.unproject=function(t,e){return e=e||{},e=o.mercatorToLngLat({lng:t.x,lat:t.y}),e=b.BD09ToGCJ02(e.lng,e.lat),e=b.GCJ02ToWGS84(e[0],e[1]),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},n.resolutions=t.resolutions||[],n}return a()(r,[{key:"tileXYToNativeRectangle",value:function(t,e,r,n){var i=this.resolutions[r],o=t*i,a=(t+1)*i,s=(1+(e=-e))*i,u=e*i;return Cesium.defined(n)?(n.west=o,n.south=u,n.east=a,n.north=s,n):new Cesium.Rectangle(o,u,a,s)}},{key:"positionToTileXY",value:function(t,e,r){var n=this._rectangle;if(Cesium.Rectangle.contains(n,t)){var i=this._projection.project(t);if(Cesium.defined(i)){var o=this.resolutions[e],a=Math.floor(i.x/o),s=-Math.floor(i.y/o);return Cesium.defined(r)?(r.x=a,r.y=s,r):new Cesium.Cartesian2(a,s)}}}}]),r}(Cesium.WebMercatorTilingScheme),R="http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",w="http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",k="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",L=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(i()(this,t),this._url="img"===e.style?R:"vec"===e.style?w:k,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._crs=e.crs||"BD09","WGS84"===e.crs){for(var r=[],n=0;n<19;n++)r[n]=256*Math.pow(2,18-n);this._tilingScheme=new _({resolutions:r,rectangleSouthwestInMeters:new Cesium.Cartesian2(-20037726.37,-12474104.17),rectangleNortheastInMeters:new Cesium.Cartesian2(20037726.37,12474104.17)})}else this._tilingScheme=new Cesium.WebMercatorTilingScheme({rectangleSouthwestInMeters:new Cesium.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new Cesium.Cartesian2(33554054,33746824)});this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal"}return a()(t,[{key:"url",get:function(){return this._url}},{key:"token",get:function(){return this._token}},{key:"tileWidth",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},{key:"tileHeight",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},{key:"maximumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},{key:"minimumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},{key:"tilingScheme",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},{key:"rectangle",get:function(){if(!this.ready)throw new Cesium.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},{key:"ready",get:function(){return!!this._url}},{key:"credit",get:function(){return this._credit}},{key:"hasAlphaChannel",get:function(){return!0}},{key:"getTileCredits",value:function(t,e,r){}},{key:"requestImage",value:function(t,e,r){if(!this.ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=this._tilingScheme.getNumberOfXTilesAtLevel(r),i=this._tilingScheme.getNumberOfYTilesAtLevel(r),o=this._url.replace("{z}",r).replace("{s}",String(1)).replace("{style}",this._style);return o="WGS84"===this._crs?o.replace("{x}",String(t)).replace("{y}",String(-e)):o.replace("{x}",String(t-n/2)).replace("{y}",String(i/2-e-1)),Cesium.ImageryProvider.loadImage(this,o)}}]),t}();function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h()(t);if(e){var i=h()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c()(this,r)}}var S=function(t){u()(r,t);var e=T(r);function r(t){var n;i()(this,r),n=e.call(this,t);var o=new Cesium.WebMercatorProjection;return n._projection.project=function(t,e){return e=b.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),e=o.project(new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))),new Cesium.Cartesian2(e.x,e.y)},n._projection.unproject=function(t,e){var r=o.unproject(t);return e=b.GCJ02ToWGS84(Cesium.Math.toDegrees(r.longitude),Cesium.Math.toDegrees(r.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},n}return r}(Cesium.WebMercatorTilingScheme);function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h()(t);if(e){var i=h()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c()(this,r)}}var z="https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",j="https://webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",D=function(t){u()(r,t);var e=P(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i()(this,r),t.url="img"===t.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"cva"===t.style?j:z,t.subdomains&&t.subdomains.length||(t.subdomains=["01","02","03","04"]),"WGS84"===t.crs&&(t.tilingScheme=new S),e.call(this,t)}return r}(Cesium.UrlTemplateImageryProvider);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h()(t);if(e){var i=h()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c()(this,r)}}var I=function(t){u()(r,t);var e=O(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,r);var n="img"===t.style?"https://p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400":"https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347";return t.url=n.replace("{style}",t.style||1),t.subdomains&&t.subdomains.length||(t.subdomains=["0","1","2"]),"img"===t.style&&(t.customTags={sx:function(t,e,r,n){return e>>4},sy:function(t,e,r,n){return(1<<n)-r>>4}}),e.call(this,t)}return r}(Cesium.UrlTemplateImageryProvider);function G(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h()(t);if(e){var i=h()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c()(this,r)}}var W="https://t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}",B=function(t){u()(r,t);var e=G(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i()(this,r),e.call(this,{url:W.replace(/\{style\}/g,t.style||"vec").replace(/\{key\}/g,t.key||""),subdomains:["0","1","2","3","4","5","6","7"],tilingScheme:new Cesium.WebMercatorTilingScheme,maximumLevel:18})}return r}(Cesium.UrlTemplateImageryProvider);function F(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=h()(t);if(e){var i=h()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c()(this,r)}}var E="http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",J="http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile",N=function(t){u()(r,t);var e=F(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i()(this,r),t.url="img"===t.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===t.style?J:E,t.subdomains&&t.subdomains.length||(t.subdomains=["1","2","3"]),e.call(this,t)}return r}(Cesium.UrlTemplateImageryProvider);Cesium.AmapImageryProvider=D,Cesium.BaiduImageryProvider=L,Cesium.TencentImageryProvider=I,Cesium.TdtImageryProvider=B,Cesium.GoogleImageryProvider=N}]); | ||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(6);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(7).default,o=r(8);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){e.exports=r(9)},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),s=r(3),u=r.n(s),l=r(4),c=r.n(l),f=r(2),h=r.n(f),y=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],p=[75,60,45,30,15,0],g=[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],m=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],v=function(){function e(){o()(this,e),this.isWgs84=!1}return a()(e,[{key:"getDistanceByMC",value:function(e,t){if(!e||!t)return 0;if(!(e=this.convertMC2LL(e)))return 0;var r=this.toRadians(e.lng),n=this.toRadians(e.lat);if(!(t=this.convertMC2LL(t)))return 0;var o=this.toRadians(t.lng),i=this.toRadians(t.lat);return this.getDistance(r,o,n,i)}},{key:"getDistanceByLL",value:function(e,t){if(!e||!t)return 0;e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74),t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74);var r=this.toRadians(e.lng),n=this.toRadians(e.lat),o=this.toRadians(t.lng),i=this.toRadians(t.lat);return this.getDistance(r,o,n,i)}},{key:"convertMC2LL",value:function(e){if(!e)return{lng:0,lat:0};var t={};if(this.isWgs84){t.lng=e.lng/20037508.34*180;var r=e.lat/20037508.34*180;return t.lat=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),{lng:t.lng.toFixed(6),lat:t.lat.toFixed(6)}}Math.abs(e.lng);for(var n=Math.abs(e.lat),o=void 0,i=0;i<y.length;i++)if(n>=y[i]){o=g[i];break}return{lng:(t=this.convertor(e,o)).lng.toFixed(6),lat:t.lat.toFixed(6)}}},{key:"convertLL2MC",value:function(e){if(!e)return{lng:0,lat:0};if(e.lng>180||e.lng<-180||e.lat>90||e.lat<-90)return e;if(this.isWgs84){var t={};t.lng=e.lng*Math.PI/180*6378137;var r=e.lat*Math.PI/180;return t.lat=3189068.5*Math.log((1+Math.sin(r))/(1-Math.sin(r))),{lng:parseFloat(t.lng.toFixed(2)),lat:parseFloat(t.lat.toFixed(2))}}e.lng=this.getLoop(e.lng,-180,180),e.lat=this.getRange(e.lat,-74,74);e.lng;for(var n=e.lat,o=void 0,i=0;i<p.length;i++)if(n>=p[i]){o=m[i];break}if(!o)for(var a=0;a<p.length;a++)if(n<=-p[a]){o=m[a];break}var s=this.convertor(e,o);return{lng:parseFloat(s.lng.toFixed(2)),lat:parseFloat(s.lat.toFixed(2))}}},{key:"convertor",value:function(e,t){if(!e||!t)return{lng:0,lat:0};var r=t[0]+t[1]*Math.abs(e.lng),n=Math.abs(e.lat)/t[9],o=t[2]+t[3]*n+t[4]*n*n+t[5]*n*n*n+t[6]*n*n*n*n+t[7]*n*n*n*n*n+t[8]*n*n*n*n*n*n;return{lng:r*=e.lng<0?-1:1,lat:o*=e.lat<0?-1:1}}},{key:"getDistance",value:function(e,t,r,n){return 6370996.81*Math.acos(Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos(t-e))}},{key:"toRadians",value:function(e){return Math.PI*e/180}},{key:"toDegrees",value:function(e){return 180*e/Math.PI}},{key:"getRange",value:function(e,t,r){return null!=t&&(e=Math.max(e,t)),null!=r&&(e=Math.min(e,r)),e}},{key:"getLoop",value:function(e,t,r){for(;e>r;)e-=r-t;for(;e<t;)e+=r-t;return e}},{key:"lngLatToMercator",value:function(e){return this.convertLL2MC(e)}},{key:"lngLatToPoint",value:function(e){var t=this.convertLL2MC(e);return{x:t.lng,y:t.lat}}},{key:"mercatorToLngLat",value:function(e){return this.convertMC2LL(e)}},{key:"pointToLngLat",value:function(e){var t={lng:e.x,lat:e.y};return this.convertMC2LL(t)}},{key:"pointToPixel",value:function(e,t,r,n){if(e){e=this.lngLatToMercator(e);var o=this.getZoomUnits(t);return{x:Math.round((e.lng-r.lng)/o+n.width/2),y:Math.round((r.lat-e.lat)/o+n.height/2)}}}},{key:"pixelToPoint",value:function(e,t,r,n){if(e){var o=this.getZoomUnits(t),i={lng:r.lng+o*(e.x-n.width/2),lat:r.lat-o*(e.y-n.height/2)};return this.mercatorToLngLat(i)}}},{key:"getZoomUnits",value:function(e){return Math.pow(2,18-e)}}]),e}(),d=52.35987755982988,x=3.141592653589793,M=.006693421622965943,b=function(){function e(){o()(this,e)}return a()(e,null,[{key:"BD09ToGCJ02",value:function(e,t){var r=+e-.0065,n=+t-.006,o=Math.sqrt(r*r+n*n)-2e-5*Math.sin(n*d),i=Math.atan2(n,r)-3e-6*Math.cos(r*d);return[o*Math.cos(i),o*Math.sin(i)]}},{key:"GCJ02ToBD09",value:function(e,t){t=+t,e=+e;var r=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*d),n=Math.atan2(t,e)+3e-6*Math.cos(e*d);return[r*Math.cos(n)+.0065,r*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];var r=this.delta(e,t);return[e+r[0],t+r[1]]}},{key:"GCJ02ToWGS84",value:function(e,t){if(t=+t,e=+e,this.out_of_china(e,t))return[e,t];var r=this.delta(e,t);return[2*e-(e+r[0]),2*t-(t+r[1])]}},{key:"delta",value:function(e,t){var r=this.transformLng(e-105,t-35),n=this.transformLat(e-105,t-35),o=t/180*x,i=Math.sin(o);i=1-M*i*i;var a=Math.sqrt(i);return[r=180*r/(6378245/a*Math.cos(o)*x),n=180*n/(6378245*(1-M)/(i*a)*x)]}},{key:"transformLng",value:function(e,t){var r=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return r+=2*(20*Math.sin(6*e*x)+20*Math.sin(2*e*x))/3,r+=2*(20*Math.sin(e*x)+40*Math.sin(e/3*x))/3,r+=2*(150*Math.sin(e/12*x)+300*Math.sin(e/30*x))/3}},{key:"transformLat",value:function(e,t){var r=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return r+=2*(20*Math.sin(6*e*x)+20*Math.sin(2*e*x))/3,r+=2*(20*Math.sin(t*x)+40*Math.sin(t/3*x))/3,r+=2*(160*Math.sin(t/12*x)+320*Math.sin(t*x/30))/3}},{key:"out_of_china",value:function(e,t){return t=+t,!((e=+e)>73.66&&e<135.05&&t>3.86&&t<53.55)}}]),e}();function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h()(e);if(t){var o=h()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c()(this,r)}}var _=function(e){u()(r,e);var t=C(r);function r(e){var n;o()(this,r),n=t.call(this,e);var i=new v;return n._projection.project=function(e,t){return t=t||{},t=b.WGS84ToGCJ02(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),(t=b.GCJ02ToBD09(t[0],t[1]))[0]=Math.min(t[0],180),t[0]=Math.max(t[0],-180),t[1]=Math.min(t[1],74.000022),t[1]=Math.max(t[1],-71.988531),t=i.lngLatToPoint({lng:t[0],lat:t[1]}),new Cesium.Cartesian2(t.x,t.y)},n._projection.unproject=function(e,t){return t=t||{},t=i.mercatorToLngLat({lng:e.x,lat:e.y}),t=b.BD09ToGCJ02(t.lng,t.lat),t=b.GCJ02ToWGS84(t[0],t[1]),new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))},n.resolutions=e.resolutions||[],n}return a()(r,[{key:"tileXYToNativeRectangle",value:function(e,t,r,n){var o=this.resolutions[r],i=e*o,a=(e+1)*o,s=(1+(t=-t))*o,u=t*o;return Cesium.defined(n)?(n.west=i,n.south=u,n.east=a,n.north=s,n):new Cesium.Rectangle(i,u,a,s)}},{key:"positionToTileXY",value:function(e,t,r){var n=this._rectangle;if(Cesium.Rectangle.contains(n,e)){var o=this._projection.project(e);if(Cesium.defined(o)){var i=this.resolutions[t],a=Math.floor(o.x/i),s=-Math.floor(o.y/i);return Cesium.defined(r)?(r.x=a,r.y=s,r):new Cesium.Cartesian2(a,s)}}}}]),r}(Cesium.WebMercatorTilingScheme),w={img:"//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",vec:"//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",custom:"//api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",traffic:"//its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2"},R=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o()(this,e),this._url=t.url||[t.protocol||"",w[t.style]||w.custom].join(""),this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._crs=t.crs||"BD09","WGS84"===t.crs){for(var r=[],n=0;n<19;n++)r[n]=256*Math.pow(2,18-n);this._tilingScheme=new _({resolutions:r,rectangleSouthwestInMeters:new Cesium.Cartesian2(-20037726.37,-12474104.17),rectangleNortheastInMeters:new Cesium.Cartesian2(20037726.37,12474104.17)})}else this._tilingScheme=new Cesium.WebMercatorTilingScheme({rectangleSouthwestInMeters:new Cesium.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new Cesium.Cartesian2(33554054,33746824)});this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=t.style||"normal",this._errorEvent=new Cesium.Event}return a()(e,[{key:"url",get:function(){return this._url}},{key:"token",get:function(){return this._token}},{key:"tileWidth",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},{key:"tileHeight",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},{key:"maximumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},{key:"minimumLevel",get:function(){if(!this.ready)throw new Cesium.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},{key:"tilingScheme",get:function(){if(!this.ready)throw new Cesium.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},{key:"rectangle",get:function(){if(!this.ready)throw new Cesium.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},{key:"ready",get:function(){return!!this._url}},{key:"errorEvent",get:function(){return this._errorEvent}},{key:"credit",get:function(){return this._credit}},{key:"hasAlphaChannel",get:function(){return!0}},{key:"getTileCredits",value:function(e,t,r){}},{key:"requestImage",value:function(e,t,r){if(!this.ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=this._tilingScheme.getNumberOfXTilesAtLevel(r),o=this._tilingScheme.getNumberOfYTilesAtLevel(r),i=this._url.replace("{z}",r).replace("{s}",String(1)).replace("{style}",this._style);return i="WGS84"===this._crs?i.replace("{x}",String(e)).replace("{y}",String(-t)):i.replace("{x}",String(e-n/2)).replace("{y}",String(o/2-t-1)),Cesium.ImageryProvider.loadImage(this,i)}}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h()(e);if(t){var o=h()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c()(this,r)}}var L=function(e){u()(r,e);var t=k(r);function r(e){var n;o()(this,r),n=t.call(this,e);var i=new Cesium.WebMercatorProjection;return n._projection.project=function(e,t){return t=b.WGS84ToGCJ02(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),t=i.project(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))),new Cesium.Cartesian2(t.x,t.y)},n._projection.unproject=function(e,t){var r=i.unproject(e);return t=b.GCJ02ToWGS84(Cesium.Math.toDegrees(r.longitude),Cesium.Math.toDegrees(r.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))},n}return a()(r)}(Cesium.WebMercatorTilingScheme);function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h()(e);if(t){var o=h()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c()(this,r)}}var S={img:"//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",elec:"//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",cva:"//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"},P=function(e){u()(r,e);var t=T(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o()(this,r),e.url=e.url||[e.protocol||"",S[e.style]||S.elec].join(""),e.subdomains&&e.subdomains.length||(e.subdomains=["01","02","03","04"]),"WGS84"===e.crs&&(e.tilingScheme=new L),t.call(this,e)}return a()(r)}(Cesium.UrlTemplateImageryProvider);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h()(e);if(t){var o=h()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c()(this,r)}}var z={img:"//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400",elec:"//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347"},O=function(e){u()(r,e);var t=j(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o()(this,r);var n=e.url||[e.protocol||"",z[e.style]||z.elec].join("");return e.url=n.replace("{style}",e.style||1),e.subdomains&&e.subdomains.length||(e.subdomains=["0","1","2"]),"img"===e.style&&(e.customTags={sx:function(e,t,r,n){return t>>4},sy:function(e,t,r,n){return(1<<n)-r>>4}}),t.call(this,e)}return a()(r)}(Cesium.UrlTemplateImageryProvider);function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h()(e);if(t){var o=h()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c()(this,r)}}var I="//t{s}.tianditu.gov.cn/DataServer?T={style}_c&x={x}&y={y}&l={z}&tk={key}",G=function(e){u()(r,e);var t=D(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o()(this,r),t.call(this,{url:[e.protocol||"",I.replace(/\{style\}/g,e.style||"vec").replace(/\{key\}/g,e.key||"")].join(""),subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:18})}return a()(r)}(Cesium.UrlTemplateImageryProvider);function B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h()(e);if(t){var o=h()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c()(this,r)}}var W={img:"//mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",elec:"//mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",ter:"//mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile"},E=function(e){u()(r,e);var t=B(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o()(this,r),e.url||[e.protocol||"",W[e.style]||W.elec].join(""),e.subdomains=e.subdomains||["1","2","3"],t.call(this,e)}return a()(r)}(Cesium.UrlTemplateImageryProvider);Cesium.AmapImageryProvider=P,Cesium.BaiduImageryProvider=R,Cesium.TencentImageryProvider=O,Cesium.TdtImageryProvider=G,Cesium.GoogleImageryProvider=E}]); |
{ | ||
"name": "@dvgis/cesium-map", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"main": "build/cesium.map.min.js", | ||
@@ -20,4 +20,4 @@ "repository": "https://github.com/dvgis/cesium-map.git", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "yarn run clean && webpack --mode development ", | ||
"publish": "yarn run clean && webpack --mode production --env.production ", | ||
"dev": "yarn run clean && webpack --mode development ", | ||
"build": "yarn run clean && webpack --mode production --env.production ", | ||
"clean": "rimraf build/" | ||
@@ -24,0 +24,0 @@ }, |
# cesium-map | ||
<p> | ||
<img src="https://img.shields.io/github/workflow/status/dvgis/cesium-map/build"/> | ||
<img src="https://img.shields.io/badge/license-Apache%202-blue"/> | ||
@@ -32,3 +33,3 @@ <img src="https://img.shields.io/npm/v/@dvgis/cesium-map?color=orange&logo=github" /> | ||
```html | ||
<script src="cesium-map/cesium.map.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@dvgis/cesium-map"></script> | ||
``` | ||
@@ -71,3 +72,3 @@ | ||
var options = { | ||
style: 'vec', //style: img、vec、vca、ter | ||
style: 'vec', //style: vec、cva、img、cia、ter | ||
key: '' | ||
@@ -84,3 +85,3 @@ } | ||
var options = { | ||
style: 'img', // style: img、elec、vca | ||
style: 'img', // style: img、elec、cva | ||
crs: 'WGS84' // 使用84坐标系,默认为:GCJ02 | ||
@@ -87,0 +88,0 @@ } |
@@ -8,19 +8,18 @@ /** | ||
const IMG_URL = | ||
'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}' | ||
const TILE_URL = { | ||
img: '//webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', | ||
elec: | ||
'//webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', | ||
cva: | ||
'//webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}' | ||
} | ||
const ELEC_URL = | ||
'https://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}' | ||
const CVA_URL = | ||
'https://webst{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}' | ||
class AmapImageryProvider extends Cesium.UrlTemplateImageryProvider { | ||
constructor(options = {}) { | ||
options['url'] = | ||
options.style === 'img' | ||
? IMG_URL | ||
: options.style === 'cva' | ||
? CVA_URL | ||
: ELEC_URL | ||
options.url || | ||
[ | ||
options.protocol || '', | ||
TILE_URL[options.style] || TILE_URL['elec'] | ||
].join('') | ||
if (!options.subdomains || !options.subdomains.length) { | ||
@@ -27,0 +26,0 @@ options['subdomains'] = ['01', '02', '03', '04'] |
@@ -8,19 +8,20 @@ /** | ||
const IMG_URL = | ||
'http://shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46' | ||
const VEC_URL = | ||
'http://online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020' | ||
const CUSTOM_URL = | ||
'http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}' | ||
const TILE_URL = { | ||
img: | ||
'//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46', | ||
vec: | ||
'//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020', | ||
custom: | ||
'//api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}', | ||
traffic: | ||
'//its.map.baidu.com:8002/traffic/TrafficTileService?time={time}&label={labelStyle}&v=016&level={z}&x={x}&y={y}&scaler=2' | ||
} | ||
class BaiduImageryProvider { | ||
constructor(options = {}) { | ||
this._url = | ||
options.style === 'img' | ||
? IMG_URL | ||
: options.style === 'vec' | ||
? VEC_URL | ||
: CUSTOM_URL | ||
options.url || | ||
[ | ||
options.protocol || '', | ||
TILE_URL[options.style] || TILE_URL['custom'] | ||
].join('') | ||
this._tileWidth = 256 | ||
@@ -55,2 +56,3 @@ this._tileHeight = 256 | ||
this._style = options.style || 'normal' | ||
this._errorEvent = new Cesium.Event() | ||
} | ||
@@ -124,2 +126,6 @@ | ||
get errorEvent() { | ||
return this._errorEvent | ||
} | ||
get credit() { | ||
@@ -126,0 +132,0 @@ return this._credit |
@@ -6,22 +6,18 @@ /** | ||
const ELEC_URL = | ||
'http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile' | ||
const TILE_URL = { | ||
img: '//mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali', | ||
elec: | ||
'//mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile', | ||
ter: | ||
'//mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile' | ||
} | ||
const IMG_URL = | ||
'http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali' | ||
const TER_URL = | ||
'http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile' | ||
class GoogleImageryProvider extends Cesium.UrlTemplateImageryProvider { | ||
constructor(options = {}) { | ||
options['url'] = | ||
options.style === 'img' | ||
? IMG_URL | ||
: options.style === 'ter' | ||
? TER_URL | ||
: ELEC_URL | ||
if (!options.subdomains || !options.subdomains.length) { | ||
options['subdomains'] = ['1', '2', '3'] | ||
} | ||
options.url || | ||
[ | ||
options.protocol || '', | ||
TILE_URL[options.style] || TILE_URL['elec'] | ||
].join('') | ||
options['subdomains'] = options.subdomains || ['1', '2', '3'] | ||
super(options) | ||
@@ -28,0 +24,0 @@ } |
@@ -7,3 +7,3 @@ /** | ||
const MAP_URL = | ||
'https://t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}' | ||
'//t{s}.tianditu.gov.cn/DataServer?T={style}_c&x={x}&y={y}&l={z}&tk={key}' | ||
@@ -13,8 +13,10 @@ class TdtImageryProvider extends Cesium.UrlTemplateImageryProvider { | ||
super({ | ||
url: MAP_URL.replace(/\{style\}/g, options.style || 'vec').replace( | ||
/\{key\}/g, | ||
options.key || '' | ||
), | ||
url: [ | ||
options.protocol || '', | ||
MAP_URL.replace(/\{style\}/g, options.style || 'vec').replace( | ||
/\{key\}/g, | ||
options.key || '' | ||
) | ||
].join(''), | ||
subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], | ||
tilingScheme: new Cesium.WebMercatorTilingScheme(), | ||
maximumLevel: 18 | ||
@@ -21,0 +23,0 @@ }) |
@@ -6,11 +6,17 @@ /** | ||
const IMG_URL = | ||
'https://p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400' | ||
const TILE_URL = { | ||
img: | ||
'//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=400', | ||
elec: | ||
'//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347' | ||
} | ||
const ELEC_URL = | ||
'https://rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid={style}&scene=0&version=347' | ||
class TencentImageryProvider extends Cesium.UrlTemplateImageryProvider { | ||
constructor(options = {}) { | ||
let url = options.style === 'img' ? IMG_URL : ELEC_URL | ||
let url = | ||
options.url || | ||
[ | ||
options.protocol || '', | ||
TILE_URL[options.style] || TILE_URL['elec'] | ||
].join('') | ||
options['url'] = url.replace('{style}', options.style || 1) | ||
@@ -17,0 +23,0 @@ if (!options.subdomains || !options.subdomains.length) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66756
25
1080
105