| @@ -75,6 +75,12 @@ class GeoJsonLayer extends Layer { | |||
| } | |||
| } | |||
| /** | |||
| * | |||
| * @param method | |||
| * @param context | |||
| * @returns {GeoJsonLayer} | |||
| */ | |||
| eachOverlay(method, context) { | |||
| if (this._delegate) { | |||
| this._delegate.then(dataSource => { | |||
| @@ -51,11 +51,18 @@ class DivIcon extends Overlay { | |||
| if (content && typeof content === 'string') { | |||
| this._delegate.innerHTML = content | |||
| } else if (content && content instanceof Element) { | |||
| while (this._delegate.hasChildNodes()) { | |||
| this._delegate.removeChild(this._delegate.firstChild) | |||
| } | |||
| this._delegate.appendChild(content) | |||
| } | |||
| return this | |||
| } | |||
| get content() { | |||
| return this._content | |||
| } | |||
| /** | |||
| * Updates style | |||
| * @param style | |||
| @@ -17,7 +17,8 @@ class Transform { | |||
| */ | |||
| static transformCartesianToWGS84(cartesian) { | |||
| if (cartesian) { | |||
| let cartographic = Cesium.Cartographic.fromCartesian(cartesian) | |||
| let ellipsoid = Cesium.Ellipsoid.WGS84 | |||
| let cartographic = ellipsoid.cartesianToCartographic(cartesian) | |||
| return new Position( | |||
| Cesium.Math.toDegrees(cartographic.longitude), | |||
| Cesium.Math.toDegrees(cartographic.latitude), | |||
| @@ -420,6 +420,15 @@ class Viewer { | |||
| return this | |||
| } | |||
| /** | |||
| * Removes terrain | |||
| * @returns {Viewer} | |||
| */ | |||
| removeTerrain() { | |||
| this._delegate.terrainProvider = new Cesium.EllipsoidTerrainProvider() | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param layerGroup | |||
| @@ -641,6 +650,7 @@ class Viewer { | |||
| */ | |||
| destroy() { | |||
| this._delegate.destroy() | |||
| this._delegate = undefined | |||
| return this | |||
| } | |||
| @@ -123,6 +123,9 @@ class Widget { | |||
| if (content && typeof content === 'string') { | |||
| this._wrapper.innerHTML = content | |||
| } else if (content && content instanceof Element) { | |||
| while (this._wrapper.hasChildNodes()) { | |||
| this._wrapper.removeChild(this._wrapper.firstChild) | |||
| } | |||
| this._wrapper.appendChild(content) | |||
| } | |||
| return this | |||