| const DEF_OPTS = { | const DEF_OPTS = { | ||||
| radius: 30, | radius: 30, | ||||
| height: 0, | height: 0, | ||||
| gradient: undefined | |||||
| gradient: undefined, | |||||
| useGround: false, | |||||
| classificationType: 2 | |||||
| } | } | ||||
| class HeatLayer extends Layer { | class HeatLayer extends Layer { | ||||
| ...DEF_OPTS, | ...DEF_OPTS, | ||||
| ...options | ...options | ||||
| } | } | ||||
| this._isGround = this._options.useGround | |||||
| this._canvas = document.createElement('canvas') | this._canvas = document.createElement('canvas') | ||||
| this._canvas.setAttribute('id', id) | this._canvas.setAttribute('id', id) | ||||
| this._heat = undefined | this._heat = undefined | ||||
| this._rect = new Cesium.Rectangle() | this._rect = new Cesium.Rectangle() | ||||
| this._delegate = new Cesium.PrimitiveCollection() | this._delegate = new Cesium.PrimitiveCollection() | ||||
| this._primitive = this._delegate.add( | this._primitive = this._delegate.add( | ||||
| new Cesium.Primitive({ | |||||
| geometryInstances: new Cesium.GeometryInstance({ | |||||
| geometry: {} | |||||
| }) | |||||
| }) | |||||
| this._isGround | |||||
| ? new Cesium.GroundPrimitive({ | |||||
| geometryInstances: new Cesium.GeometryInstance({ | |||||
| geometry: {} | |||||
| }), | |||||
| classificationType: this._options.classificationType | |||||
| }) | |||||
| : new Cesium.Primitive({ | |||||
| geometryInstances: new Cesium.GeometryInstance({ | |||||
| geometry: {} | |||||
| }) | |||||
| }) | |||||
| ) | ) | ||||
| this._scale = 1 | this._scale = 1 | ||||
| this._points = [] | this._points = [] |