huweili-cesium 1.2.16 → 1.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -253,17 +253,20 @@ export function measureDistance() {
253
253
  if (deleteButtonEntity || !endPosition) return
254
254
  deleteButtonEntity = map.entities.add({
255
255
  id: tempIds.deleteButton,
256
- position: endPosition,
256
+ position: new Cesium.CallbackProperty(() => endPosition, false),
257
257
  label: {
258
258
  text: '删除',
259
- font: '12px Microsoft YaHei',
259
+ font: '700 13px Microsoft YaHei',
260
+ style: Cesium.LabelStyle.FILL_AND_OUTLINE,
260
261
  fillColor: Cesium.Color.WHITE,
262
+ outlineColor: Cesium.Color.fromCssColorString('#b71c1c'),
263
+ outlineWidth: 4,
261
264
  showBackground: true,
262
- backgroundColor: Cesium.Color.fromCssColorString('rgba(220, 53, 69, 0.95)'),
263
- backgroundPadding: new Cesium.Cartesian2(10, 6),
265
+ backgroundColor: Cesium.Color.fromCssColorString('rgba(244, 67, 54, 0.96)'),
266
+ backgroundPadding: new Cesium.Cartesian2(12, 7),
264
267
  verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
265
268
  horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
266
- pixelOffset: new Cesium.Cartesian2(14, -28),
269
+ pixelOffset: new Cesium.Cartesian2(16, -34),
267
270
  disableDepthTestDistance: Number.POSITIVE_INFINITY,
268
271
  distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, Number.POSITIVE_INFINITY)
269
272
  }
@@ -376,7 +379,8 @@ export function measureDistance() {
376
379
  deleteHandler = new Cesium.ScreenSpaceEventHandler(map.scene.canvas)
377
380
  deleteHandler.setInputAction((movement) => {
378
381
  const picked = map.scene.pick(movement.position)
379
- if (!Cesium.defined(picked) || picked.id !== deleteButtonEntity) return
382
+ const pickedEntity = picked?.id
383
+ if (!Cesium.defined(pickedEntity) || pickedEntity !== deleteButtonEntity) return
380
384
  destroyGraphic()
381
385
  if (typeof options.onDelete === 'function') options.onDelete(options.id)
382
386
  }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huweili-cesium",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "基于 Cesium 的地图工具库(无人机态势、轨迹、围栏、工具栏等)",
5
5
  "type": "module",
6
6
  "main": "./index.js",