| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-19 10:18:23 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:22:00 | |||
| * @Last Modified time: 2020-02-29 18:50:52 | |||
| */ | |||
| import Cesium from '@/namespace' | |||
| @@ -125,12 +125,8 @@ DC.Billboard = class extends Overlay { | |||
| if (entity.billboard) { | |||
| billboard = new DC.Billboard(position, entity.billboard.image) | |||
| billboard.attr = { | |||
| name: entity.name | |||
| ...entity.properties | |||
| } | |||
| delete entity.billboard.image | |||
| billboard.setStyle({ | |||
| ...entity.billboard | |||
| }) | |||
| } | |||
| return billboard | |||
| } | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-09 09:10:37 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:19:38 | |||
| * @Last Modified time: 2020-02-29 18:54:09 | |||
| */ | |||
| import Overlay from '../Overlay' | |||
| import Cesium from '@/namespace' | |||
| @@ -137,7 +137,20 @@ DC.Polygon = class extends Overlay { | |||
| * | |||
| * @param {*} entity | |||
| */ | |||
| static fromEntity(entity) {} | |||
| static fromEntity(entity) { | |||
| let polygon = undefined | |||
| if (entity.polygon) { | |||
| let positions = DC.T.transformCartesianArrayToWSG84Array( | |||
| item.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions | |||
| ) | |||
| polygon = new DC.Polygon(positions) | |||
| polygon.attr = { | |||
| ...entity.properties | |||
| } | |||
| } | |||
| return polygon | |||
| } | |||
| } | |||
| DC.OverlayType.POLYGON = 'polygon' | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-29 18:22:26 | |||
| * @Last Modified time: 2020-02-29 18:51:49 | |||
| */ | |||
| import Overlay from '../Overlay' | |||
| @@ -113,8 +113,19 @@ DC.Polyline = class extends Overlay { | |||
| * | |||
| * @param {*} entity | |||
| */ | |||
| fromEntity(entity) { | |||
| // this._positions = | |||
| static fromEntity(entity) { | |||
| let polyline = undefined | |||
| if (entity.polyline) { | |||
| let positions = GS.T.transformCartesianArrayToWSG84Array( | |||
| entity.polyline.positions.getValue(Cesium.JulianDate.now()) | |||
| ) | |||
| polyline = new GS.Polyline(positions) | |||
| polyline.attr = { | |||
| ...entity.properties | |||
| } | |||
| } | |||
| return polyline | |||
| } | |||
| } | |||