huweili-cesium 1.2.27 → 1.2.28

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.
Files changed (2) hide show
  1. package/js/basis.js +5 -4
  2. package/package.json +1 -1
package/js/basis.js CHANGED
@@ -121,6 +121,11 @@ export function basicConfig() {
121
121
  * @param map - 地图实例
122
122
  */
123
123
  const mouseController = (map, _mapId, callbacks = {}) => {
124
+ // 阻止浏览器默认的右键菜单弹出
125
+ map.scene.canvas.addEventListener('contextmenu', (e) => {
126
+ e.preventDefault();
127
+ });
128
+
124
129
  // 添加右键点击事件监听
125
130
  map.screenSpaceEventHandler.setInputAction((click) => {
126
131
  console.log('右键点击事件触发')
@@ -143,10 +148,6 @@ export function basicConfig() {
143
148
  };
144
149
 
145
150
  console.log('点击位置:', position);
146
- callbacks.onRightClick?.(position);
147
-
148
- // 弹出alert显示坐标信息
149
- // alert(`点击位置坐标:\n经度:${Number(lng).toFixed(6)}\n纬度:${Number(lat).toFixed(6)}\n高度:${Number(height).toFixed(2)}米`);
150
151
  }
151
152
  }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
152
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huweili-cesium",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "基于 Cesium 的地图工具库(无人机态势、轨迹、围栏、工具栏等)",
5
5
  "type": "module",
6
6
  "main": "./index.js",