浏览代码

improve heat map

tags/3.0.0
Caven Chen 2 年前
父节点
当前提交
ea8377f6ec
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 5 次插入8 次删除
  1. 5
    8
      src/modules/heat-map/HeatMapLayer.js

+ 5
- 8
src/modules/heat-map/HeatMapLayer.js 查看文件

@@ -122,9 +122,9 @@ class HeatMapLayer extends Layer {
*
* @private
*/
_computeBounds(points) {
_computeBounds() {
Cesium.Rectangle.fromCartographicArray(
points.map((item) => Cesium.Cartographic.fromDegrees(item.lng, item.lat)),
this._points.map((item) => Cesium.Cartographic.fromDegrees(item.lng, item.lat)),
this._bounds
)
}
@@ -137,7 +137,7 @@ class HeatMapLayer extends Layer {
_computeBoundsInMeter() {
let swInMeter = WMP.project(Cesium.Rectangle.southwest(this._bounds))
let neInMeter = WMP.project(Cesium.Rectangle.northeast(this._bounds))
return new Cesium.Rectangle(
this._boundsInMeter = new Cesium.Rectangle(
swInMeter.x,
swInMeter.y,
neInMeter.x,
@@ -202,11 +202,8 @@ class HeatMapLayer extends Layer {
*/
setPoints(points) {
this._points = points
this._computeBounds(points)
let boundsInMeter = this._computeBoundsInMeter()
if (!Cesium.Rectangle.equals(this._boundsInMeter, boundsInMeter)) {
this._boundsInMeter = boundsInMeter
}
this._computeBounds()
this._computeBoundsInMeter()
if (this._viewer) {
this._scale = Math.min(
Math.abs(this._boundsInMeter.west - this._boundsInMeter.east) /

正在加载...
取消
保存