Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dvgis/cesium-map

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dvgis/cesium-map - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

src/imagery/projection/BD09Projection.js

2

dist/cesium.map.min.js

@@ -1,1 +0,1 @@

!function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function i(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}var s=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],f=[75,60,45,30,15,0],h=[[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]],y=[[-.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(){n(this,t),this.isWgs84=!1}return o(t,[{key:"getDistanceByMC",value:function(t,e){if(!t||!e)return 0;if(!(t=this.convertMC2LL(t)))return 0;var n=this.toRadians(t.lng),r=this.toRadians(t.lat);if(!(e=this.convertMC2LL(e)))return 0;var o=this.toRadians(e.lng),a=this.toRadians(e.lat);return this.getDistance(n,o,r,a)}},{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 n=this.toRadians(t.lng),r=this.toRadians(t.lat),o=this.toRadians(e.lng),a=this.toRadians(e.lat);return this.getDistance(n,o,r,a)}},{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 n=t.lat/20037508.34*180;return e.lat=180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2),{lng:e.lng.toFixed(6),lat:e.lat.toFixed(6)}}Math.abs(t.lng);for(var r=Math.abs(t.lat),o=void 0,a=0;a<s.length;a++)if(r>=s[a]){o=h[a];break}return{lng:(e=this.convertor(t,o)).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={},n=6378137;e.lng=t.lng*Math.PI/180*n;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 o=t.lat,a=void 0,i=0;i<f.length;i++)if(o>=f[i]){a=y[i];break}if(!a)for(var l=0;l<f.length;l++)if(o<=-f[l]){a=y[l];break}var c=this.convertor(t,a);return{lng:parseFloat(c.lng.toFixed(2)),lat:parseFloat(c.lat.toFixed(2))}}},{key:"convertor",value:function(t,e){if(!t||!e)return{lng:0,lat:0};var n=e[0]+e[1]*Math.abs(t.lng),r=Math.abs(t.lat)/e[9],o=e[2]+e[3]*r+e[4]*r*r+e[5]*r*r*r+e[6]*r*r*r*r+e[7]*r*r*r*r*r+e[8]*r*r*r*r*r*r;return{lng:n*=t.lng<0?-1:1,lat:o*=t.lat<0?-1:1}}},{key:"getDistance",value:function(t,e,n,r){return 6370996.81*Math.acos(Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*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,n){return null!=e&&(t=Math.max(t,e)),null!=n&&(t=Math.min(t,n)),t}},{key:"getLoop",value:function(t,e,n){for(;t>n;)t-=n-e;for(;t<e;)t+=n-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,n,r){if(t){t=this.lngLatToMercator(t);var o=this.getZoomUnits(e);return{x:Math.round((t.lng-n.lng)/o+r.width/2),y:Math.round((n.lat-t.lat)/o+r.height/2)}}}},{key:"pixelToPoint",value:function(t,e,n,r){if(t){var o=this.getZoomUnits(e),a={lng:n.lng+o*(t.x-r.width/2),lat:n.lat-o*(t.y-r.height/2)};return this.mercatorToLngLat(a)}}},{key:"getZoomUnits",value:function(t){return Math.pow(2,18-t)}}]),t}(),g=52.35987755982988,p=3.141592653589793,m=6378245,d=.006693421622965943,M=function(){function t(){n(this,t)}return o(t,null,[{key:"BD09ToGCJ02",value:function(t,e){var n=+t-.0065,r=+e-.006,o=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*g),a=Math.atan2(r,n)-3e-6*Math.cos(n*g);return[o*Math.cos(a),o*Math.sin(a)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var n=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*g),r=Math.atan2(e,t)+3e-6*Math.cos(t*g);return[n*Math.cos(r)+.0065,n*Math.sin(r)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var n=this.delta(t,e);return[t+n[0],e+n[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var n=this.delta(t,e);return[2*t-(t+n[0]),2*e-(e+n[1])]}},{key:"delta",value:function(t,e){var n=this.transformLng(t-105,e-35),r=this.transformLat(t-105,e-35),o=e/180*p,a=Math.sin(o);a=1-d*a*a;var i=Math.sqrt(a);return[n=180*n/(m/i*Math.cos(o)*p),r=180*r/(m*(1-d)/(a*i)*p)]}},{key:"transformLng",value:function(t,e){var n=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*p)+20*Math.sin(2*t*p))/3,n+=2*(20*Math.sin(t*p)+40*Math.sin(t/3*p))/3,n+=2*(150*Math.sin(t/12*p)+300*Math.sin(t/30*p))/3}},{key:"transformLat",value:function(t,e){var n=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*p)+20*Math.sin(2*t*p))/3,n+=2*(20*Math.sin(e*p)+40*Math.sin(e/3*p))/3,n+=2*(160*Math.sin(e/12*p)+320*Math.sin(e*p/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 b(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var x=function(t){i(a,t);var r=b(a);function a(t){var o;n(this,a),o=r.call(this,t);var i=new v;return o._projection.project=function(t,n){return n=n||{},n=M.WGS84ToGCJ02(e.Math.toDegrees(t.longitude),e.Math.toDegrees(t.latitude)),(n=M.GCJ02ToBD09(n[0],n[1]))[0]=Math.min(n[0],180),n[0]=Math.max(n[0],-180),n[1]=Math.min(n[1],74.000022),n[1]=Math.max(n[1],-71.988531),n=i.lngLatToPoint({lng:n[0],lat:n[1]}),new e.Cartesian2(n.x,n.y)},o._projection.unproject=function(t,n){return n=n||{},n=i.mercatorToLngLat({lng:t.x,lat:t.y}),n=M.BD09ToGCJ02(n.lng,n.lat),n=M.GCJ02ToWGS84(n[0],n[1]),new e.Cartographic(e.Math.toRadians(n[0]),e.Math.toRadians(n[1]))},o.resolutions=t.resolutions||[],o}return o(a,[{key:"tileXYToNativeRectangle",value:function(t,n,r,o){var a=this.resolutions[r],i=t*a,l=(t+1)*a,c=(1+(n=-n))*a,u=n*a;return e.defined(o)?(o.west=i,o.south=u,o.east=l,o.north=c,o):new e.Rectangle(i,u,l,c)}},{key:"positionToTileXY",value:function(t,n,r){var o=this._rectangle;if(e.Rectangle.contains(o,t)){var a=this._projection.project(t);if(e.defined(a)){var i=this.resolutions[n],l=Math.floor(a.x/i),c=-Math.floor(a.y/i);return e.defined(r)?(r.x=l,r.y=c,r):new e.Cartesian2(l,c)}}}}]),a}(e.WebMercatorTilingScheme);function R(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var 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"},T=function(t){i(a,t);var r=R(a);function a(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n(this,a),o.url=o.url||[o.protocol||"",w[o.style]||w.custom].join(""),"WGS84"===o.crs){for(var i=[],l=0;l<19;l++)i[l]=256*Math.pow(2,18-l);o.tilingScheme=new x({resolutions:i,rectangleSouthwestInMeters:new e.Cartesian2(-20037726.37,-12474104.17),rectangleNortheastInMeters:new e.Cartesian2(20037726.37,12474104.17)})}else o.tilingScheme=new e.WebMercatorTilingScheme({rectangleSouthwestInMeters:new e.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new e.Cartesian2(33554054,33746824)});return o.maximumLevel=18,(t=r.call(this,o))._rectangle=t._tilingScheme.rectangle,t._url=o.url,t._crs=o.crs||"BD09",t._style=o.style||"normal",t}return o(a,[{key:"requestImage",value:function(t,n,r){var o=this._tilingScheme.getNumberOfXTilesAtLevel(r),a=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(t)).replace("{y}",String(-n)):i.replace("{x}",String(t-o/2)).replace("{y}",String(a/2-n-1)),e.ImageryProvider.loadImage(this,i)}}]),a}(e.UrlTemplateImageryProvider);function L(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var P=function(t){i(a,t);var r=L(a);function a(t){var o;n(this,a),o=r.call(this,t);var i=new e.WebMercatorProjection;return o._projection.project=function(t,n){return n=M.WGS84ToGCJ02(e.Math.toDegrees(t.longitude),e.Math.toDegrees(t.latitude)),n=i.project(new e.Cartographic(e.Math.toRadians(n[0]),e.Math.toRadians(n[1]))),new e.Cartesian2(n.x,n.y)},o._projection.unproject=function(t,n){var r=i.unproject(t);return n=M.GCJ02ToWGS84(e.Math.toDegrees(r.longitude),e.Math.toDegrees(r.latitude)),new e.Cartographic(e.Math.toRadians(n[0]),e.Math.toRadians(n[1]))},o}return o(a)}(e.WebMercatorTilingScheme);function k(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var C={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}"},S=function(t){i(r,t);var e=k(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),t.url=t.url||[t.protocol||"",C[t.style]||C.elec].join(""),t.subdomains&&t.subdomains.length||(t.subdomains=["01","02","03","04"]),"WGS84"===t.crs&&(t.tilingScheme=new P),e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);function _(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}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"},j=function(t){i(r,t);var e=_(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,r);var o=t.url||[t.protocol||"",z[t.style]||z.elec].join("");return t.url=o.replace("{style}",t.style||"1"),t.subdomains&&t.subdomains.length||(t.subdomains=["0","1","2"]),"img"===t.style&&(t.customTags={sx:function(t,e,n,r){return e>>4},sy:function(t,e,n,r){return(1<<r)-n>>4}}),e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);function I(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var B=function(t){i(r,t);var e=I(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),e.call(this,{url:[t.protocol||"","//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}".replace(/\{style\}/g,t.style||"vec").replace(/\{key\}/g,t.key||"")].join(""),subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:18})}return o(r)}(e.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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var O={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"},D=function(t){i(r,t);var e=G(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),t.url=t.url||[t.protocol||"",O[t.style]||O.elec].join(""),t.subdomains=t.subdomains||["1","2","3"],e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);function W(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}var F=function(t){i(r,t);var e=W(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),t.url=t.url||[t.protocol||"","//tiles{s}.geovisearth.com/base/v1/{style}/{z}/{x}/{y}?format={format}&tmsIds=w&token={key}".replace(/\{style\}/g,t.style||"vec").replace(/\{format\}/g,t.format||"png").replace(/\{key\}/g,t.key||"")].join(""),t.subdomains=t.subdomains||["1","2","3"],e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);t.AmapImageryProvider=S,t.BaiduImageryProvider=T,t.GeoVisImageryProvider=F,t.GoogleImageryProvider=D,t.TdtImageryProvider=B,t.TencentImageryProvider=j}(this.window=this.window||{},Cesium);
!function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function i(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}var s=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],f=[75,60,45,30,15,0],h=[[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]],y=[[-.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]],g=function(){function t(){n(this,t),this.isWgs84=!1}return o(t,[{key:"getDistanceByMC",value:function(t,e){if(!t||!e)return 0;if(!(t=this.convertMC2LL(t)))return 0;var n=this.toRadians(t.lng),r=this.toRadians(t.lat);if(!(e=this.convertMC2LL(e)))return 0;var o=this.toRadians(e.lng),a=this.toRadians(e.lat);return this.getDistance(n,o,r,a)}},{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 n=this.toRadians(t.lng),r=this.toRadians(t.lat),o=this.toRadians(e.lng),a=this.toRadians(e.lat);return this.getDistance(n,o,r,a)}},{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 n=t.lat/20037508.34*180;return e.lat=180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2),{lng:e.lng.toFixed(6),lat:e.lat.toFixed(6)}}Math.abs(t.lng);for(var r=Math.abs(t.lat),o=void 0,a=0;a<s.length;a++)if(r>=s[a]){o=h[a];break}return{lng:(e=this.convertor(t,o)).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={},n=6378137;e.lng=t.lng*Math.PI/180*n;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 o=t.lat,a=void 0,i=0;i<f.length;i++)if(o>=f[i]){a=y[i];break}if(!a)for(var c=0;c<f.length;c++)if(o<=-f[c]){a=y[c];break}var l=this.convertor(t,a);return{lng:parseFloat(l.lng.toFixed(2)),lat:parseFloat(l.lat.toFixed(2))}}},{key:"convertor",value:function(t,e){if(!t||!e)return{lng:0,lat:0};var n=e[0]+e[1]*Math.abs(t.lng),r=Math.abs(t.lat)/e[9],o=e[2]+e[3]*r+e[4]*r*r+e[5]*r*r*r+e[6]*r*r*r*r+e[7]*r*r*r*r*r+e[8]*r*r*r*r*r*r;return{lng:n*=t.lng<0?-1:1,lat:o*=t.lat<0?-1:1}}},{key:"getDistance",value:function(t,e,n,r){return 6370996.81*Math.acos(Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*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,n){return null!=e&&(t=Math.max(t,e)),null!=n&&(t=Math.min(t,n)),t}},{key:"getLoop",value:function(t,e,n){for(;t>n;)t-=n-e;for(;t<e;)t+=n-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,n,r){if(t){t=this.lngLatToMercator(t);var o=this.getZoomUnits(e);return{x:Math.round((t.lng-n.lng)/o+r.width/2),y:Math.round((n.lat-t.lat)/o+r.height/2)}}}},{key:"pixelToPoint",value:function(t,e,n,r){if(t){var o=this.getZoomUnits(e),a={lng:n.lng+o*(t.x-r.width/2),lat:n.lat-o*(t.y-r.height/2)};return this.mercatorToLngLat(a)}}},{key:"getZoomUnits",value:function(t){return Math.pow(2,18-t)}}]),t}(),v=52.35987755982988,p=3.141592653589793,m=6378245,d=.006693421622965943,M=function(){function t(){n(this,t)}return o(t,null,[{key:"BD09ToGCJ02",value:function(t,e){var n=+t-.0065,r=+e-.006,o=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*v),a=Math.atan2(r,n)-3e-6*Math.cos(n*v);return[o*Math.cos(a),o*Math.sin(a)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var n=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*v),r=Math.atan2(e,t)+3e-6*Math.cos(t*v);return[n*Math.cos(r)+.0065,n*Math.sin(r)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var n=this.delta(t,e);return[t+n[0],e+n[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var n=this.delta(t,e);return[2*t-(t+n[0]),2*e-(e+n[1])]}},{key:"delta",value:function(t,e){var n=this.transformLng(t-105,e-35),r=this.transformLat(t-105,e-35),o=e/180*p,a=Math.sin(o);a=1-d*a*a;var i=Math.sqrt(a);return[n=180*n/(m/i*Math.cos(o)*p),r=180*r/(m*(1-d)/(a*i)*p)]}},{key:"transformLng",value:function(t,e){var n=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*p)+20*Math.sin(2*t*p))/3,n+=2*(20*Math.sin(t*p)+40*Math.sin(t/3*p))/3,n+=2*(150*Math.sin(t/12*p)+300*Math.sin(t/30*p))/3}},{key:"transformLat",value:function(t,e){var n=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*p)+20*Math.sin(2*t*p))/3,n+=2*(20*Math.sin(e*p)+40*Math.sin(e/3*p))/3,n+=2*(160*Math.sin(e/12*p)+320*Math.sin(e*p/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 x(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var b=function(t){i(a,t);var r=x(a);function a(t){var o;n(this,a),o=r.call(this,t);var i=new g;return o._projection.project=function(t,n){return n=n||{},n=M.WGS84ToGCJ02(e.Math.toDegrees(t.longitude),e.Math.toDegrees(t.latitude)),(n=M.GCJ02ToBD09(n[0],n[1]))[0]=Math.min(n[0],180),n[0]=Math.max(n[0],-180),n[1]=Math.min(n[1],74.000022),n[1]=Math.max(n[1],-71.988531),n=i.lngLatToPoint({lng:n[0],lat:n[1]}),new e.Cartesian2(n.x,n.y)},o._projection.unproject=function(t,n){return n=n||{},n=i.mercatorToLngLat({lng:t.x,lat:t.y}),n=M.BD09ToGCJ02(n.lng,n.lat),n=M.GCJ02ToWGS84(n[0],n[1]),new e.Cartographic(e.Math.toRadians(n[0]),e.Math.toRadians(n[1]))},o.resolutions=t.resolutions||[],o}return o(a,[{key:"tileXYToNativeRectangle",value:function(t,n,r,o){var a=this.resolutions[r],i=t*a,c=(t+1)*a,l=(1+(n=-n))*a,u=n*a;return e.defined(o)?(o.west=i,o.south=u,o.east=c,o.north=l,o):new e.Rectangle(i,u,c,l)}},{key:"positionToTileXY",value:function(t,n,r){var o=this._rectangle;if(e.Rectangle.contains(o,t)){var a=this._projection.project(t);if(e.defined(a)){var i=this.resolutions[n],c=Math.floor(a.x/i),l=-Math.floor(a.y/i);return e.defined(r)?(r.x=c,r.y=l,r):new e.Cartesian2(c,l)}}}}]),a}(e.WebMercatorTilingScheme);function R(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var 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"},T=function(t){i(a,t);var r=R(a);function a(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n(this,a),o.url=o.url||[o.protocol||"",w[o.style]||w.custom].join(""),"WGS84"===o.crs){for(var i=[],c=0;c<19;c++)i[c]=256*Math.pow(2,18-c);o.tilingScheme=new b({resolutions:i,rectangleSouthwestInMeters:new e.Cartesian2(-20037726.37,-12474104.17),rectangleNortheastInMeters:new e.Cartesian2(20037726.37,12474104.17)})}else o.tilingScheme=new e.WebMercatorTilingScheme({rectangleSouthwestInMeters:new e.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new e.Cartesian2(33554054,33746824)});return o.maximumLevel=18,(t=r.call(this,o))._rectangle=t._tilingScheme.rectangle,t._url=o.url,t._crs=o.crs||"BD09",t._style=o.style||"normal",t}return o(a,[{key:"requestImage",value:function(t,n,r){var o=this._tilingScheme.getNumberOfXTilesAtLevel(r),a=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(t)).replace("{y}",String(-n)):i.replace("{x}",String(t-o/2)).replace("{y}",String(a/2-n-1)),e.ImageryProvider.loadImage(this,i)}}]),a}(e.UrlTemplateImageryProvider);function L(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var P=function(t){i(a,t);var r=L(a);function a(t){var o;n(this,a),o=r.call(this,t);var i=new e.WebMercatorProjection;return o._projection.project=function(t,n){return n=M.WGS84ToGCJ02(e.Math.toDegrees(t.longitude),e.Math.toDegrees(t.latitude)),n=i.project(new e.Cartographic(e.Math.toRadians(n[0]),e.Math.toRadians(n[1]))),new e.Cartesian2(n.x,n.y)},o._projection.unproject=function(t,n){var r=i.unproject(t);return n=M.GCJ02ToWGS84(e.Math.toDegrees(r.longitude),e.Math.toDegrees(r.latitude)),new e.Cartographic(e.Math.toRadians(n[0]),e.Math.toRadians(n[1]))},o}return o(a)}(e.WebMercatorTilingScheme);function k(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}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}"},_=function(t){i(r,t);var e=k(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),t.url=t.url||[t.protocol||"",S[t.style]||S.elec].join(""),t.subdomains&&t.subdomains.length||(t.subdomains=["01","02","03","04"]),"WGS84"===t.crs&&(t.tilingScheme=new P),e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);function z(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var j={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"},C=function(t){i(r,t);var e=z(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,r);var o=t.url||[t.protocol||"",j[t.style]||j.elec].join("");return t.url=o.replace("{style}",t.style||"1"),t.subdomains&&t.subdomains.length||(t.subdomains=["0","1","2"]),"img"===t.style&&(t.customTags={sx:function(t,e,n,r){return e>>4},sy:function(t,e,n,r){return(1<<r)-n>>4}}),e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);function I(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var B=function(t){i(r,t);var e=I(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),e.call(this,{url:[t.protocol||"","//t{s}.tianditu.gov.cn/DataServer?T={style}_w&x={x}&y={y}&l={z}&tk={key}".replace(/\{style\}/g,t.style||"vec").replace(/\{key\}/g,t.key||"")].join(""),subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:18})}return o(r)}(e.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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var G={img:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}",elec:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=m&x={x}&y={y}&z={z}",cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&x={x}&y={y}&z={z}",ter:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&x={x}&y={y}&z={z}",img_cva:"https://gac-geo.googlecnapps.cn/maps/vt?lyrs=y&x={x}&y={y}&z={z}"},D=function(t){i(r,t);var e=O(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),t.url=t.url||[t.protocol||"",G[t.style]||G.elec].join(""),"WGS84"===t.crs&&(t.tilingScheme=new P),e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);function W(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 n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}var F=function(t){i(r,t);var e=W(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,r),t.url=t.url||[t.protocol||"","//tiles{s}.geovisearth.com/base/v1/{style}/{z}/{x}/{y}?format={format}&tmsIds=w&token={key}".replace(/\{style\}/g,t.style||"vec").replace(/\{format\}/g,t.format||"png").replace(/\{key\}/g,t.key||"")].join(""),t.subdomains=t.subdomains||["1","2","3"],e.call(this,t)}return o(r)}(e.UrlTemplateImageryProvider);t.AmapImageryProvider=_,t.BaiduImageryProvider=T,t.GeoVisImageryProvider=F,t.GoogleImageryProvider=D,t.TdtImageryProvider=B,t.TencentImageryProvider=C}(this.window=this.window||{},Cesium);
{
"name": "@dvgis/cesium-map",
"version": "3.0.1",
"version": "3.1.0",
"repository": "https://github.com/dvgis/cesium-map.git",

@@ -5,0 +5,0 @@ "homepage": "https://www.dvgis.cn",

@@ -52,3 +52,3 @@ # cesium-map

```js
```js
var options = {

@@ -76,7 +76,8 @@ style: 'normal', // style: img、vec、normal、dark

> 谷歌地图(已被墙)
> 谷歌地图
```js
var options = {
style: 'img' //style: img、elec、ter
style: 'elec',//style: img、elec、ter,cva,img_cva
crs: 'WGS84' // 使用84坐标系,默认为:GCJ02, img除外
}

@@ -83,0 +84,0 @@ viewer.imageryLayers.add(new Cesium.ImageryLayer( new GoogleImageryProvider(options)))

@@ -6,3 +6,3 @@ /**

import AmapMercatorTilingScheme from './AmapMercatorTilingScheme'
import GCJ02TilingScheme from '../tiling-scheme/GCJ02TilingScheme'
import { UrlTemplateImageryProvider } from '@cesium/engine'

@@ -28,3 +28,3 @@

if (options.crs === 'WGS84') {
options['tilingScheme'] = new AmapMercatorTilingScheme()
options['tilingScheme'] = new GCJ02TilingScheme()
}

@@ -31,0 +31,0 @@ super(options)

@@ -9,3 +9,2 @@ /**

WebMercatorTilingScheme,
DeveloperError,
ImageryProvider,

@@ -15,3 +14,3 @@ UrlTemplateImageryProvider,

import BaiduMercatorTilingScheme from './BaiduMercatorTilingScheme'
import BD09TilingScheme from '../tiling-scheme/BD09TilingScheme'

@@ -40,3 +39,3 @@ const TILE_URL = {

}
options['tilingScheme'] = new BaiduMercatorTilingScheme({
options['tilingScheme'] = new BD09TilingScheme({
resolutions,

@@ -43,0 +42,0 @@ rectangleSouthwestInMeters: new Cartesian2(-20037726.37, -12474104.17),

@@ -7,7 +7,10 @@ /**

import { UrlTemplateImageryProvider } from '@cesium/engine'
import GCJ02TilingScheme from '../tiling-scheme/GCJ02TilingScheme'
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',
img: 'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s&x={x}&y={y}&z={z}',
elec: 'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=m&x={x}&y={y}&z={z}',
cva: 'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=h&x={x}&y={y}&z={z}',
ter: 'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=t@131,r&x={x}&y={y}&z={z}',
img_cva: 'https://gac-geo.googlecnapps.cn/maps/vt?lyrs=y&x={x}&y={y}&z={z}',
}

@@ -23,3 +26,5 @@

].join('')
options['subdomains'] = options.subdomains || ['1', '2', '3']
if (options.crs === 'WGS84') {
options['tilingScheme'] = new GCJ02TilingScheme()
}
super(options)

@@ -26,0 +31,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc