Przeglądaj źródła

improve the heatlayer

tags/2.8.0
Caven Chen 3 lat temu
rodzic
commit
6f834c9839
1 zmienionych plików z 16 dodań i 6 usunięć
  1. 16
    6
      modules/heat/HeatLayer.js

+ 16
- 6
modules/heat/HeatLayer.js Wyświetl plik

@@ -13,7 +13,9 @@ const WMP = new Cesium.WebMercatorProjection()
const DEF_OPTS = {
radius: 30,
height: 0,
gradient: undefined
gradient: undefined,
useGround: false,
classificationType: 2
}

class HeatLayer extends Layer {
@@ -23,6 +25,7 @@ class HeatLayer extends Layer {
...DEF_OPTS,
...options
}
this._isGround = this._options.useGround
this._canvas = document.createElement('canvas')
this._canvas.setAttribute('id', id)
this._heat = undefined
@@ -30,11 +33,18 @@ class HeatLayer extends Layer {
this._rect = new Cesium.Rectangle()
this._delegate = new Cesium.PrimitiveCollection()
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._points = []

Ładowanie…
Anuluj
Zapisz