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.
- package/js/basis.js +5 -4
- 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
|
|