ol-cesium
Version:
OpenLayers Cesium integration library
1 lines • 63.4 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ol/proj.js"),require("ol/Observable.js"),require("ol/layer/Group.js"),require("ol/source/Vector.js"),require("ol/layer/Image.js"),require("ol/source/Cluster.js"),require("ol/layer/Vector.js"),require("ol/geom/Geometry.js"),require("ol/style/Icon.js"),require("ol/extent.js"),require("ol/geom/Point.js"),require("ol/easing.js"),require("ol/layer/Tile.js"),require("ol/source/ImageStatic"),require("ol/source/ImageWMS.js"),require("ol/source/TileImage.js"),require("ol/source/TileWMS.js"),require("ol/source/Image.js"),require("ol/layer/Layer.js"),require("ol/layer/VectorTile.js"),require("ol/geom/Polygon.js"),require("ol/geom/SimpleGeometry.js"),require("ol/Overlay.js")):"function"==typeof define&&define.amd?define(["ol/proj.js","ol/Observable.js","ol/layer/Group.js","ol/source/Vector.js","ol/layer/Image.js","ol/source/Cluster.js","ol/layer/Vector.js","ol/geom/Geometry.js","ol/style/Icon.js","ol/extent.js","ol/geom/Point.js","ol/easing.js","ol/layer/Tile.js","ol/source/ImageStatic","ol/source/ImageWMS.js","ol/source/TileImage.js","ol/source/TileWMS.js","ol/source/Image.js","ol/layer/Layer.js","ol/layer/VectorTile.js","ol/geom/Polygon.js","ol/geom/SimpleGeometry.js","ol/Overlay.js"],t):"object"==typeof exports?exports.olcs=t(require("ol/proj.js"),require("ol/Observable.js"),require("ol/layer/Group.js"),require("ol/source/Vector.js"),require("ol/layer/Image.js"),require("ol/source/Cluster.js"),require("ol/layer/Vector.js"),require("ol/geom/Geometry.js"),require("ol/style/Icon.js"),require("ol/extent.js"),require("ol/geom/Point.js"),require("ol/easing.js"),require("ol/layer/Tile.js"),require("ol/source/ImageStatic"),require("ol/source/ImageWMS.js"),require("ol/source/TileImage.js"),require("ol/source/TileWMS.js"),require("ol/source/Image.js"),require("ol/layer/Layer.js"),require("ol/layer/VectorTile.js"),require("ol/geom/Polygon.js"),require("ol/geom/SimpleGeometry.js"),require("ol/Overlay.js")):e.olcs=t(e["ol/proj.js"],e["ol/Observable.js"],e["ol/layer/Group.js"],e["ol/source/Vector.js"],e["ol/layer/Image.js"],e["ol/source/Cluster.js"],e["ol/layer/Vector.js"],e["ol/geom/Geometry.js"],e["ol/style/Icon.js"],e["ol/extent.js"],e["ol/geom/Point.js"],e["ol/easing.js"],e["ol/layer/Tile.js"],e["ol/source/ImageStatic"],e["ol/source/ImageWMS.js"],e["ol/source/TileImage.js"],e["ol/source/TileWMS.js"],e["ol/source/Image.js"],e["ol/layer/Layer.js"],e["ol/layer/VectorTile.js"],e["ol/geom/Polygon.js"],e["ol/geom/SimpleGeometry.js"],e["ol/Overlay.js"])}(window,function(e,t,i,r,n,o,a,s,u,l,c,h,m,d,g,f,p,v,y,C,_,b,S){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=23)}([function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=i},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t){e.exports=s},function(e,t){e.exports=u},function(e,t){e.exports=l},function(e,t){e.exports=c},function(e,t){e.exports=h},function(e,t){e.exports=m},function(e,t){e.exports=d},function(e,t){e.exports=g},function(e,t){e.exports=f},function(e,t){e.exports=p},function(e,t){e.exports=v},function(e,t){e.exports=y},function(e,t){e.exports=C},function(e,t){e.exports=_},function(e,t){e.exports=b},function(e,t){e.exports=S},function(e,t,i){"use strict";i.r(t);i(10);var r=i(0),n={};function o(e,t,i){return e.on(t,i)}n.obj=function(e){return e},n.supportsImageRenderingPixelatedResult_=void 0,n.imageRenderingValueResult_=void 0,n.supportsImageRenderingPixelated=function(){if(void 0===n.supportsImageRenderingPixelatedResult_){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges; image-rendering: pixelated;");var t=e.style.imageRendering;n.supportsImageRenderingPixelatedResult_=!!t,n.supportsImageRenderingPixelatedResult_&&(n.imageRenderingValueResult_=t)}return n.supportsImageRenderingPixelatedResult_},n.imageRenderingValue=function(){return n.supportsImageRenderingPixelated(),n.imageRenderingValueResult_||""},n.getSourceProjection=function(e){return e.get("olcs.projection")||e.getProjection()};var a=0;function s(e){return e.olcs_uid||(e.olcs_uid=++a)}function u(e){var t=Cesium.GroundPolylinePrimitive;return t&&t.isSupported(e)}var l=n,c=i(11),h=i(12),m=i.n(h),d=i(4),g=i.n(d),f=i(13),p=i.n(f),v=i(14),y=i.n(v),C=i(15),_=i.n(C),b=i(16),S=i.n(b),w=i(17),T=function(){function e(e,t,i){var r=this;this.source_=t,this.projection_=null,this.fallbackProj_=i||null,this.ready_=!1,this.tilingScheme_=null,this.rectangle_=null,this.map_=e;var n=this.source_.get("olcs.proxy");n&&("function"==typeof n?this.proxy_={getURL:n}:"string"==typeof n&&(this.proxy_=new Cesium.DefaultProxy(n))),this.errorEvent_=new Cesium.Event,this.emptyCanvas_=document.createElement("canvas"),this.emptyCanvas_.width=1,this.emptyCanvas_.height=1,this.source_.on("change",function(e){r.handleSourceChanged_()}),this.handleSourceChanged_()}var t=e.prototype;return t.handleSourceChanged_=function(e){if(!this.ready_&&"ready"==this.source_.getState()){if(this.projection_=l.getSourceProjection(this.source_)||this.fallbackProj_,this.projection_==Object(r.get)("EPSG:4326"))this.tilingScheme_=new Cesium.GeographicTilingScheme;else{if(this.projection_!=Object(r.get)("EPSG:3857"))return;this.tilingScheme_=new Cesium.WebMercatorTilingScheme}this.rectangle_=this.tilingScheme_.rectangle,this.ready_=!0}},t.getTileCredits=function(e,t,i){var r=this.map_.getView().calculateExtent(this.map_.getSize()),n=this.map_.getView().getCenter(),o={viewState:{zoom:this.tilingScheme_ instanceof Cesium.GeographicTilingScheme?i+1:i,center:n},extent:r},a=this.source_.getAttributions();if(!a)return[];var s=a(o);return Array.isArray(s)||(s=[s]),s.map(function(e){return new Cesium.Credit(e,!0)})},t.requestImage=function(e,t,i){var r=this.source_.getTileUrlFunction();if(r&&this.projection_){var n=this.tilingScheme_ instanceof Cesium.GeographicTilingScheme?i+1:i,o=-t-1,a=r.call(this.source_,[n,e,o],1,this.projection_);return this.proxy_&&(a=this.proxy_.getURL(a)),a?Cesium.ImageryProvider.loadImage(this,a):this.emptyCanvas_}return this.emptyCanvas_},e}();Object.defineProperties(T.prototype,{ready:{get:function(){return this.ready_}},rectangle:{get:function(){return this.rectangle_}},tileWidth:{get:function(){var e=this.source_.getTileGrid();return e?Array.isArray(e.getTileSize(0))?e.getTileSize(0)[0]:e.getTileSize(0):256}},tileHeight:{get:function(){var e=this.source_.getTileGrid();return e?Array.isArray(e.getTileSize(0))?e.getTileSize(0)[1]:e.getTileSize(0):256}},maximumLevel:{get:function(){var e=this.source_.getTileGrid();return e?e.getMaxZoom():18}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this.tilingScheme_}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this.errorEvent_}},proxy:{get:function(){return this.proxy_}},hasAlphaChannel:{get:function(){return!0}},pickFeatures:{get:function(){}}});var P=T,L={computePixelSizeAtCoordinate:function(e,t){var i=e.camera,r=e.canvas,n=i.frustum,o=Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(i.position,t,new Cesium.Cartesian3)),a=new Cesium.Cartesian2;return n.getPixelDimensions(r.clientWidth,r.clientHeight,o,a)},computeBoundingBoxAtTarget:function(e,t,i){var r=L.computePixelSizeAtCoordinate(e,t),n=Cesium.Transforms.eastNorthUpToFixedFrame(t),o=Cesium.Matrix4.multiplyByPoint(n,new Cesium.Cartesian3(-r.x*i,-r.y*i,0),new Cesium.Cartesian3),a=Cesium.Matrix4.multiplyByPoint(n,new Cesium.Cartesian3(r.x*i,r.y*i,0),new Cesium.Cartesian3);return Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray([o,a])},applyHeightOffsetToGeometry:function(e,t){e.applyTransform(function(e,i,r){if(void 0!==r&&r>=3)for(var n=0;n<i.length;n+=r)i[n+2]=i[n+2]+t;return i})},createMatrixAtCoordinates:function(e,t,i,r){void 0===t&&(t=0),void 0===i&&(i=Cesium.Cartesian3.ZERO),void 0===r&&(r=new Cesium.Cartesian3(1,1,1));var n=L.ol4326CoordinateToCesiumCartesian(e),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),a=Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_Z,-t),s=Cesium.Matrix4.fromTranslationQuaternionRotationScale(i,a,r);return Cesium.Matrix4.multiply(o,s,new Cesium.Matrix4)},rotateAroundAxis:function(e,t,i,r,n){var o=Cesium.Math.clamp,a=Cesium.defaultValue,s=n||{},u=a(s.duration,500),l=a(s.easing,c.linear),h=s.callback,m=0,d=new Cesium.Matrix4,g=Date.now();window.requestAnimationFrame(function n(){var a=Date.now(),s=l(o((a-g)/u,0,1));e.transform.clone(d);var c=(s-m)*t;m=s,e.lookAtTransform(r),e.rotate(i,c),e.lookAtTransform(d),s<1?window.requestAnimationFrame(n):h&&h()})},setHeadingUsingBottomCenter:function(e,t,i,r){var n=e.camera,o=L.computeAngleToZenith(e,i),a=n.right,s=Cesium.Quaternion.fromAxisAngle(a,o),u=Cesium.Matrix3.fromQuaternion(s),l=new Cesium.Cartesian3;Cesium.Cartesian3.subtract(n.position,i,l);var c=new Cesium.Cartesian3;Cesium.Matrix3.multiplyByVector(u,l,c),Cesium.Cartesian3.add(c,i,c);var h=Cesium.Matrix4.fromTranslation(c);(0,L.rotateAroundAxis)(n,t,c,h,r)},pickOnTerrainOrEllipsoid:function(e,t){var i=e.camera.getPickRay(t);return e.globe.pick(i,e)||e.camera.pickEllipsoid(t)},pickBottomPoint:function(e){var t=e.canvas,i=new Cesium.Cartesian2(t.clientWidth/2,t.clientHeight);return L.pickOnTerrainOrEllipsoid(e,i)},pickCenterPoint:function(e){var t=e.canvas,i=new Cesium.Cartesian2(t.clientWidth/2,t.clientHeight/2);return L.pickOnTerrainOrEllipsoid(e,i)},computeSignedTiltAngleOnGlobe:function(e){var t=e.camera,i=new Cesium.Ray(t.position,t.direction),r=e.globe.pick(i,e);if(!r){var n=Cesium.Ellipsoid.WGS84,o=Cesium.IntersectionTests.rayEllipsoid(i,n);o&&(r=Cesium.Ray.getPoint(i,o.start))}if(r){var a=new Cesium.Cartesian3;Cesium.Ellipsoid.WGS84.geocentricSurfaceNormal(r,a);var s=(0,L.signedAngleBetween)(t.direction,a,t.right)-Math.PI;return Cesium.Math.convertLongitudeRange(s)}},bottomFovRay:function(e){var t=e.camera,i=t.frustum.fovy/2,r=t.direction,n=Cesium.Quaternion.fromAxisAngle(t.right,i),o=Cesium.Matrix3.fromQuaternion(n),a=new Cesium.Cartesian3;return Cesium.Matrix3.multiplyByVector(o,r,a),new Cesium.Ray(t.position,a)},signedAngleBetween:function(e,t,i){var r=new Cesium.Cartesian3,n=new Cesium.Cartesian3,o=new Cesium.Cartesian3;Cesium.Cartesian3.normalize(e,r),Cesium.Cartesian3.normalize(t,n),Cesium.Cartesian3.cross(r,n,o);var a=Cesium.Cartesian3.dot(r,n),s=Cesium.Cartesian3.magnitude(o),u=Cesium.Cartesian3.dot(i,o),l=Math.atan2(s,a);return u>=0?l:-l},computeAngleToZenith:function(e,t){var i=e.camera,r=i.frustum.fovy/2,n=L.bottomFovRay(e),o=Cesium.Cartesian3.clone(n.direction);Cesium.Cartesian3.negate(o,o);var a=new Cesium.Cartesian3;Cesium.Ellipsoid.WGS84.geocentricSurfaceNormal(t,a);var s=new Cesium.Cartesian3;return Cesium.Cartesian3.negate(i.right,s),L.signedAngleBetween(a,o,s)+r},extentToRectangle:function(e,t){if(e&&t){var i=Object(r.transformExtent)(e,t,"EPSG:4326");return Cesium.Rectangle.fromDegrees(i[0],i[1],i[2],i[3])}return null},tileLayerToImageryLayer:function(e,t,i){if(!(t instanceof m.a||t instanceof g.a))return null;var r=null,n=t.getSource();if(n instanceof y.a&&n.getUrl()&&n.getImageLoadFunction()===w.defaultImageLoadFunction){var o={"olcs.proxy":n.get("olcs.proxy"),"olcs.extent":n.get("olcs.extent"),"olcs.projection":n.get("olcs.projection"),"olcs.imagesource":n};(n=new S.a({url:n.getUrl(),attributions:n.getAttributions(),projection:n.getProjection(),params:n.getParams()})).setProperties(o)}if(n instanceof _.a){var a=l.getSourceProjection(n);if(a||(a=i),!L.isCesiumProjection(a))return null;r=new P(e,n,i)}else{if(!(n instanceof p.a))return null;var s=l.getSourceProjection(n);if(s||(s=i),!L.isCesiumProjection(s))return null;r=new Cesium.SingleTileImageryProvider({url:n.getUrl(),rectangle:new Cesium.Rectangle.fromDegrees(n.getImageExtent()[0],n.getImageExtent()[1],n.getImageExtent()[2],n.getImageExtent()[3])})}var u={},c=t.get("olcs.extent")||t.getExtent();return c&&(u.rectangle=L.extentToRectangle(c,i)),new Cesium.ImageryLayer(r,u)},updateCesiumLayerProperties:function(e,t){var i=1,r=!0;[e.layer].concat(e.parents).forEach(function(e){var t=e.getOpacity();void 0!==t&&(i*=t);var n=e.getVisible();void 0!==n&&(r&=n)}),t.alpha=i,t.show=r},ol4326CoordinateToCesiumCartesian:function(e){var t=e;return t.length>2?Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]):Cesium.Cartesian3.fromDegrees(t[0],t[1])},ol4326CoordinateArrayToCsCartesians:function(e){for(var t=L.ol4326CoordinateToCesiumCartesian,i=[],r=0;r<e.length;++r)i.push(t(e[r]));return i},olGeometryCloneTo4326:function(e,t){var i=Object(r.get)("EPSG:4326"),n=Object(r.get)(t);if(n!==i){var o=e.getProperties();(e=e.clone()).transform(n,i),e.setProperties(o)}return e},convertColorToCesium:function(e){if(e=e||"black",Array.isArray(e))return new Cesium.Color(Cesium.Color.byteToFloat(e[0]),Cesium.Color.byteToFloat(e[1]),Cesium.Color.byteToFloat(e[2]),e[3]);if("string"==typeof e)return Cesium.Color.fromCssColorString(e);if(e instanceof CanvasPattern||e instanceof CanvasGradient){var t=document.createElement("canvas"),i=t.getContext("2d");return t.width=t.height=256,i.fillStyle=e,i.fillRect(0,0,t.width,t.height),new Cesium.ImageMaterialProperty({image:t})}},convertUrlToCesium:function(e){var t="",i=/\{(\d|[a-z])-(\d|[a-z])\}/,r=i.exec(e);if(r){e=e.replace(i,"{s}");var n,o=r[1].charCodeAt(0),a=r[2].charCodeAt(0);for(n=o;n<=a;++n)t+=String.fromCharCode(n)}return{url:e,subdomains:t}},resetToNorthZenith:function(e,t){return new Promise(function(i,r){var n=t.camera,o=L.pickBottomPoint(t);if(o){var a=e.getView().getRotation();if(void 0!==a){var s=L.computeAngleToZenith(t,o);L.setHeadingUsingBottomCenter(t,a,o);var u=Cesium.Matrix4.fromTranslation(o),l=n.right,c={callback:function(){var t=e.getView();L.normalizeView(t),i()}};L.rotateAroundAxis(n,-s,l,u,c)}else r("The view is not initialized")}else r("Could not get bottom pivot")})},rotateAroundBottomCenter:function(e,t){return new Promise(function(i,r){var n=e.camera,o=L.pickBottomPoint(e);if(o){var a={callback:i},s=Cesium.Matrix4.fromTranslation(o),u=n.right;(0,L.rotateAroundAxis)(n,-t,u,s,a)}else r("could not get bottom pivot")})},normalizeView:function(e,t){void 0===t&&(t=0);var i=e.getResolution();e.setRotation(t),e.setResolution(e.constrainResolution(i))},isCesiumProjection:function(e){var t=e===Object(r.get)("EPSG:3857"),i=e===Object(r.get)("EPSG:4326");return t||i}},R=L,E=function(){function e(e){this.ol3d=e,this.scene_=e.getCesiumScene(),this.canvas_=this.scene_.canvas,this._boundNotifyRepaintRequired=this.notifyRepaintRequired.bind(this),this.repaintEventNames_=["mousemove","mousedown","mouseup","touchstart","touchend","touchmove","pointerdown","pointerup","pointermove","wheel"],this.enable()}var t=e.prototype;return t.enable=function(){this.scene_.requestRenderMode=!0,this.scene_.maximumRenderTimeChange=1e3;var e=this.repaintEventNames_,t=Array.isArray(e),i=0;for(e=t?e:e[Symbol.iterator]();;){var r;if(t){if(i>=e.length)break;r=e[i++]}else{if((i=e.next()).done)break;r=i.value}var n=r;this.canvas_.addEventListener(n,this._boundNotifyRepaintRequired,!1)}window.addEventListener("resize",this._boundNotifyRepaintRequired,!1),this.ol3d.getOlMap().getLayerGroup().on("change",this._boundNotifyRepaintRequired)},t.disable=function(){var e=this.repaintEventNames_,t=Array.isArray(e),i=0;for(e=t?e:e[Symbol.iterator]();;){var r;if(t){if(i>=e.length)break;r=e[i++]}else{if((i=e.next()).done)break;r=i.value}var n=r;this.canvas_.removeEventListener(n,this._boundNotifyRepaintRequired,!1)}window.removeEventListener("resize",this._boundNotifyRepaintRequired,!1),this.ol3d.getOlMap().getLayerGroup().un("change",this._boundNotifyRepaintRequired),this.scene_.requestRenderMode=!1},t.restartRenderLoop=function(){this.notifyRepaintRequired()},t.notifyRepaintRequired=function(){this.scene_.requestRender()},e}(),O=i(1),x=i.n(O);function j(e){return 180*e/Math.PI}function A(e){return e*Math.PI/180}var G=function(){function e(t,i){var r=this;this.scene_=t,this.cam_=t.camera,this.map_=i,this.view_=null,this.viewListenKey_=null,this.toLonLat_=e.identityProjection,this.fromLonLat_=e.identityProjection,this.tilt_=0,this.distance_=0,this.lastCameraViewMatrix_=null,this.viewUpdateInProgress_=!1,this.map_.on("change:view",function(e){r.setView_(r.map_.getView())}),this.setView_(this.map_.getView())}e.identityProjection=function(e,t,i){var r=i||e.length;if(t)for(var n=0;n<r;++n)t[n]=e[n];return e};var t=e.prototype;return t.setView_=function(t){var i=this;if(this.view_&&(Object(O.unByKey)(this.viewListenKey_),this.viewListenKey_=null),this.view_=t,t){var n=Object(r.getTransform)(t.getProjection(),"EPSG:4326"),o=Object(r.getTransform)("EPSG:4326",t.getProjection());this.toLonLat_=n,this.fromLonLat_=o,this.viewListenKey_=t.on("propertychange",function(e){return i.handleViewEvent_(e)}),this.readFromView()}else this.toLonLat_=e.identityProjection,this.fromLonLat_=e.identityProjection},t.handleViewEvent_=function(e){this.viewUpdateInProgress_||this.readFromView()},t.setHeading=function(e){this.view_&&this.view_.setRotation(e)},t.getHeading=function(){if(this.view_)return this.view_.getRotation()||0},t.setTilt=function(e){this.tilt_=e,this.updateCamera_()},t.getTilt=function(){return this.tilt_},t.setDistance=function(e){this.distance_=e,this.updateCamera_(),this.updateView()},t.getDistance=function(){return this.distance_},t.setCenter=function(e){this.view_&&this.view_.setCenter(e)},t.getCenter=function(){if(this.view_)return this.view_.getCenter()},t.setPosition=function(e){if(this.toLonLat_){var t=this.toLonLat_(e),i=new Cesium.Cartographic(A(t[0]),A(t[1]),this.getAltitude());this.cam_.setView({destination:Cesium.Ellipsoid.WGS84.cartographicToCartesian(i)}),this.updateView()}},t.getPosition=function(){if(this.fromLonLat_){var e=Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position);return this.fromLonLat_([j(e.longitude),j(e.latitude)])}},t.setAltitude=function(e){var t=Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position);t.height=e,this.cam_.position=Cesium.Ellipsoid.WGS84.cartographicToCartesian(t),this.updateView()},t.getAltitude=function(){return Cesium.Ellipsoid.WGS84.cartesianToCartographic(this.cam_.position).height},t.updateCamera_=function(){if(this.view_&&this.toLonLat_){var e=this.view_.getCenter();if(e){var t=this.toLonLat_(e),i=new Cesium.Cartographic(A(t[0]),A(t[1]));if(this.scene_.globe){var r=this.scene_.globe.getHeight(i);i.height=r||0}var n=Cesium.Ellipsoid.WGS84.cartographicToCartesian(i),o={pitch:this.tilt_-Cesium.Math.PI_OVER_TWO,heading:-this.view_.getRotation(),roll:void 0};this.cam_.setView({destination:n,orientation:o}),this.cam_.moveBackward(this.distance_),this.checkCameraChange(!0)}}},t.readFromView=function(){if(this.view_&&this.toLonLat_){var e=this.view_.getCenter();if(null!=e){var t=this.toLonLat_(e),i=this.view_.getResolution();this.distance_=this.calcDistanceForResolution(i||0,A(t[1])),this.updateCamera_()}}},t.updateView=function(){if(this.view_&&this.fromLonLat_){this.viewUpdateInProgress_=!0;var e=Cesium.Ellipsoid.WGS84,t=this.scene_,i=R.pickCenterPoint(t),r=i;if(!r){var n=t.globe,o=this.cam_.positionCartographic.clone(),a=n.getHeight(o);o.height=a||0,r=Cesium.Ellipsoid.WGS84.cartographicToCartesian(o)}this.distance_=Cesium.Cartesian3.distance(r,this.cam_.position);var s=e.cartesianToCartographic(r);if(this.view_.setCenter(this.fromLonLat_([j(s.longitude),j(s.latitude)])),this.view_.setResolution(this.calcResolutionForDistance(this.distance_,s?s.latitude:0)),i){var u=this.cam_.position,l=new Cesium.Cartesian3;e.geocentricSurfaceNormal(i,l);var c=new Cesium.Cartesian3;Cesium.Cartesian3.subtract(u,i,c),Cesium.Cartesian3.normalize(c,c);var h=this.cam_.up,m=this.cam_.right,d=new Cesium.Cartesian3(-i.y,i.x,0),g=Cesium.Cartesian3.angleBetween(m,d),f=Cesium.Cartesian3.cross(i,h,new Cesium.Cartesian3).z;this.view_.setRotation(f<0?g:-g);var p=Math.acos(Cesium.Cartesian3.dot(l,c));this.tilt_=isNaN(p)?0:p}else this.view_.setRotation(this.cam_.heading),this.tilt_=-this.cam_.pitch+Math.PI/2;this.viewUpdateInProgress_=!1}},t.checkCameraChange=function(e){var t=this.lastCameraViewMatrix_,i=this.cam_.viewMatrix;t&&Cesium.Matrix4.equalsEpsilon(t,i,1e-5)||(this.lastCameraViewMatrix_=i.clone(),!0!==e&&this.updateView())},t.calcDistanceForResolution=function(e,t){var i=this.scene_.canvas,r=this.cam_.frustum.fovy,n=this.view_.getProjection().getMetersPerUnit();return e*i.clientHeight*n*Math.cos(Math.abs(t))/2/Math.tan(r/2)},t.calcResolutionForDistance=function(e,t){var i=this.scene_.canvas,r=this.cam_.frustum.fovy,n=this.view_.getProjection().getMetersPerUnit();return 2*e*Math.tan(r/2)/n/Math.cos(Math.abs(t))/i.clientHeight},e}(),I=i(2),M=i.n(I),F=function(){function e(e,t){this.map=e,this.view=e.getView(),this.scene=t,this.olLayers=e.getLayerGroup().getLayers(),this.mapLayerGroup=e.getLayerGroup(),this.layerMap={},this.olLayerListenKeys={},this.olGroupListenKeys_={}}var t=e.prototype;return t.synchronize=function(){this.destroyAll(),this.addLayers_(this.mapLayerGroup)},t.orderLayers=function(){},t.addLayers_=function(e){for(var t=this,i=[{layer:e,parents:[]}],r=function(){var e=i.splice(0,1)[0],r=e.layer,n=s(r).toString();t.olLayerListenKeys[n]=[];var a=null;if(r instanceof M.a)t.listenForGroupChanges_(r),r!==t.mapLayerGroup&&(a=t.createSingleLayerCounterparts(e)),a||r.getLayers().forEach(function(n){if(n){var o={layer:n,parents:r===t.mapLayerGroup?[]:[e.layer].concat(e.parents)};i.push(o)}});else if(!(a=t.createSingleLayerCounterparts(e))){var u=n,l=e;t.olLayerListenKeys[n].push(o(l.layer,"change",function e(i){var r=t.createSingleLayerCounterparts(l);r&&(l.layer.un("change",e),t.addCesiumObjects_(r,u,l.layer),t.orderLayers())}))}a&&t.addCesiumObjects_(a,n,r)};i.length>0;)r();this.orderLayers()},t.addCesiumObjects_=function(e,t,i){var r=this;this.layerMap[t]=e,this.olLayerListenKeys[t].push(o(i,"change:zIndex",function(){return r.orderLayers()})),e.forEach(function(e){r.addCesiumObject(e)})},t.removeAndDestroySingleLayer_=function(e){var t=this,i=s(e).toString(),r=this.layerMap[i];return r&&(r.forEach(function(e){t.removeSingleCesiumObject(e,!1),t.destroyCesiumObject(e)}),this.olLayerListenKeys[i].forEach(O.unByKey),delete this.olLayerListenKeys[i]),delete this.layerMap[i],!!r},t.unlistenSingleGroup_=function(e){if(e!==this.mapLayerGroup){var t=s(e).toString();this.olGroupListenKeys_[t].forEach(function(e){Object(O.unByKey)(e)}),delete this.olGroupListenKeys_[t],delete this.layerMap[t]}},t.removeLayer_=function(e){var t=this;e&&function(){for(var i=[e];i.length>0;){var r=i.splice(0,1)[0],n=t.removeAndDestroySingleLayer_(r);r instanceof M.a&&(t.unlistenSingleGroup_(r),n||r.getLayers().forEach(function(e){i.push(e)}))}}()},t.listenForGroupChanges_=function(e){var t=s(e).toString(),i=[];this.olGroupListenKeys_[t]=i;var r=[],n=function(){var t=this,n=e.getLayers();n&&(r=[n.on("add",function(e){t.addLayers_(e.element)}),n.on("remove",function(e){t.removeLayer_(e.element)})],i.push.apply(i,r))}.bind(this);n(),i.push(e.on("change:layers",function(e){r.forEach(function(e){var t=i.indexOf(e);t>=0&&i.splice(t,1),Object(O.unByKey)(e)}),n()}))},t.destroyAll=function(){var e;for(e in this.removeAllCesiumObjects(!0),this.olGroupListenKeys_){this.olGroupListenKeys_[e].forEach(O.unByKey)}for(e in this.olLayerListenKeys)this.olLayerListenKeys[e].forEach(O.unByKey);this.olGroupListenKeys_={},this.olLayerListenKeys={},this.layerMap={}},t.addCesiumObject=function(e){},t.destroyCesiumObject=function(e){},t.removeSingleCesiumObject=function(e,t){},t.removeAllCesiumObjects=function(e){},t.createSingleLayerCounterparts=function(e){},e}();var k=function(e){var t,i;function r(t,i){var r;return(r=e.call(this,t,i)||this).cesiumLayers_=i.imageryLayers,r.ourLayers_=new Cesium.ImageryLayerCollection,r}i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var n=r.prototype;return n.addCesiumObject=function(e){this.cesiumLayers_.add(e),this.ourLayers_.add(e)},n.destroyCesiumObject=function(e){e.destroy()},n.removeSingleCesiumObject=function(e,t){this.cesiumLayers_.remove(e,t),this.ourLayers_.remove(e,!1)},n.removeAllCesiumObjects=function(e){for(var t=0;t<this.ourLayers_.length;++t)this.cesiumLayers_.remove(this.ourLayers_.get(t),e);this.ourLayers_.removeAll(!1)},n.convertLayerToCesiumImageries=function(e,t){var i=R.tileLayerToImageryLayer(this.map,e,t);return i?[i]:null},n.createSingleLayerCounterparts=function(e){var t=this,i=e.layer,r=s(i).toString(),n=this.view.getProjection(),o=this.convertLayerToCesiumImageries(i,n);if(o){var a,u=[];[e.layer].concat(e.parents).forEach(function(t){u.push(t.on(["change:opacity","change:visible"],function(){for(var t=0;t<o.length;++t)R.updateCesiumLayerProperties(e,o[t])}))});for(var l=0;l<o.length;++l)R.updateCesiumLayerProperties(e,o[l]);u.push(i.on("change:extent",function(e){for(var r=0;r<o.length;++r)t.cesiumLayers_.remove(o[r],!0),t.ourLayers_.remove(o[r],!1);delete t.layerMap[s(i)],t.synchronize()})),u.push(i.on("change",function(e){for(var i=0;i<o.length;++i){var r=t.cesiumLayers_.indexOf(o[i]);r>=0&&(t.cesiumLayers_.remove(o[i],!1),t.cesiumLayers_.add(o[i],r))}})),(a=this.olLayerListenKeys[r]).push.apply(a,u)}return Array.isArray(o)?o:null},n.orderLayers=function(){for(var e=this,t=[],i={},r=[this.mapLayerGroup];r.length>0;){var n=r.splice(0,1)[0];if(t.push(n),i[s(n)]=n.getZIndex(),n instanceof M.a){var o=n.getLayers();o&&r.unshift.apply(r,o.getArray())}}!function(e,t){for(var i=e.length,r=Array(e.length),n=0;n<i;n++)r[n]={index:n,value:e[n]};r.sort(function(e,i){return t(e.value,i.value)||e.index-i.index});for(var o=0;o<e.length;o++)e[o]=r[o].value}(t,function(e,t){return i[s(e)]-i[s(t)]}),t.forEach(function(t){var i=s(t).toString(),r=e.layerMap[i];r&&r.forEach(function(t){e.raiseToTop(t)})})},n.raiseToTop=function(e){this.cesiumLayers_.raiseToTop(e)},r}(F),V=(i(3),i(18),i(5)),D=i.n(V),N=i(6),q=i.n(N),B=i(19),H=i.n(B),W=i(7),z=i.n(W),U=i(8),K=i.n(U),Z=i(20),Q=i(9),Y=i(21),X=i.n(Y),J=function(){function e(e,t){var i=new Cesium.BillboardCollection({scene:t}),r=new Cesium.PrimitiveCollection;this.olListenKeys=[],this.rootCollection_=new Cesium.PrimitiveCollection,this.context={projection:e,billboards:i,featureToCesiumMap:{},primitives:r},this.rootCollection_.add(i),this.rootCollection_.add(r)}var t=e.prototype;return t.destroy=function(){this.olListenKeys.forEach(O.unByKey),this.olListenKeys.length=0},t.getRootPrimitive=function(){return this.rootCollection_},e}(),$=function(){function e(e){this.scene=e,this.boundOnRemoveOrClearFeatureListener_=this.onRemoveOrClearFeature_.bind(this),this.defaultBillboardEyeOffset_=new Cesium.Cartesian3(0,0,10)}var t=e.prototype;return t.onRemoveOrClearFeature_=function(e){var t=e.target,i=l.obj(t).olcs_cancellers;if(i){var r=e.feature;if(r){var n=s(r),o=i[n];o&&(o(),delete i[n])}else{for(var a in i)i.hasOwnProperty(a)&&i[a]();l.obj(t).olcs_cancellers={}}}},t.setReferenceForPicking=function(e,t,i){i.olLayer=e,i.olFeature=t},t.createColoredPrimitive=function(e,t,i,r,n,o){var a={flat:!0,renderState:{depthTest:{enabled:!0}}};void 0!==o&&(a.renderState||(a.renderState={}),a.renderState.lineWidth=o);var s,u=function(e,t){var i=new Cesium.GeometryInstance({geometry:e});return!t||t instanceof Cesium.ImageMaterialProperty||(i.attributes={color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}),i}(r,n);if(this.getHeightReference(e,t,i)===Cesium.HeightReference.CLAMP_TO_GROUND){var l=u.geometry.constructor;if(l&&!l.createShadowVolume)return null;s=new Cesium.GroundPrimitive({geometryInstances:u})}else s=new Cesium.Primitive({geometryInstances:u});if(n instanceof Cesium.ImageMaterialProperty){var c=n.image.getValue().toDataURL();s.appearance=new Cesium.MaterialAppearance({flat:!0,renderState:{depthTest:{enabled:!0}},material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:c}}})})}else s.appearance=new Cesium.PerInstanceColorAppearance(a);return this.setReferenceForPicking(e,t,s),s},t.extractColorFromOlStyle=function(e,t){var i=e.getFill()?e.getFill().getColor():null,r=e.getStroke()?e.getStroke().getColor():null,n="black";return r&&t?n=r:i&&(n=i),R.convertColorToCesium(n)},t.extractLineWidthFromOlStyle=function(e){var t=e.getStroke()?e.getStroke().getWidth():void 0;return void 0!==t?t:1},t.wrapFillAndOutlineGeometries=function(e,t,i,r,n,o){var a=this.extractColorFromOlStyle(o,!1),s=this.extractColorFromOlStyle(o,!0),u=new Cesium.PrimitiveCollection;if(o.getFill()){var l=this.createColoredPrimitive(e,t,i,r,a);u.add(l)}if(o.getStroke()&&n){var c=this.extractLineWidthFromOlStyle(o),h=this.createColoredPrimitive(e,t,i,n,s,c);h&&u.add(h)}return u},t.addTextStyle=function(e,t,i,r,n){var o;if(n instanceof Cesium.PrimitiveCollection?o=n:(o=new Cesium.PrimitiveCollection).add(n),!r.getText())return o;var a=r.getText(),s=this.olGeometry4326TextPartToCesium(e,t,i,a);return s&&o.add(s),o},t.csAddBillboard=function(e,t,i,r,n,o){t.eyeOffset||(t.eyeOffset=this.defaultBillboardEyeOffset_);var a=e.add(t);return this.setReferenceForPicking(i,r,a),a},t.olCircleGeometryToCesium=function(e,t,i,r,n){var o=this,a=(i=R.olGeometryCloneTo4326(i,r)).getCenter(),s=3==a.length?a[2]:0,l=a.slice();l[0]+=i.getRadius(),a=R.ol4326CoordinateToCesiumCartesian(a),l=R.ol4326CoordinateToCesiumCartesian(l);var c,h,m=Cesium.Cartesian3.distance(a,l),d=new Cesium.CircleGeometry({center:a,radius:m,height:s});if(this.getHeightReference(e,t,i)===Cesium.HeightReference.CLAMP_TO_GROUND){var g=this.extractLineWidthFromOlStyle(n);if(g){var f=Object(Z.circular)(i.getCenter(),m),p=R.ol4326CoordinateArrayToCsCartesians(f.getLinearRing(0).getCoordinates());if(u(this.scene))(c=new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:p,width:g})}),appearance:new Cesium.PolylineMaterialAppearance({material:this.olStyleToCesium(t,n,!0)}),classificationType:Cesium.ClassificationType.TERRAIN})).readyPromise.then(function(){o.setReferenceForPicking(e,t,c._primitive)});else{var v=this.extractColorFromOlStyle(n,!0);c=this.createStackedGroundCorridors(e,t,g,v,p)}}}else h=new Cesium.CircleOutlineGeometry({center:a,radius:m,extrudedHeight:s,height:s});var y=this.wrapFillAndOutlineGeometries(e,t,i,d,h,n);return c&&y.add(c),this.addTextStyle(e,t,i,n,y)},t.createStackedGroundCorridors=function(e,t,i,r,n){Array.isArray(n[0])||(n=[n]),i=Math.max(3,i);for(var o=[],a=0,s=0,u=[1e3,4e3,16e3,64e3,254e3,1e6,1e7];s<u.length;s++){var l=u[s],c={width:i*=2.14,vertexFormat:Cesium.VertexFormat.POSITION_ONLY},h=n,m=Array.isArray(h),d=0;for(h=m?h:h[Symbol.iterator]();;){var g;if(m){if(d>=h.length)break;g=h[d++]}else{if((d=h.next()).done)break;g=d.value}var f=g;c.positions=f,o.push(new Cesium.GeometryInstance({geometry:new Cesium.CorridorGeometry(c),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(a,l-1)}}))}a=l}return new Cesium.GroundPrimitive({geometryInstances:o})},t.olLineStringGeometryToCesium=function(e,t,i,r,n){var o=this;i=R.olGeometryCloneTo4326(i,r);var a,s=R.ol4326CoordinateArrayToCsCartesians(i.getCoordinates()),l=this.extractLineWidthFromOlStyle(n),c=this.getHeightReference(e,t,i);if(c!==Cesium.HeightReference.CLAMP_TO_GROUND||u(this.scene)){var h=new Cesium.PolylineMaterialAppearance({material:this.olStyleToCesium(t,n,!0)}),m={positions:s,width:l},d={appearance:h};if(c===Cesium.HeightReference.CLAMP_TO_GROUND){var g=new Cesium.GroundPolylineGeometry(m);d.geometryInstances=new Cesium.GeometryInstance({geometry:g}),(a=new Cesium.GroundPolylinePrimitive(d)).readyPromise.then(function(){o.setReferenceForPicking(e,t,a._primitive)})}else{m.vertexFormat=h.vertexFormat;var f=new Cesium.PolylineGeometry(m);d.geometryInstances=new Cesium.GeometryInstance({geometry:f}),a=new Cesium.Primitive(d)}}else{var p=this.extractColorFromOlStyle(n,!0);a=this.createStackedGroundCorridors(e,t,l,p,s)}return this.setReferenceForPicking(e,t,a),this.addTextStyle(e,t,i,n,a)},t.olPolygonGeometryToCesium=function(e,t,i,r,n){var o=this;i=R.olGeometryCloneTo4326(i,r);var a,s,l,c=this.getHeightReference(e,t,i);if(5==i.getCoordinates()[0].length&&"rectangle"===t.getGeometry().get("olcs.polygon_kind")){var h=i.getCoordinates()[0],m=Object(Q.boundingExtent)(h),d=Cesium.Rectangle.fromDegrees(m[0],m[1],m[2],m[3]),g=0;if(3==h[0].length)for(var f=0;f<h.length;f++)g=Math.max(g,h[f][2]);a=new Cesium.RectangleGeometry({ellipsoid:Cesium.Ellipsoid.WGS84,rectangle:d,height:g}),s=new Cesium.RectangleOutlineGeometry({ellipsoid:Cesium.Ellipsoid.WGS84,rectangle:d,height:g})}else{for(var p=i.getLinearRings(),v={},y=v,C=0;C<p.length;++C){var _=p[C].getCoordinates(),b=R.ol4326CoordinateArrayToCsCartesians(_);0==C?v.positions=b:(v.holes||(v.holes=[]),v.holes.push({positions:b}))}if(a=new Cesium.PolygonGeometry({polygonHierarchy:y,perPositionHeight:!0}),c===Cesium.HeightReference.CLAMP_TO_GROUND){var S=this.extractLineWidthFromOlStyle(n);if(S>0){var w=[v.positions];if(v.holes)for(var T=0;T<v.holes.length;++T)w.push(v.holes[T].positions);if(u(this.scene)){for(var P=new Cesium.PolylineMaterialAppearance({material:this.olStyleToCesium(t,n,!0)}),L=[],E=0,O=w;E<O.length;E++){var x=O[E],j=new Cesium.GroundPolylineGeometry({positions:x,width:S});L.push(new Cesium.GeometryInstance({geometry:j}))}var A={appearance:P,geometryInstances:L};(l=new Cesium.GroundPolylinePrimitive(A)).readyPromise.then(function(){o.setReferenceForPicking(e,t,l._primitive)})}else{var G=this.extractColorFromOlStyle(n,!0);l=this.createStackedGroundCorridors(e,t,S,G,w)}}}else s=new Cesium.PolygonOutlineGeometry({polygonHierarchy:v,perPositionHeight:!0})}var I=this.wrapFillAndOutlineGeometries(e,t,i,a,s,n);return l&&I.add(l),this.addTextStyle(e,t,i,n,I)},t.getHeightReference=function(e,t,i){var r=i.get("altitudeMode");void 0===r&&(r=t.get("altitudeMode")),void 0===r&&(r=e.get("altitudeMode"));var n=Cesium.HeightReference.NONE;return"clampToGround"===r?n=Cesium.HeightReference.CLAMP_TO_GROUND:"relativeToGround"===r&&(n=Cesium.HeightReference.RELATIVE_TO_GROUND),n},t.createBillboardFromImage=function(e,t,i,r,n,o,a,u){o instanceof K.a&&o.load();var c=o.getImage(1),h=function(){if(c&&(c instanceof HTMLCanvasElement||c instanceof Image||c instanceof HTMLImageElement)){var r,s=i.getCoordinates(),l=R.ol4326CoordinateToCesiumCartesian(s),h=o.getOpacity();void 0!==h&&(r=new Cesium.Color(1,1,1,h));var m=this.getHeightReference(e,t,i),d={image:c,color:r,scale:o.getScale(),heightReference:m,position:l};if(o instanceof K.a){var g=o.getAnchor();g&&(d.pixelOffset=new Cesium.Cartesian2(c.width/2-g[0],c.height/2-g[1]))}var f=this.csAddBillboard(a,d,e,t,i,n);u&&u(f)}}.bind(this);if(c instanceof Image&&!function(e){return""!=e.src&&0!=e.naturalHeight&&0!=e.naturalWidth&&e.complete}(c)){var m=!1,d=e.getSource();d.on(["removefeature","clear"],this.boundOnRemoveOrClearFeatureListener_);var g=l.obj(d).olcs_cancellers;g||(g=l.obj(d).olcs_cancellers={});var f=s(t);g[f]&&g[f](),g[f]=function(){m=!0};c.addEventListener("load",function e(){c.removeEventListener("load",e),a.isDestroyed()||m||h()})}else h()},t.olPointGeometryToCesium=function(e,t,i,r,n,o,a){i=R.olGeometryCloneTo4326(i,r);var s=null,u=n.getImage();if(u){var l=i.get("olcs_model")||t.get("olcs_model");if(l){var c=l(),h=Object.assign({},{scene:this.scene},c.cesiumOptions),m=Cesium.Model.fromGltf(h);(s=new Cesium.PrimitiveCollection).add(m),c.debugModelMatrix&&s.add(new Cesium.DebugModelMatrixPrimitive({modelMatrix:c.debugModelMatrix}))}else this.createBillboardFromImage(e,t,i,r,n,u,o,a)}return n.getText()?this.addTextStyle(e,t,i,n,s||new Cesium.Primitive):s},t.olMultiGeometryToCesium=function(e,t,i,r,n,o,a){var s,u=this,l=function(i,o){var a=new Cesium.PrimitiveCollection;return i.forEach(function(i){a.add(o(e,t,i,r,n))}),a};switch(i.getType()){case"MultiPoint":if(s=(i=i).getPoints(),n.getText()){var c=new Cesium.PrimitiveCollection;return s.forEach(function(i){var s=u.olPointGeometryToCesium(e,t,i,r,n,o,a);s&&c.add(s)}),c}return s.forEach(function(i){u.olPointGeometryToCesium(e,t,i,r,n,o,a)}),null;case"MultiLineString":return l(s=(i=i).getLineStrings(),this.olLineStringGeometryToCesium.bind(this));case"MultiPolygon":return l(s=(i=i).getPolygons(),this.olPolygonGeometryToCesium.bind(this))}},t.olGeometry4326TextPartToCesium=function(e,t,i,r){var n=r.getText();if(!n)return null;var o=new Cesium.LabelCollection({scene:this.scene}),a=Object(Q.getCenter)(i.getExtent());if(i instanceof X.a){var s=i.getFirstCoordinate();a[2]=3==s.length?s[2]:0}var u={};u.position=R.ol4326CoordinateToCesiumCartesian(a),u.text=n,u.heightReference=this.getHeightReference(e,t,i);var l=r.getOffsetX(),c=r.getOffsetY();if(0!=l&&0!=c){var h=new Cesium.Cartesian2(l,c);u.pixelOffset=h}u.font=r.getFont()||"10px sans-serif";var m,d=void 0;switch(r.getFill()&&(u.fillColor=this.extractColorFromOlStyle(r,!1),d=Cesium.LabelStyle.FILL),r.getStroke()&&(u.outlineWidth=this.extractLineWidthFromOlStyle(r),u.outlineColor=this.extractColorFromOlStyle(r,!0),d=Cesium.LabelStyle.OUTLINE),r.getFill()&&r.getStroke()&&(d=Cesium.LabelStyle.FILL_AND_OUTLINE),u.style=d,r.getTextAlign()){case"left":m=Cesium.HorizontalOrigin.LEFT;break;case"right":m=Cesium.HorizontalOrigin.RIGHT;break;case"center":default:m=Cesium.HorizontalOrigin.CENTER}if(u.horizontalOrigin=m,r.getTextBaseline()){var g;switch(r.getTextBaseline()){case"top":g=Cesium.VerticalOrigin.TOP;break;case"middle":g=Cesium.VerticalOrigin.CENTER;break;case"bottom":g=Cesium.VerticalOrigin.BOTTOM;break;case"alphabetic":g=Cesium.VerticalOrigin.TOP;break;case"hanging":g=Cesium.VerticalOrigin.BOTTOM}u.verticalOrigin=g}var f=o.add(u);return this.setReferenceForPicking(e,t,f),o},t.olStyleToCesium=function(e,t,i){var r=t.getFill(),n=t.getStroke();if(i&&!n||!i&&!r)return null;var o=i?n.getColor():r.getColor();return o=R.convertColorToCesium(o),i&&n.getLineDash()?Cesium.Material.fromType("Stripe",{horizontal:!1,repeat:500,evenColor:o,oddColor:new Cesium.Color(0,0,0,0)}):Cesium.Material.fromType("Color",{color:o})},t.computePlainStyle=function(e,t,i,r){var n=t.getStyleFunction(),o=null;return n&&(o=n(t,r)),!o&&i&&(o=i(t,r)),o?Array.isArray(o)?o:[o]:null},t.getGeometryFromFeature=function(e,t,i){if(i)return i;var r=e.get("olcs.3d_geometry");if(r&&r instanceof z.a)return r;if(t){var n=t.getGeometryFunction()(e);if(n instanceof z.a)return n}return e.getGeometry()},t.olFeatureToCesium=function(e,t,i,r,n){var o=this,a=this.getGeometryFromFeature(t,i,n);if(!a)return null;var u=r.projection,l=function(e){var i=r.featureToCesiumMap[s(t)];i instanceof Array?i.push(e):r.featureToCesiumMap[s(t)]=[e]};switch(a.getType()){case"GeometryCollection":var c=new Cesium.PrimitiveCollection;return a.getGeometries().forEach(function(n){if(n){var a=o.olFeatureToCesium(e,t,i,r,n);a&&c.add(a)}}),c;case"Point":a=a;var h=r.billboards,m=this.olPointGeometryToCesium(e,t,a,u,i,h,l);return m||null;case"Circle":return a=a,this.olCircleGeometryToCesium(e,t,a,u,i);case"LineString":return a=a,this.olLineStringGeometryToCesium(e,t,a,u,i);case"Polygon":return a=a,this.olPolygonGeometryToCesium(e,t,a,u,i);case"MultiPoint":case"MultiLineString":case"MultiPolygon":var d=this.olMultiGeometryToCesium(e,t,a,u,i,r.billboards,l);return d||null;case"LinearRing":throw new Error("LinearRing should only be part of polygon.");default:throw new Error("Ol geom type not handled : "+a.getType())}},t.olVectorLayerToCesium=function(e,t,i){var r=t.getProjection(),n=t.getResolution();if(void 0===n||!r)throw new Error("View not ready");var o=e.getSource();o instanceof D.a&&(o=o.getSource());for(var a=o.getFeatures(),u=new J(r,this.scene),l=u.context,c=0;c<a.length;++c){var h=a[c];if(h){var m=e.getStyleFunction(),d=this.computePlainStyle(e,h,m,n);if(d&&d.length){for(var g=null,f=0;f<d.length;f++){var p=this.olFeatureToCesium(e,h,d[f],l);if(p)if(g){if(p)for(var v=0,y=void 0;y=p.get(v);)g.add(y),v++}else g=p}g&&(i[s(h)]=g,u.getRootPrimitive().add(g))}}}return u},t.convert=function(e,t,i,r){var n=t.getProjection(),o=t.getResolution();if(null==o||!n)return null;var a=e.getStyleFunction(),s=this.computePlainStyle(e,i,a,o);if(!s.length)return null;r.projection=n;for(var u=null,l=0;l<s.length;l++){var c=this.olFeatureToCesium(e,i,s[l],r);if(u){if(c)for(var h=0,m=void 0;m=c.get(h);)u.add(m),h++}else u=c}return u},e}();var ee=function(e){var t,i;function r(t,i,r){var n;return(n=e.call(this,t,i)||this).converter=r||new $(i),n.csAllPrimitives_=new Cesium.PrimitiveCollection,i.primitives.add(n.csAllPrimitives_),n.csAllPrimitives_.destroyPrimitives=!1,n}i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var n=r.prototype;return n.addCesiumObject=function(e){e.getRootPrimitive().counterpart=e,this.csAllPrimitives_.add(e.getRootPrimitive())},n.destroyCesiumObject=function(e){e.getRootPrimitive().destroy()},n.removeSingleCesiumObject=function(e,t){e.destroy(),this.csAllPrimitives_.destroyPrimitives=t,this.csAllPrimitives_.remove(e.getRootPrimitive()),this.csAllPrimitives_.destroyPrimitives=!1},n.removeAllCesiumObjects=function(e){if(this.csAllPrimitives_.destroyPrimitives=e,e)for(var t=0;t<this.csAllPrimitives_.length;++t)this.csAllPrimitives_.get(t).counterpart.destroy();this.csAllPrimitives_.removeAll(),this.csAllPrimitives_.destroyPrimitives=!1},n.updateLayerVisibility=function(e,t){var i=!0;[e.layer].concat(e.parents).forEach(function(e){var t=e.getVisible();void 0!==t?i&=t:i=!1}),t.show=i},n.createSingleLayerCounterparts=function(e){var t=this,i=e.layer;if(!(i instanceof q.a)||i instanceof H.a)return null;var r=i.getSource();if(r instanceof D.a&&(r=r.getSource()),!r)return null;var n=this.view,a={},u=this.converter.olVectorLayerToCesium(i,n,a),l=u.getRootPrimitive(),c=u.olListenKeys;[e.layer].concat(e.parents).forEach(function(i){c.push(o(i,"change:visible",function(){t.updateLayerVisibility(e,l)}))}),this.updateLayerVisibility(e,l);var h=function(e){var t=u.context,r=this.converter.convert(i,n,e,t);r&&(a[s(e)]=r,l.add(r))}.bind(this),m=function(e){var t=s(e),i=u.context,r=i.featureToCesiumMap[t];r&&(delete i.featureToCesiumMap[t],r.forEach(function(e){e instanceof Cesium.Billboard&&i.billboards.remove(e)}));var n=a[t];delete a[t],n&&l.remove(n)}.bind(this);return c.push(o(r,"addfeature",function(e){h(e.feature)})),c.push(o(r,"removefeature",function(e){m(e.feature)})),c.push(o(r,"changefeature",function(e){var t=e.feature;m(t),h(t)})),u?[u]:null},r}(F),te=i(22);var ie=function(e){var t,i;function n(t){var i,r=t.parent;(i=e.call(this,r.getOptions())||this).scenePostRenderListenerRemover_=null,i.scene_=t.scene,i.synchronizer_=t.synchronizer,i.parent_=r,i.positionWGS84_=void 0,i.observer_=new MutationObserver(i.handleElementChanged.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i))),i.attributeObserver_=[],i.listenerKeys_=[];var n=function(e){return i.setPropertyFromEvent_(e)};return i.listenerKeys_.push(i.parent_.on("change:position",n)),i.listenerKeys_.push(i.parent_.on("change:element",n)),i.listenerKeys_.push(i.parent_.on("change:offset",n)),i.listenerKeys_.push(i.parent_.on("change:position",n)),i.listenerKeys_.push(i.parent_.on("change:positioning",n)),i.setProperties(i.parent_.getProperties()),i.handleMapChanged(),i.handleElementChanged(),i}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var o=n.prototype;return o.observeTarget_=function(e){if(this.observer_){this.observer_.disconnect(),this.observer_.observe(e,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),this.attributeObserver_.forEach(function(e){e.disconnect()}),this.attributeObserver_.length=0;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1===i.nodeType){var r=new MutationObserver(this.handleElementChanged.bind(this));r.observe(i,{attributes:!0,subtree:!0}),this.attributeObserver_.push(r)}}}},o.setPropertyFromEvent_=function(e){e.target&&e.key&&this.set(e.key,e.target.get(e.key))},o.getScene=function(){return this.scene_},o.handleMapChanged=function(){var e;this.scenePostRenderListenerRemover_&&(this.scenePostRenderListenerRemover_(),(e=this.element)&&e.parentNode&&e.parentNode.removeChild(e)),this.scenePostRenderListenerRemover_=null;var t=this.getScene();if(t){this.scenePostRenderListenerRemover_=t.postRender.addEventListener(this.updatePixelPosition.bind(this)),this.updatePixelPosition();var i=this.stopEvent?this.synchronizer_.getOverlayContainerStopEvent():this.synchronizer_.getOverlayContainer();this.insertFirst?i.insertBefore(this.element,i.childNodes[0]||null):i.appendChild(this.element)}},o.handlePositionChanged=function(){var e=this.getPosition();if(e){var t=this.parent_.getMap().getView().getProjection();this.positionWGS84_=Object(r.transform)(e,t,"EPSG:4326")}else this.positionWGS84_=void 0;this.updatePixelPosition()},o.handleElementChanged=function(){function e(t,i){var r=t.cloneNode();i&&i.appendChild(r),t.nodeType!=Node.TEXT_NODE&&r.addEventListener("click",function(e){t.dispatchEvent(new MouseEvent("click",e)),e.stopPropagation()});for(var n=t.childNodes,o=0;o<n.length;o++)n[o]&&e(n[o],r);return r}!function(e){for(;e.lastChild;)e.removeChild(e.lastChild)}(this.element);var t=this.getElement();if(t&&t.parentNode&&t.parentNode.childNodes){var i=t.parentNode.childNodes,r=Array.isArray(i),n=0;for(i=r?i:i[Symbol.iterator]();;){var o;if(r){if(n>=i.length)break;o=i[n++]}else{if((n=i.next()).done)break;o=n.value}var a=e(o,null);this.element.appendChild(a)}}t.parentNode&&this.observeTarget_(t.parentNode)},o.updatePixelPosition=function(){var e=this.positionWGS84_;if(this.scene_&&e){var t=0;if(2===e.length){var i=this.scene_.globe.getHeight(Cesium.Cartographic.fromDegrees(e[0],e[1]));i&&this.scene_.globe.tilesLoaded&&(e[2]=i),i&&(t=i)}else t=e[2];var r=Cesium.Cartesian3.fromDegrees(e[0],e[1],t),n=this.scene_.camera,o=new Cesium.BoundingSphere(new Cesium.Cartesian3,6356752);if(new Cesium.Occluder(o,n.position).isPointVisible(r))if(1===n.frustum.computeCullingVolume(n.position,n.direction,n.up).computeVisibility(new Cesium.BoundingSphere(r))){this.setVisible(!0);var a=this.scene_.cartesianToCanvasCoordinates(r),s=[a.x,a.y],u=[this.scene_.canvas.width,this.scene_.canvas.height];this.updateRenderedPosition(s,u)}else this.setVisible(!1);else this.setVisible(!1)}else this.setVisible(!1)},o.destroy=function(){this.scenePostRenderListenerRemover_&&this.scenePostRenderListenerRemover_(),this.observer_&&this.observer_.disconnect(),Object(O.unByKey)(this.listenerKeys_),this.listenerKeys_.splice(0),this.element.removeNode?this.element.removeNode(!0):this.element.remove(),this.element=null},n}(i.n(te).a),re=function(){function e(e,t){var i=this;this.map=e,this.overlays_=this.map.getOverlays(),this.scene=t,this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";["click","dblclick","mousedown","touchstart","MSPointerDown","pointerdown","mousewheel","wheel"].forEach(function(e){i.overlayContainerStopEvent_.addEventListener(e,function(e){return e.stopPropagation()})}),this.scene.canvas.parentElement.appendChild(this.overlayContainerStopEvent_),this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.scene.canvas.parentElement.appendChild(this.overlayContainer_),this.overlayMap_={}}var t=e.prototype;return t.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},t.getOverlayContainer=function(){return this.overlayContainer_},t.synchronize=function(){this.destroyAll(),this.addOverlays(),this.overlays_.on("add",this.addOverlayFromEvent_.bind(this)),this.overlays_.on("remove",this.removeOverlayFromEvent_.bind(this))},t.addOverlayFromEvent_=function(e){var t=e.element;this.addOverlay(t)},t.addOverlays=function(){var e=this;this.overlays_.forEach(function(t){e.addOverlay(t)})},t.addOverlay=function(e){if(e){var t=new ie({scene:this.scene,synchronizer:this,parent:e}),i=s(e).toString();this.overlayMap_[i]=t}},t.removeOverlayFromEvent_=function(e){var t=e.element;this.removeOverlay(t)},t.removeOverlay=function(e){var t=s(e).toString(),i=this.overlayMap_[t];i&&(i.destroy(),delete this.overlayMap_[t])},t.destroyAll=function(){var e=this;Object.keys(this.overlayMap_).forEach(function(t){e.overlayMap_[t].destroy(),delete e.overlayMap_[t]})},e}(),ne=function(){function e(t){this.autoRenderLoop_=null,this.map_=t.map,this.time_=t.time||function(){return Cesium.JulianDate.now()},this.to4326Transform_=Object(r.getTransform)(this.map_.getView().getProjection(),"EPSG:4326"),this.resolutionScale_=1,this.canvasClientWidth_=0,this.canvasClientHeight_=0,this.resolutionScaleChanged_=!0;var i="position:absolute;top:0;left:0;width:100%;height:100%;";this.container_=document.createElement("DIV");var n=document.createAttribute("style");n.value=i+"visibility:hidden;",this.container_.setAttributeNode(n);var o=t.target||null;if(o)"string"==typeof o&&(o=document.getElementById(o)),o.appendChild(this.container_);else{var a=this.map_.getViewport().querySelector(".ol-overlaycontainer");a&&a.parentNode&&a.parentNode.insertBefore(this.container_,a)}if(this.isOverMap_=!o,t