leiting-bim 2.1.133 → 2.1.136
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/leiting-bim.es.js +1 -1
- package/leiting-bim.umd.js +10 -10
- package/leitingbim.css +1 -1
- package/package.json +1 -1
- package/plugins/cesium-core/dist/cesium-core.mjs +1505 -1315
- package/plugins/cesium-core/dist/cesium-core.mjs.map +1 -1
- package/plugins/cesium-core/dist/cesium-core.umd.js +25 -25
- package/plugins/cesium-core/dist/cesium-core.umd.js.map +1 -1
- package/plugins/cesium-core/dist/components/HtmlOverlayLabelPool.d.ts +36 -0
- package/plugins/cesium-core/dist/components/draw/handlers/LineDrawer.d.ts +1 -0
- package/plugins/cesium-core/dist/components/draw/handlers/PolygonDrawer.d.ts +1 -0
- package/plugins/cesium-core/package.json +1 -1
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-CbiNlyAM.js +510 -0
- package/plugins/cesium-vue/dist/HtmlOverlayLabelPool-CbiNlyAM.js.map +1 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-bubble/index.d.ts +87 -1
- package/plugins/cesium-vue/dist/cesium-vue/src/components/marker-manage/index.d.ts +12 -0
- package/plugins/cesium-vue/dist/cesium-vue/src/index.d.ts +3 -2
- package/plugins/cesium-vue/dist/components/marker-bubble.js +200 -73
- package/plugins/cesium-vue/dist/components/marker-bubble.js.map +1 -1
- package/plugins/cesium-vue/dist/components/marker-manage.js +536 -511
- package/plugins/cesium-vue/dist/components/marker-manage.js.map +1 -1
- package/plugins/cesium-vue/dist/components/measurement.js +1 -1
- package/plugins/cesium-vue/dist/index.js +39 -37
- package/plugins/cesium-vue/dist/index.js.map +1 -1
- package/plugins/cesium-vue/package.json +1 -1
- package/plugins/theme-chalk/dist/theme-chalk.css +33 -0
- package/plugins/theme-chalk/package.json +1 -1
- package/plugins/utils/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlOverlayLabelPool-CbiNlyAM.js","sources":["../../cesium-core/src/components/MarkerEvent.ts","../../cesium-core/src/components/HtmlOverlayLabelPool.ts"],"sourcesContent":["export enum MarkerEventKey {\r\n Click = 'marker:click',\r\n DoubleClick = 'marker:dblclick',\r\n RightClick = 'marker:rightclick',\r\n MouseEnter = 'marker:mouseenter',\r\n MouseLeave = 'marker:mouseleave',\r\n MouseDown = 'marker:mousedown',\r\n MouseUp = 'marker:mouseup',\r\n}\r\n\r\ninterface ListenerItem<T = any> {\r\n name: string;\r\n fn: (data: T, event: Event) => void;\r\n once?: boolean;\r\n}\r\n\r\nexport { ListenerItem };\r\n\r\nexport class MarkerEventBus {\r\n private listenerMap = new Map<MarkerEventKey, Map<string, ListenerItem>>();\r\n\r\n /**\r\n * 添加监听器\r\n * @param key 事件 key\r\n * @param listener 监听器项\r\n * @param overwrite 是否覆盖同名监听器\r\n * @returns 是否成功添加\r\n */\r\n addListener(key: MarkerEventKey, listener: ListenerItem, overwrite: boolean = false): boolean {\r\n let map = this.listenerMap.get(key);\r\n if (!map) {\r\n map = new Map();\r\n this.listenerMap.set(key, map);\r\n }\r\n\r\n if (map.has(listener.name)) {\r\n if (overwrite) {\r\n console.warn(\r\n `[MarkerEventBus] Overwriting listener \"${listener.name}\" for event \"${key}\".`,\r\n );\r\n map.set(listener.name, listener);\r\n return true;\r\n } else {\r\n console.warn(\r\n `[MarkerEventBus] Listener \"${listener.name}\" for event \"${key}\" already exists. Use overwrite=true to replace it.`,\r\n );\r\n return false;\r\n }\r\n }\r\n\r\n map.set(listener.name, listener);\r\n return true;\r\n }\r\n\r\n /**\r\n * 移除某个 key 的所有监听器\r\n */\r\n removeListenerByKey(key: MarkerEventKey): boolean {\r\n const existed = this.listenerMap.has(key);\r\n this.listenerMap.set(key, new Map());\r\n return existed;\r\n }\r\n\r\n /**\r\n * 移除某个 key 下的指定名字的监听器\r\n */\r\n removeListenerByKeyAndName(key: MarkerEventKey, name: string): boolean {\r\n const map = this.listenerMap.get(key);\r\n if (!map) return false;\r\n return map.delete(name);\r\n }\r\n\r\n /**\r\n * 运行监听器\r\n */\r\n runListener<T = any>(key: MarkerEventKey, data: T, e: Event) {\r\n const map = this.listenerMap.get(key);\r\n if (!map) return;\r\n\r\n for (const [name, listener] of map.entries()) {\r\n try {\r\n listener.fn(data, e);\r\n } catch (err) {\r\n console.error(`Error in listener \"${name}\" for event \"${key}\":`, err);\r\n }\r\n\r\n if (listener.once) {\r\n map.delete(name);\r\n }\r\n }\r\n }\r\n}\r\n","import { MarkerEventKey, MarkerEventBus } from './MarkerEvent';\r\n\r\n/**\r\n * 单个标签实例\r\n */\r\ninterface LabelInstance {\r\n id: string;\r\n el: HTMLDivElement;\r\n theme: string;\r\n data?: any;\r\n notCreateElement?: boolean;\r\n unload?: any;\r\n}\r\n\r\n/**\r\n * 主题配置项\r\n */\r\ninterface ThemeOptions {\r\n /**\r\n * 创建标签 DOM 内容的方法\r\n */\r\n createElement: (\r\n el: HTMLDivElement,\r\n context: { id: string; theme: string; data: any },\r\n options: ThemeOptions,\r\n ) => any;\r\n\r\n /**\r\n * 可选配置,如偏移量\r\n */\r\n options?: {\r\n offset?: { x?: number; y?: number };\r\n };\r\n}\r\n\r\n/**\r\n * 标签添加时的参数\r\n */\r\ninterface LabelOptions {\r\n id: string;\r\n lon: number;\r\n lat: number;\r\n height?: number;\r\n theme: string;\r\n show?: boolean;\r\n notCreateElement?: boolean;\r\n style?: {\r\n [key: string]: string;\r\n };\r\n}\r\nexport { LabelOptions, LabelInstance, ThemeOptions };\r\n\r\n/**\r\n * 自定义事件与 DOM 事件的映射\r\n */\r\nexport const DOM_EVENT_MAP: Record<MarkerEventKey, keyof HTMLElementEventMap> = {\r\n [MarkerEventKey.Click]: 'click',\r\n [MarkerEventKey.DoubleClick]: 'dblclick',\r\n [MarkerEventKey.RightClick]: 'contextmenu',\r\n [MarkerEventKey.MouseEnter]: 'mouseenter',\r\n [MarkerEventKey.MouseLeave]: 'mouseleave',\r\n [MarkerEventKey.MouseDown]: 'mousedown',\r\n [MarkerEventKey.MouseUp]: 'mouseup',\r\n};\r\n\r\ninterface OcclusionOptions {\r\n enabled: boolean;\r\n throttleMs: number;\r\n distanceEpsilon: number;\r\n}\r\n\r\ntype OcclusionCheckReason =\r\n | 'label-missing'\r\n | 'invalid-coordinate'\r\n | 'screen-position-undefined'\r\n | 'runtime-missing'\r\n | 'pick-unsupported'\r\n | 'pick-empty'\r\n | 'pick-error'\r\n | 'distance-compare';\r\n\r\ninterface OcclusionCheckLog {\r\n timestamp: number;\r\n id: string;\r\n lon?: number;\r\n lat?: number;\r\n height?: number;\r\n occluded: boolean;\r\n reason: OcclusionCheckReason;\r\n epsilon?: number;\r\n labelDistance?: number;\r\n pickedDistance?: number;\r\n}\r\n\r\n/**\r\n * 用于管理 Cesium HTML 标签的池,支持主题渲染、事件分发、动态更新等功能\r\n */\r\nexport class HtmlOverlayLabelPool {\r\n private viewer: any;\r\n private Cesium: any;\r\n private container: HTMLDivElement;\r\n private labels: Map<string, LabelInstance> = new Map();\r\n private activeIds: Set<string> = new Set();\r\n private occludedIds: Set<string> = new Set();\r\n private _updateFn: () => void;\r\n private _cameraChangedFn: () => void;\r\n private themes: Record<string, ThemeOptions> = {};\r\n public occlusionCheckLogs: OcclusionCheckLog[] = [];\r\n private occlusionLogEnabled = false;\n private occlusionLogMax = 10000;\n private occlusionOptions: OcclusionOptions = {\n enabled: false,\n throttleMs: 120,\n distanceEpsilon: 1.0,\n };\n private _occlusionTimer: number | null = null;\r\n private _lastOcclusionAt: number = 0;\r\n private _occlusionChecking = false;\r\n private _occlusionPending = false;\r\n public eventBus: MarkerEventBus;\r\n public openWheel = true;\r\n /**\r\n * 构造函数\r\n * @param Cesium Cesium 命名空间\r\n * @param viewer Cesium Viewer 实例\r\n * @param containerId HTML 容器 ID(默认:\"html-label-container\")\r\n * @param eventBus 可选:自定义事件总线\r\n */\r\n constructor(\r\n Cesium: any,\r\n viewer: any,\r\n containerId: string = 'html-label-container',\r\n eventBus?: MarkerEventBus,\r\n openWheel: boolean = true,\r\n ) {\r\n this.Cesium = Cesium;\r\n this.viewer = viewer;\r\n this.container = this._createContainer(containerId);\r\n this._updateFn = this._update.bind(this);\r\n this.viewer.scene.postRender.addEventListener(this._updateFn);\r\n this._cameraChangedFn = this._scheduleOcclusionCheck.bind(this);\r\n this.viewer.camera.changed.addEventListener(this._cameraChangedFn);\r\n this.eventBus = eventBus || new MarkerEventBus();\r\n this.openWheel = openWheel;\r\n\r\n this.runOcclusionCheckNow();\r\n }\r\n\r\n /**\r\n * 创建标签容器\r\n */\r\n private _createContainer(id: string): HTMLDivElement {\r\n let container = document.getElementById(id) as HTMLDivElement;\r\n if (!container) {\r\n container = document.createElement('div');\r\n container.id = id;\r\n Object.assign(container.style, {\r\n position: 'absolute',\r\n top: '0',\r\n left: '0',\r\n pointerEvents: 'none',\r\n width: '100%',\r\n height: '100%',\r\n zIndex: '100',\r\n overflow: 'hidden',\r\n });\r\n document.body.appendChild(container);\r\n }\r\n return container;\r\n }\r\n\r\n /**\r\n * 注册标签主题\r\n */\r\n registerTheme(themeName: string, options: ThemeOptions) {\r\n this.themes[themeName] = options;\r\n }\r\n\r\n /**\r\n * 添加单个标签\r\n */\r\n add(data: any, options: LabelOptions) {\r\n const {\r\n id,\r\n lon,\r\n lat,\r\n height = 0,\r\n theme,\r\n show = true,\r\n notCreateElement = false,\r\n style,\r\n } = options;\r\n\r\n const themeOptions = this.themes[theme];\r\n if (!themeOptions) {\r\n console.warn(`Theme \"${theme}\" not registered`);\r\n return;\r\n }\r\n\r\n let label = this.labels.get(id);\r\n if (!label) {\r\n const el = document.createElement('div');\r\n Object.assign(el.style, {\r\n position: 'absolute',\r\n transform: 'translate(0, 0)',\r\n pointerEvents: 'auto',\r\n ...(options.style || {}),\r\n });\r\n\r\n // 绑定 DOM 事件到事件总线\r\n for (const [key, domEvent] of Object.entries(DOM_EVENT_MAP)) {\r\n el.addEventListener(domEvent, (e: Event) => {\r\n e.stopPropagation();\r\n const labelData = this.labels.get(id);\r\n this.eventBus.runListener(key as MarkerEventKey, labelData, e);\r\n });\r\n\r\n // 滚轮期间禁止点击\r\n let lastTime = 0;\r\n el.addEventListener('wheel', (event) => {\r\n if (!this.openWheel) return;\r\n const dom = event.currentTarget as HTMLElement;\r\n lastTime = Date.now();\r\n const currTime = lastTime;\r\n dom.style.pointerEvents = 'none';\r\n setTimeout(() => {\r\n if (lastTime === currTime) {\r\n dom.style.pointerEvents = 'auto';\r\n }\r\n }, 2000);\r\n });\r\n }\r\n\r\n let unload = null;\r\n if (!notCreateElement || show) {\r\n try {\r\n unload = themeOptions.createElement(el, { id, theme, data }, themeOptions) || {};\r\n } catch (err) {\r\n console.error(`Error updating label element for id \"${id}\":`, err);\r\n }\r\n this.container.appendChild(el);\r\n }\r\n label = { id, el, theme, data, notCreateElement, unload: unload };\r\n this.labels.set(id, label);\r\n } else {\r\n label.theme = theme;\r\n label.data = data;\r\n label.notCreateElement = notCreateElement;\r\n\r\n // 若已存在,则更新 DOM 内容\r\n try {\r\n label.unload = themeOptions.createElement(label.el, { id, theme, data }, themeOptions);\r\n if (!notCreateElement || show) {\r\n this.container.appendChild(label.el);\r\n }\r\n } catch (err) {\r\n console.error(`Error updating label element for id \"${id}\":`, err);\r\n }\r\n }\r\n\r\n // 存储坐标用于后续位置更新\r\n label.el.dataset.lon = String(lon);\r\n label.el.dataset.lat = String(lat);\r\n label.el.dataset.height = String(height);\r\n\r\n label.el.style.zIndex = style?.zIndex || '1';\r\n label.el.style.display = show ? 'block' : 'none';\r\n if (show) {\r\n this.activeIds.add(id);\r\n }\r\n if (!show) {\r\n this.occludedIds.delete(id);\r\n } else {\r\n this._scheduleOcclusionCheck();\r\n }\r\n }\r\n\r\n /**\r\n * 批量添加标签\r\n */\r\n addBatch(items: Array<{ data: any; options: LabelOptions }>) {\r\n for (const { data, options } of items) {\r\n this.add(data, options);\r\n }\r\n }\r\n\r\n /**\r\n * 根据 ID 批量移除标签\r\n */\r\n removeByIds(ids: string[]) {\r\n for (const id of ids) {\r\n const label = this.labels.get(id);\r\n if (label) {\r\n this.unloadByLabel(label);\r\n this.labels.delete(id);\r\n this.activeIds.delete(id);\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n }\r\n\r\n unloadByLabel(label: LabelInstance) {\r\n label.el.remove();\r\n if (label?.unload && typeof label.unload === 'function') label?.unload();\r\n label.unload = null;\r\n }\r\n\r\n /**\r\n * 移除所有标签\r\n */\r\n removeAll() {\r\n for (const label of this.labels.values()) {\r\n this.unloadByLabel(label);\r\n }\r\n this.labels.clear();\r\n this.activeIds.clear();\r\n this.occludedIds.clear();\r\n }\r\n\r\n /**\r\n * 更新标签的数据并刷新内容\r\n */\r\n update(id: string, newData: any) {\r\n const label = this.labels.get(id);\r\n if (!label) {\r\n console.warn(`Label with id \"${id}\" not found for update.`);\r\n return;\r\n }\r\n\r\n const theme = this.themes[label.theme];\r\n if (!theme) {\r\n console.warn(`Theme \"${label.theme}\" not registered.`);\r\n return;\r\n }\r\n\r\n try {\r\n theme.createElement(label.el, { id, theme: label.theme, data: newData }, theme);\r\n } catch (err) {\r\n console.error(`Failed to update label \"${id}\":`, err);\r\n }\r\n }\r\n\r\n /**\r\n * 根据 ID 批量隐藏标签\r\n */\r\n hideByIds(ids: string[]) {\r\n for (const id of ids) {\r\n const label = this.labels.get(id);\r\n if (label) {\r\n if (label.notCreateElement) {\r\n this.unloadByLabel(label);\r\n }\r\n label.el.style.display = 'none';\r\n this.activeIds.delete(id);\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 隐藏所有标签\r\n */\r\n hideAll() {\r\n for (const label of this.labels.values()) {\r\n if (label.notCreateElement) {\r\n this.unloadByLabel(label);\r\n }\r\n label.el.style.display = 'none';\r\n this.activeIds.delete(label.id);\r\n this.occludedIds.delete(label.id);\r\n }\r\n }\r\n\r\n /**\r\n * 条件过滤隐藏标签\r\n */\r\n hideFilter(filter: (data: any) => boolean) {\r\n for (const label of this.labels.values()) {\r\n if (!filter(label.data)) continue;\r\n if (label.notCreateElement) {\r\n this.unloadByLabel(label);\r\n }\r\n label.el.style.display = 'none';\r\n this.activeIds.delete(label.id);\r\n this.occludedIds.delete(label.id);\r\n }\r\n }\r\n\r\n /**\r\n * 根据 ID 显示标签\r\n */\r\n showByIds(ids: string[]) {\r\n for (const id of ids) {\r\n const label = this.labels.get(id);\r\n if (label) {\r\n if (label.notCreateElement || !label.el.parentNode) {\r\n this.container.appendChild(label.el);\r\n }\r\n if (!label.unload) {\r\n try {\r\n const themeOptions = this.themes[label.theme];\r\n if (!themeOptions) {\r\n console.warn(`Theme \"${label.theme}\" not registered`);\r\n return;\r\n }\r\n label.unload =\r\n themeOptions.createElement(\r\n label.el,\r\n { id, theme: label.theme, data: label.data },\r\n themeOptions,\r\n ) || {};\r\n } catch (err) {\r\n console.error(`Error creating label element for theme \"${label.theme}\":`, err);\r\n return;\r\n }\r\n }\r\n\r\n label.el.style.display = 'block';\r\n this.activeIds.add(id);\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n this._scheduleOcclusionCheck();\r\n }\r\n\r\n /**\r\n * 检查标签是否存在\r\n */\r\n has(id: string): boolean {\r\n return this.labels.has(id);\r\n }\r\n\r\n /**\r\n * 清空活跃 ID 列表(不影响 DOM)\r\n */\r\n reset() {\r\n for (const id of this.activeIds.values()) {\r\n let label = this.labels.get(id);\r\n label && this.unloadByLabel(label);\r\n }\r\n this.activeIds.clear();\r\n }\r\n\r\n /**\r\n * 清理当前未活跃的标签(隐藏而不移除 DOM)\r\n */\r\n cleanup() {\r\n for (const [id, label] of this.labels.entries()) {\r\n if (!this.activeIds.has(id)) {\r\n label.el.style.display = 'none';\r\n this.occludedIds.delete(id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 经纬度 -> 自动地形高度修正 -> Cartesian3 -> 屏幕坐标\r\n */\r\n async toWindowPositionByLonLat(lon: number, lat: number): Promise<any> {\r\n const Cesium = this.Cesium;\r\n const scene = this.viewer.scene;\r\n\r\n // 1. 经纬度列表\r\n const positions = [Cesium.Cartographic.fromDegrees(lon, lat)];\r\n\r\n // 2. 使用 clampToHeightMostDetailed 获取真实地形高度\r\n let heightResult;\r\n try {\r\n heightResult = await scene.clampToHeightMostDetailed(positions);\r\n } catch (e) {\r\n console.warn('clampToHeightMostDetailed failed, fallback to ellipsoid height.');\r\n }\r\n\r\n let finalHeight = 0;\r\n if (heightResult && heightResult[0] && heightResult[0].height != null) {\r\n finalHeight = heightResult[0].height; // 用户偏好:height[0].height\r\n } else {\r\n // 如果地形未开启,则 fallback 椭球高度\r\n finalHeight = 0;\r\n }\r\n\r\n // 3. 生成真实位置 Cartesian3\r\n const worldPos = Cesium.Cartesian3.fromDegrees(lon, lat, finalHeight);\r\n\r\n // 4. 转屏幕像素坐标\r\n return this.toWindowCoordinates(worldPos);\r\n }\r\n\r\n /**\r\n * 坐标转换:经纬度 -> 屏幕像素坐标\r\n */\r\n toWindowCoordinates(position: any): any {\r\n const scene = this.viewer.scene;\r\n const st = this.Cesium.SceneTransforms;\r\n if (typeof st?.wgs84ToWindowCoordinates === 'function') {\r\n return st.wgs84ToWindowCoordinates(scene, position);\r\n }\r\n if (typeof st?.worldToWindowCoordinates === 'function') {\r\n return st.worldToWindowCoordinates(scene, position);\r\n }\r\n\r\n console.warn('No compatible window coordinate transform function found.');\r\n return undefined;\r\n }\r\n\r\n /**\r\n * 检查经纬度是否有效\r\n * @param lon 经度\r\n * @param lat 纬度\r\n * @returns 是否有效\r\n */\r\n private _isValidCoordinate(lon: number, lat: number): boolean {\r\n // 检查是否为 NaN\r\n if (Number.isNaN(lon) || Number.isNaN(lat)) return false;\r\n // 检查是否为 0(用户要求 0,0 时不显示)\r\n if (lon === 0 && lat === 0) return false;\r\n // 检查是否在有效范围内\r\n if (lon < -180 || lon > 180 || lat < -90 || lat > 90) return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * 每帧刷新所有活跃标签的位置\r\n */\r\n private async _update() {\r\n for (const id of this.activeIds) {\r\n const label = this.labels.get(id);\r\n if (!label) continue;\r\n\r\n const lon = parseFloat(label.el.dataset.lon!);\r\n const lat = parseFloat(label.el.dataset.lat!);\r\n const height = parseFloat(label.el.dataset.height || '0');\r\n\r\n // 检查经纬度是否有效,无效则隐藏标签\r\n if (!this._isValidCoordinate(lon, lat)) {\r\n label.el.style.display = 'none';\r\n continue;\r\n }\r\n\r\n const position = this.Cesium.Cartesian3.fromDegrees(lon, lat, height);\r\n const screenPosition = this.toWindowCoordinates(position);\r\n\r\n if (this.Cesium.defined(screenPosition)) {\r\n const theme = this.themes[label.theme];\r\n const offset = theme.options?.offset || {};\r\n const offsetX = offset.x || 0;\r\n const offsetY = offset.y || 0;\r\n const occluded = this.occludedIds.has(id);\r\n\r\n label.el.style.left = `${screenPosition.x}px`;\r\n label.el.style.top = `${screenPosition.y}px`;\r\n label.el.style.transform = `translate(${offsetX}px, ${offsetY}px)`;\r\n label.el.style.display = occluded ? 'none' : 'block';\r\n } else {\r\n label.el.style.display = 'none';\r\n }\r\n }\r\n }\r\n\r\n private _scheduleOcclusionCheck() {\r\n if (!this.occlusionOptions.enabled) return;\r\n\r\n const now = Date.now();\r\n const throttleMs = Math.max(0, Number(this.occlusionOptions.throttleMs) || 0);\r\n const elapsed = now - this._lastOcclusionAt;\r\n const waitMs = Math.max(0, throttleMs - elapsed);\r\n\r\n if (waitMs === 0) {\r\n this.runOcclusionCheckNow();\r\n return;\r\n }\r\n\r\n if (this._occlusionTimer !== null) return;\r\n this._occlusionTimer = window.setTimeout(() => {\r\n this._occlusionTimer = null;\r\n this.runOcclusionCheckNow();\r\n }, waitMs);\r\n }\r\n\r\n private _pushOcclusionLog(log: OcclusionCheckLog) {\r\n if (!this.occlusionLogEnabled) return;\r\n this.occlusionCheckLogs.push(log);\r\n if (this.occlusionCheckLogs.length > this.occlusionLogMax) {\r\n this.occlusionCheckLogs.splice(0, this.occlusionCheckLogs.length - this.occlusionLogMax);\r\n }\r\n }\r\n\r\n private _computeLabelOccluded(\r\n id: string,\r\n worldPosition: any,\r\n windowPosition: any,\r\n lon?: number,\r\n lat?: number,\r\n height?: number,\r\n ): boolean {\r\n const scene = this.viewer?.scene;\r\n const camera = this.viewer?.camera;\r\n const Cesium = this.Cesium;\r\n if (!scene || !camera || !Cesium) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'runtime-missing',\r\n });\r\n return true;\r\n }\r\n\r\n if (!scene.pickPositionSupported || !windowPosition) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'pick-unsupported',\r\n });\r\n return true;\r\n }\r\n\r\n try {\r\n const pickedPosition = scene.pickPosition(windowPosition);\r\n if (!pickedPosition || !camera.positionWC) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'pick-empty',\r\n });\r\n return true;\r\n }\r\n const epsilon = Number(this.occlusionOptions.distanceEpsilon) || 0;\r\n const labelDistance = Cesium.Cartesian3.distance(camera.positionWC, worldPosition);\r\n const pickedDistance = Cesium.Cartesian3.distance(camera.positionWC, pickedPosition);\r\n const occluded = pickedDistance + epsilon < labelDistance;\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded,\r\n reason: 'distance-compare',\r\n epsilon,\r\n labelDistance,\r\n pickedDistance,\r\n });\r\n return occluded;\r\n } catch (error) {\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: true,\r\n reason: 'pick-error',\r\n });\r\n return true;\r\n }\r\n }\r\n\r\n runOcclusionCheckNow() {\r\n if (!this.occlusionOptions.enabled) {\r\n this.occludedIds.clear();\r\n return;\r\n }\r\n\r\n if (this._occlusionChecking) {\r\n this._occlusionPending = true;\r\n return;\r\n }\r\n\r\n this._occlusionChecking = true;\r\n try {\r\n for (const id of this.activeIds) {\r\n const label = this.labels.get(id);\r\n if (!label) {\r\n this.occludedIds.delete(id);\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n occluded: false,\r\n reason: 'label-missing',\r\n });\r\n continue;\r\n }\r\n\r\n const lon = parseFloat(label.el.dataset.lon!);\r\n const lat = parseFloat(label.el.dataset.lat!);\r\n const height = parseFloat(label.el.dataset.height || '0');\r\n if (!this._isValidCoordinate(lon, lat)) {\r\n this.occludedIds.delete(id);\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: false,\r\n reason: 'invalid-coordinate',\r\n });\r\n continue;\r\n }\r\n\r\n const worldPosition = this.Cesium.Cartesian3.fromDegrees(lon, lat, height);\r\n const screenPosition = this.toWindowCoordinates(worldPosition);\r\n if (!this.Cesium.defined(screenPosition)) {\r\n this.occludedIds.delete(id);\r\n this._pushOcclusionLog({\r\n timestamp: Date.now(),\r\n id,\r\n lon,\r\n lat,\r\n height,\r\n occluded: false,\r\n reason: 'screen-position-undefined',\r\n });\r\n continue;\r\n }\r\n\r\n const occluded = this._computeLabelOccluded(id, worldPosition, screenPosition, lon, lat, height);\r\n if (occluded) this.occludedIds.add(id);\r\n else this.occludedIds.delete(id);\r\n }\r\n } finally {\r\n this._lastOcclusionAt = Date.now();\r\n this._occlusionChecking = false;\r\n if (this._occlusionPending) {\r\n this._occlusionPending = false;\r\n this._scheduleOcclusionCheck();\r\n }\r\n }\r\n }\r\n\r\n setOcclusionEnabled(enabled: boolean) {\n this.occlusionOptions.enabled = Boolean(enabled);\n if (!this.occlusionOptions.enabled) {\n this.occludedIds.clear();\n if (this._occlusionTimer !== null) {\r\n clearTimeout(this._occlusionTimer);\r\n this._occlusionTimer = null;\r\n }\r\n } else {\r\n this.runOcclusionCheckNow();\r\n }\n }\n\n getOcclusionOptions(): OcclusionOptions {\n return {\n enabled: this.occlusionOptions.enabled,\n throttleMs: this.occlusionOptions.throttleMs,\n distanceEpsilon: this.occlusionOptions.distanceEpsilon,\n };\n }\n\n setOcclusionOptions(options: Partial<Pick<OcclusionOptions, 'throttleMs' | 'distanceEpsilon'>>) {\n if (options.throttleMs != null) {\n this.occlusionOptions.throttleMs = Math.max(0, Number(options.throttleMs) || 0);\n }\r\n if (options.distanceEpsilon != null) {\r\n this.occlusionOptions.distanceEpsilon = Math.max(0, Number(options.distanceEpsilon) || 0);\r\n }\r\n if (this.occlusionOptions.enabled) {\r\n this._scheduleOcclusionCheck();\r\n }\r\n }\r\n\r\n setOcclusionLogEnabled(enabled: boolean, clearExisting: boolean = false) {\r\n this.occlusionLogEnabled = Boolean(enabled);\r\n if (clearExisting) {\r\n this.occlusionCheckLogs = [];\r\n }\r\n }\r\n\r\n /**\r\n * 销毁标签池,清理监听器和 DOM\r\n */\r\n destroy() {\r\n this.viewer.scene.postRender.removeEventListener(this._updateFn);\r\n this.viewer.camera.changed.removeEventListener(this._cameraChangedFn);\r\n if (this._occlusionTimer !== null) {\r\n clearTimeout(this._occlusionTimer);\r\n this._occlusionTimer = null;\r\n }\r\n // this.container.remove();\r\n this.labels.clear();\r\n this.activeIds.clear();\r\n this.occludedIds.clear();\r\n }\r\n}\r\n"],"names":["MarkerEventKey","MarkerEventBus","key","listener","overwrite","map","existed","name","data","e","err","DOM_EVENT_MAP","HtmlOverlayLabelPool","Cesium","viewer","containerId","eventBus","openWheel","id","container","themeName","options","lon","lat","height","theme","show","notCreateElement","style","themeOptions","label","el","domEvent","labelData","lastTime","event","dom","currTime","unload","items","ids","newData","filter","scene","positions","heightResult","finalHeight","worldPos","position","st","screenPosition","offset","offsetX","offsetY","occluded","now","throttleMs","elapsed","waitMs","log","worldPosition","windowPosition","camera","pickedPosition","epsilon","labelDistance","pickedDistance","enabled","clearExisting"],"mappings":"AAAO,IAAKA,sBAAAA,OACVA,EAAA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ACnC,KAAK,iBAAiB,UAOzB,KAAK,qBAAA,KANL,KAAK,YAAY,MAAA,GACb,KAAK,oBAAoB,SAC3B,aAAa,KAAK,eAAe,GACjC,KAAK,kBAAkB;AAAA,EAK7B;AAAA,EAEA,sBAAwC;AACtC,WAAO;AAAA,MACL,SAAS,KAAK,iBAAiB;AAAA,MAC/B,YAAY,KAAK,iBAAiB;AAAA,MAClC,iBAAiB,KAAK,iBAAiB;AAAA,IAAA;AAAA,EAE3C;AAAA,EAEA,oBAAoB9C,GAA4E;AAC9F,IAAIA,EAAQ,cAAc,SACxB,KAAK,iBAAiB,aAAa,KAAK,IAAI,GAAG,OAAOA,EAAQ,UAAU,KAAK,CAAC,IAE5EA,EAAQ,mBAAmB,SAC7B,KAAK,iBAAiB,kBAAkB,KAAK,IAAI,GAAG,OAAOA,EAAQ,eAAe,KAAK,CAAC,IAEtF,KAAK,iBAAiB,WACxB,KAAK,wBAAA;AAAA,EAET;AAAA,EAEA,uBAAuB8C,GAAkBC,IAAyB,IAAO;AACvE,SAAK,sBAAsB,EAAQD,GAC/BC,MACF,KAAK,qBAAqB,CAAA;AAAA,EAE9B;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,SAAK,OAAO,MAAM,WAAW,oBAAoB,KAAK,SAAS,GAC/D,KAAK,OAAO,OAAO,QAAQ,oBAAoB,KAAK,gBAAgB,GAChE,KAAK,oBAAoB,SAC3B,aAAa,KAAK,eAAe,GACjC,KAAK,kBAAkB,OAGzB,KAAK,OAAO,MAAA,GACZ,KAAK,UAAU,MAAA,GACf,KAAK,YAAY,MAAA;AAAA,EACnB;AACF;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './src/markerBubble';
|
|
2
|
+
export * from './src/markerBubbleLine';
|
|
2
3
|
declare const CxMarkerBubble: import('../../../../utils/with-install').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
4
|
readonly text: {
|
|
4
5
|
readonly type: StringConstructor;
|
|
@@ -87,5 +88,90 @@ declare const CxMarkerBubble: import('../../../../utils/with-install').SFCWithIn
|
|
|
87
88
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
88
89
|
el: HTMLDivElement;
|
|
89
90
|
}, HTMLDivElement>>;
|
|
90
|
-
|
|
91
|
+
declare const CxMarkerBubbleLine: import('../../../../utils/with-install').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
92
|
+
readonly text: {
|
|
93
|
+
readonly type: StringConstructor;
|
|
94
|
+
readonly default: "文字";
|
|
95
|
+
};
|
|
96
|
+
readonly textStyle: {
|
|
97
|
+
readonly type: ObjectConstructor;
|
|
98
|
+
readonly default: () => {};
|
|
99
|
+
};
|
|
100
|
+
readonly lineStyle: {
|
|
101
|
+
readonly type: ObjectConstructor;
|
|
102
|
+
readonly default: () => {};
|
|
103
|
+
};
|
|
104
|
+
readonly isCanDraggable: {
|
|
105
|
+
readonly type: BooleanConstructor;
|
|
106
|
+
readonly default: false;
|
|
107
|
+
};
|
|
108
|
+
readonly onCanDraggable: {
|
|
109
|
+
readonly type: import('vue').PropType<() => boolean>;
|
|
110
|
+
};
|
|
111
|
+
readonly pixelOffset: {
|
|
112
|
+
readonly type: import('vue').PropType<import('./src/markerBubbleLine').BubbleLineOffset>;
|
|
113
|
+
readonly default: () => {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly otherOffset: {
|
|
119
|
+
readonly type: import('vue').PropType<import('./src/markerBubbleLine').BubbleLineOffset>;
|
|
120
|
+
readonly default: () => {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
126
|
+
setOtherOffset: (offset: import('./src/markerBubbleLine').BubbleLineOffset) => any;
|
|
127
|
+
setLineStake: (info: import('./src/markerBubbleLine').LineStakeInfo) => any;
|
|
128
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
129
|
+
readonly text: {
|
|
130
|
+
readonly type: StringConstructor;
|
|
131
|
+
readonly default: "文字";
|
|
132
|
+
};
|
|
133
|
+
readonly textStyle: {
|
|
134
|
+
readonly type: ObjectConstructor;
|
|
135
|
+
readonly default: () => {};
|
|
136
|
+
};
|
|
137
|
+
readonly lineStyle: {
|
|
138
|
+
readonly type: ObjectConstructor;
|
|
139
|
+
readonly default: () => {};
|
|
140
|
+
};
|
|
141
|
+
readonly isCanDraggable: {
|
|
142
|
+
readonly type: BooleanConstructor;
|
|
143
|
+
readonly default: false;
|
|
144
|
+
};
|
|
145
|
+
readonly onCanDraggable: {
|
|
146
|
+
readonly type: import('vue').PropType<() => boolean>;
|
|
147
|
+
};
|
|
148
|
+
readonly pixelOffset: {
|
|
149
|
+
readonly type: import('vue').PropType<import('./src/markerBubbleLine').BubbleLineOffset>;
|
|
150
|
+
readonly default: () => {
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly otherOffset: {
|
|
156
|
+
readonly type: import('vue').PropType<import('./src/markerBubbleLine').BubbleLineOffset>;
|
|
157
|
+
readonly default: () => {
|
|
158
|
+
x: number;
|
|
159
|
+
y: number;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
}>> & Readonly<{
|
|
163
|
+
onSetOtherOffset?: ((offset: import('./src/markerBubbleLine').BubbleLineOffset) => any) | undefined;
|
|
164
|
+
onSetLineStake?: ((info: import('./src/markerBubbleLine').LineStakeInfo) => any) | undefined;
|
|
165
|
+
}>, {
|
|
166
|
+
readonly text: string;
|
|
167
|
+
readonly textStyle: Record<string, any>;
|
|
168
|
+
readonly lineStyle: Record<string, any>;
|
|
169
|
+
readonly isCanDraggable: boolean;
|
|
170
|
+
readonly pixelOffset: import('./src/markerBubbleLine').BubbleLineOffset;
|
|
171
|
+
readonly otherOffset: import('./src/markerBubbleLine').BubbleLineOffset;
|
|
172
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
173
|
+
dragRef: HTMLDivElement;
|
|
174
|
+
lineRef: HTMLDivElement;
|
|
175
|
+
}, HTMLDivElement>>;
|
|
176
|
+
export { CxMarkerBubble, CxMarkerBubbleLine };
|
|
91
177
|
export default CxMarkerBubble;
|
|
@@ -40,6 +40,10 @@ declare const CxMarkerManage: import('../../../../utils/with-install').SFCWithIn
|
|
|
40
40
|
delete: (data: string[] | string) => void | undefined;
|
|
41
41
|
setMarkerAggregationEnabled: (enabled: boolean, count?: number) => void | undefined;
|
|
42
42
|
setDebugCurrentGridsEnabled: (enabled: boolean) => void | undefined;
|
|
43
|
+
setLabelOcclusionEnabled: (enabled: boolean) => void | undefined;
|
|
44
|
+
setLabelOcclusionDistanceEpsilon: (distanceEpsilon: number) => void | undefined;
|
|
45
|
+
setLabelOcclusionOptions: (options: any) => void | undefined;
|
|
46
|
+
getLabelOcclusionOptions: () => any;
|
|
43
47
|
initThemes: (data: any) => void | undefined;
|
|
44
48
|
setTagTheme: (data: any) => void | undefined;
|
|
45
49
|
setMaterial: (data: any) => void | undefined;
|
|
@@ -94,6 +98,10 @@ declare const CxMarkerManage: import('../../../../utils/with-install').SFCWithIn
|
|
|
94
98
|
delete: (data: string[] | string) => void | undefined;
|
|
95
99
|
setMarkerAggregationEnabled: (enabled: boolean, count?: number) => void | undefined;
|
|
96
100
|
setDebugCurrentGridsEnabled: (enabled: boolean) => void | undefined;
|
|
101
|
+
setLabelOcclusionEnabled: (enabled: boolean) => void | undefined;
|
|
102
|
+
setLabelOcclusionDistanceEpsilon: (distanceEpsilon: number) => void | undefined;
|
|
103
|
+
setLabelOcclusionOptions: (options: any) => void | undefined;
|
|
104
|
+
getLabelOcclusionOptions: () => any;
|
|
97
105
|
initThemes: (data: any) => void | undefined;
|
|
98
106
|
setTagTheme: (data: any) => void | undefined;
|
|
99
107
|
setMaterial: (data: any) => void | undefined;
|
|
@@ -141,6 +149,10 @@ declare const CxMarkerManage: import('../../../../utils/with-install').SFCWithIn
|
|
|
141
149
|
delete: (data: string[] | string) => void | undefined;
|
|
142
150
|
setMarkerAggregationEnabled: (enabled: boolean, count?: number) => void | undefined;
|
|
143
151
|
setDebugCurrentGridsEnabled: (enabled: boolean) => void | undefined;
|
|
152
|
+
setLabelOcclusionEnabled: (enabled: boolean) => void | undefined;
|
|
153
|
+
setLabelOcclusionDistanceEpsilon: (distanceEpsilon: number) => void | undefined;
|
|
154
|
+
setLabelOcclusionOptions: (options: any) => void | undefined;
|
|
155
|
+
getLabelOcclusionOptions: () => any;
|
|
144
156
|
initThemes: (data: any) => void | undefined;
|
|
145
157
|
setTagTheme: (data: any) => void | undefined;
|
|
146
158
|
setMaterial: (data: any) => void | undefined;
|
|
@@ -2,7 +2,7 @@ import { App } from 'vue';
|
|
|
2
2
|
import { default as CxMarkerDefault } from './components/marker-default';
|
|
3
3
|
import { default as CxMarkerHtml } from './components/marker-html';
|
|
4
4
|
import { default as CxMarkerText } from './components/marker-text';
|
|
5
|
-
import { default as CxMarkerBubble } from './components/marker-bubble';
|
|
5
|
+
import { default as CxMarkerBubble, CxMarkerBubbleLine } from './components/marker-bubble';
|
|
6
6
|
import { default as CxMarkerManage, MarkerManagerCore } from './components/marker-manage';
|
|
7
7
|
import { default as CxBasicVideo } from './components/basic-video';
|
|
8
8
|
import { default as CxCardContent } from './components/card-content';
|
|
@@ -25,12 +25,13 @@ declare const _default: {
|
|
|
25
25
|
};
|
|
26
26
|
export default _default;
|
|
27
27
|
export { useMarKerManage, MarkerManageOptions, MarkerManagerCore };
|
|
28
|
-
export { CxMarkerDefault, CxMarkerText, CxMarkerBubble, CxMarkerManage, CxBasicVideo, CxCardContent, CxCarouselImg, CxEchartsPro, CxCardPage, CxCardCarousel, CxBasicAudio, CxMarkerHtml, CxMeasurement, CxPositionPicker, };
|
|
28
|
+
export { CxMarkerDefault, CxMarkerText, CxMarkerBubble, CxMarkerBubbleLine, CxMarkerManage, CxBasicVideo, CxCardContent, CxCarouselImg, CxEchartsPro, CxCardPage, CxCardCarousel, CxBasicAudio, CxMarkerHtml, CxMeasurement, CxPositionPicker, };
|
|
29
29
|
declare module 'vue' {
|
|
30
30
|
interface GlobalComponents {
|
|
31
31
|
CxMarkerDefault: typeof CxMarkerDefault;
|
|
32
32
|
CxMarkerText: typeof CxMarkerText;
|
|
33
33
|
CxMarkerBubble: typeof CxMarkerBubble;
|
|
34
|
+
CxMarkerBubbleLine: typeof CxMarkerBubbleLine;
|
|
34
35
|
CxMarkerManage: typeof CxMarkerManage;
|
|
35
36
|
CxBasicVideo: typeof CxBasicVideo;
|
|
36
37
|
CxCardContent: typeof CxCardContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { defineComponent as ue, ref as
|
|
3
|
-
import { b as
|
|
4
|
-
const
|
|
1
|
+
import { p as oe, c as se, w as ie } from "../create-DynflqE1.js";
|
|
2
|
+
import { defineComponent as ue, ref as i, computed as C, openBlock as Q, createElementBlock as Z, normalizeClass as X, unref as E, createElementVNode as ee, normalizeStyle as j, toDisplayString as fe, createCommentVNode as ce, watch as re, onUnmounted as pe } from "vue";
|
|
3
|
+
import { b as ve, c as xe, d as he } from "../index-Kqi_S6KA.js";
|
|
4
|
+
const ye = {
|
|
5
5
|
text: { type: String, default: "文字" },
|
|
6
6
|
textStyle: {
|
|
7
7
|
type: Object,
|
|
@@ -29,102 +29,229 @@ const ve = {
|
|
|
29
29
|
onSetOtherOffset: {
|
|
30
30
|
type: Function
|
|
31
31
|
}
|
|
32
|
-
},
|
|
33
|
-
name: `${
|
|
32
|
+
}, de = /* @__PURE__ */ ue({
|
|
33
|
+
name: `${oe}-marker`,
|
|
34
34
|
__name: "MarkerBubble",
|
|
35
|
-
props:
|
|
35
|
+
props: ye,
|
|
36
36
|
emits: ["setOtherOffset"],
|
|
37
|
-
setup(
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
if (l <
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
} else if (l >
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
} else if (
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
} else if (
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
|
|
37
|
+
setup(te, { emit: ae }) {
|
|
38
|
+
const t = te, M = se("marker"), W = ae, D = i(), { width: _, height: L } = ve(D), P = i(!1), G = C(() => {
|
|
39
|
+
let r = t.otherOffset?.x || 0, O = t.otherOffset?.y || 0;
|
|
40
|
+
p.value && (t.isCanDraggable || P.value) && (r = w.value || 0, O = m.value || 0);
|
|
41
|
+
let B = (t.pixelOffset?.x || 0) + r, $ = (t.pixelOffset?.y || 0) + O, l = 0, a = 0, k = l + B, e = l + B + _.value / 2, s = l + B + _.value, u = a + $, x = a + $ + L.value / 2, g = a + $ + L.value, n = 0, o = 0, v = 0, f = 0, Y = 0, A = 0, le = 0, ne = 0, J = 24, b = 4, K = 4, c = "", F = "", R = "";
|
|
42
|
+
if (l < k && a >= u && a <= g) {
|
|
43
|
+
n = k, v = k;
|
|
44
|
+
let h = a < x ? u : x;
|
|
45
|
+
o = h + b, f = h + b + Math.min(J, L.value / 2 - b - K), c = "left";
|
|
46
|
+
} else if (l > s && a >= u && a <= g) {
|
|
47
|
+
n = s, v = s;
|
|
48
|
+
let h = a < x ? u : x;
|
|
49
|
+
o = h + b, f = h + b + Math.min(J, L.value / 2 - b - K), c = "right";
|
|
50
|
+
} else if (a < u) {
|
|
51
|
+
o = u, f = u;
|
|
52
|
+
let h = l < e ? k : e;
|
|
53
|
+
n = h + b, v = h + b + Math.min(J, _.value / 2 - b - K), c = "top";
|
|
54
|
+
} else if (a > g) {
|
|
55
|
+
o = g, f = g;
|
|
56
|
+
let h = l < e ? k : e;
|
|
57
|
+
n = h + b, v = h + b + Math.min(J, _.value / 2 - b - K), c = "bottom";
|
|
58
58
|
} else
|
|
59
|
-
|
|
60
|
-
l >=
|
|
61
|
-
let
|
|
62
|
-
(
|
|
63
|
-
let
|
|
59
|
+
n = 0, v = 0, o = 0, f = 0;
|
|
60
|
+
l >= n && l <= v ? (Y = Math.abs(l - n) + Math.abs(l - v), le = -Math.abs(l - n), F = "mid") : (Y = Math.max(Math.abs(l - n), Math.abs(l - v)), le = l < n ? 0 : -Y, F = l < n ? "left" : "right"), a >= o && a <= f ? (A = Math.abs(a - o) + Math.abs(a - f), ne = -Math.abs(a - o), R = "mid") : (A = Math.max(Math.abs(a - o), Math.abs(a - f)), ne = a < o ? 0 : -A, R = a < o ? "top" : "bottom");
|
|
61
|
+
let N = 0, T = 0, V = 0, z = 0, H = 0, U = 0;
|
|
62
|
+
(c == "top" || c == "bottom") && (T = c == "top" ? 0 : "100%", z = c == "top" ? "100%" : 0, U = c == "top" ? "100%" : 0, F == "left" ? (N = 0, V = n + "px", H = "100%") : F == "right" ? (N = "100%", V = 0, H = Math.abs(v - n) + "px") : F == "mid" && (N = Math.abs(l - n) + "px", V = 0, H = "100%")), (c == "left" || c == "right") && (N = c == "left" ? 0 : "100%", V = c == "left" ? "100%" : 0, H = c == "left" ? "100%" : 0, R == "top" ? (T = 0, z = o + "px", U = "100%") : R == "bottom" ? (T = "100%", z = 0, U = Math.abs(f - o) + "px") : R == "mid" && (T = Math.abs(a - o) + "px", z = 0, U = "100%"));
|
|
63
|
+
let be = `polygon(${N} ${T}, ${V} ${z},${H} ${U})`;
|
|
64
64
|
return {
|
|
65
|
-
...
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
68
|
-
clipPath:
|
|
65
|
+
...t.lineStyle,
|
|
66
|
+
width: Y + "px",
|
|
67
|
+
height: A + "px",
|
|
68
|
+
clipPath: be,
|
|
69
69
|
position: "absolute",
|
|
70
70
|
top: 0,
|
|
71
71
|
left: 0,
|
|
72
|
-
transform: `translate(${-
|
|
72
|
+
transform: `translate(${-B + le + r}px , ${-$ + ne + O}px)`
|
|
73
73
|
};
|
|
74
|
-
}),
|
|
74
|
+
}), y = i(0), d = i(0), w = i(0), m = i(0), p = i(!1), S = C(() => p.value && (t.isCanDraggable || P.value) ? {
|
|
75
75
|
width: "max-content",
|
|
76
|
-
transform: `translate(${
|
|
76
|
+
transform: `translate(${w.value}px, ${m.value}px)`
|
|
77
77
|
} : {
|
|
78
78
|
width: "max-content",
|
|
79
|
-
transform: `translate(${
|
|
80
|
-
}), { elementPositionX:
|
|
81
|
-
return
|
|
82
|
-
initialValue: { x:
|
|
79
|
+
transform: `translate(${t.otherOffset?.x || 0}px, ${t.otherOffset?.y || 0}px)`
|
|
80
|
+
}), { elementPositionX: q, elementPositionY: I } = xe(D);
|
|
81
|
+
return he(D, {
|
|
82
|
+
initialValue: { x: q.value, y: I.value },
|
|
83
83
|
onStart: () => {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
y.value = q.value, d.value = I.value, setTimeout(() => {
|
|
85
|
+
t.onCanDraggable && (P.value = t.onCanDraggable()), p.value = !0;
|
|
86
86
|
});
|
|
87
87
|
},
|
|
88
|
-
onMove: (
|
|
89
|
-
(
|
|
88
|
+
onMove: (r) => {
|
|
89
|
+
(t.isCanDraggable || P.value) && p.value && (w.value = r.x - y.value + (t.otherOffset?.x || 0), m.value = r.y - d.value + (t.otherOffset?.y || 0));
|
|
90
90
|
},
|
|
91
|
-
onEnd: (
|
|
92
|
-
if (!(
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
x:
|
|
97
|
-
y:
|
|
91
|
+
onEnd: (r) => {
|
|
92
|
+
if (!(r.x == 0 && r.y == 0) && !(r.x == y.value && r.y == d.value)) {
|
|
93
|
+
if (t.isCanDraggable || P.value) {
|
|
94
|
+
w.value = r.x - y.value + (t.otherOffset?.x || 0), m.value = r.y - d.value + (t.otherOffset?.y || 0);
|
|
95
|
+
const O = {
|
|
96
|
+
x: r.x - y.value + (t.otherOffset?.x || 0),
|
|
97
|
+
y: r.y - d.value + (t.otherOffset?.y || 0)
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
W("setOtherOffset", O);
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
p.value = !1;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
}), (
|
|
105
|
-
class:
|
|
104
|
+
}), (r, O) => (Q(), Z("div", {
|
|
105
|
+
class: X(E(M).b("bubble"))
|
|
106
106
|
}, [
|
|
107
|
-
|
|
107
|
+
ee("div", {
|
|
108
108
|
ref_key: "el",
|
|
109
|
-
ref:
|
|
110
|
-
style:
|
|
109
|
+
ref: D,
|
|
110
|
+
style: j(S.value)
|
|
111
111
|
}, [
|
|
112
|
-
|
|
112
|
+
t.text ? (Q(), Z("div", {
|
|
113
113
|
key: 0,
|
|
114
|
-
class:
|
|
115
|
-
style:
|
|
116
|
-
},
|
|
114
|
+
class: X(E(M).be("bubble", "name")),
|
|
115
|
+
style: j(t.textStyle)
|
|
116
|
+
}, fe(t.text), 7)) : ce("", !0)
|
|
117
117
|
], 4),
|
|
118
|
-
|
|
119
|
-
class:
|
|
120
|
-
style:
|
|
118
|
+
ee("div", {
|
|
119
|
+
class: X(E(M).be("bubble", "line")),
|
|
120
|
+
style: j(G.value)
|
|
121
121
|
}, null, 6)
|
|
122
122
|
], 2));
|
|
123
123
|
}
|
|
124
|
-
}),
|
|
124
|
+
}), me = {
|
|
125
|
+
text: { type: String, default: "文字" },
|
|
126
|
+
textStyle: {
|
|
127
|
+
type: Object,
|
|
128
|
+
default: () => ({})
|
|
129
|
+
},
|
|
130
|
+
lineStyle: {
|
|
131
|
+
type: Object,
|
|
132
|
+
default: () => ({})
|
|
133
|
+
},
|
|
134
|
+
isCanDraggable: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: !1
|
|
137
|
+
},
|
|
138
|
+
onCanDraggable: {
|
|
139
|
+
type: Function
|
|
140
|
+
},
|
|
141
|
+
pixelOffset: {
|
|
142
|
+
type: Object,
|
|
143
|
+
default: () => ({ x: 0, y: 0 })
|
|
144
|
+
},
|
|
145
|
+
otherOffset: {
|
|
146
|
+
type: Object,
|
|
147
|
+
default: () => ({ x: 0, y: 0 })
|
|
148
|
+
}
|
|
149
|
+
}, ge = /* @__PURE__ */ ue({
|
|
150
|
+
name: `${oe}-marker-bubble-line`,
|
|
151
|
+
__name: "MarkerBubbleLine",
|
|
152
|
+
props: me,
|
|
153
|
+
emits: ["setOtherOffset", "setLineStake"],
|
|
154
|
+
setup(te, { emit: ae }) {
|
|
155
|
+
const t = te, M = se("marker"), W = ae, D = i(), _ = i(), { width: L, height: P } = ve(D), G = i(!1), y = i(!1), d = i(null), w = i({ x: 0, y: 0 }), m = i({ x: 0, y: 0 }), p = i(t.otherOffset?.x ?? 0), S = i(t.otherOffset?.y ?? 0), q = C(() => t.isCanDraggable || G.value);
|
|
156
|
+
re(
|
|
157
|
+
() => t.otherOffset,
|
|
158
|
+
(e) => {
|
|
159
|
+
y.value || (p.value = e?.x ?? 0, S.value = e?.y ?? 0);
|
|
160
|
+
},
|
|
161
|
+
{ deep: !0, immediate: !0 }
|
|
162
|
+
);
|
|
163
|
+
const I = C(() => {
|
|
164
|
+
const e = (t.pixelOffset?.x ?? 0) + p.value, s = (t.pixelOffset?.y ?? 0) + S.value;
|
|
165
|
+
return {
|
|
166
|
+
x: e,
|
|
167
|
+
y: s,
|
|
168
|
+
width: L.value ?? 0,
|
|
169
|
+
height: P.value ?? 0
|
|
170
|
+
};
|
|
171
|
+
}), r = C(() => ({
|
|
172
|
+
width: "max-content",
|
|
173
|
+
transform: `translate(${I.value.x}px, ${I.value.y}px)`
|
|
174
|
+
})), O = C(() => {
|
|
175
|
+
const e = I.value, s = e.width / 2, u = e.height / 2, x = {
|
|
176
|
+
top: { x: e.x + s, y: e.y },
|
|
177
|
+
right: { x: e.x + e.width, y: e.y + u },
|
|
178
|
+
bottom: { x: e.x + s, y: e.y + e.height },
|
|
179
|
+
left: { x: e.x, y: e.y + u }
|
|
180
|
+
};
|
|
181
|
+
let g = "top", n = x.top, o = Number.POSITIVE_INFINITY;
|
|
182
|
+
return Object.keys(x).forEach((v) => {
|
|
183
|
+
const f = x[v], Y = f.x * f.x + f.y * f.y;
|
|
184
|
+
Y < o && (o = Y, g = v, n = f);
|
|
185
|
+
}), {
|
|
186
|
+
stake: g,
|
|
187
|
+
anchorPoint: n
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
re(
|
|
191
|
+
O,
|
|
192
|
+
(e) => {
|
|
193
|
+
W("setLineStake", e);
|
|
194
|
+
},
|
|
195
|
+
{ deep: !0, immediate: !0 }
|
|
196
|
+
);
|
|
197
|
+
const B = C(() => {
|
|
198
|
+
const { x: e, y: s } = O.value.anchorPoint, u = -e, x = -s, g = Math.hypot(u, x), n = Math.atan2(x, u) * (180 / Math.PI);
|
|
199
|
+
return {
|
|
200
|
+
position: "absolute",
|
|
201
|
+
top: 0,
|
|
202
|
+
left: 0,
|
|
203
|
+
pointerEvents: "auto",
|
|
204
|
+
transformOrigin: "0 50%",
|
|
205
|
+
height: "1px",
|
|
206
|
+
backgroundColor: "#fff",
|
|
207
|
+
...t.lineStyle,
|
|
208
|
+
width: `${g}px`,
|
|
209
|
+
transform: `translate(${e}px, ${s}px) rotate(${n}deg)`
|
|
210
|
+
};
|
|
211
|
+
}), $ = () => {
|
|
212
|
+
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a);
|
|
213
|
+
}, l = (e) => {
|
|
214
|
+
!y.value || d.value !== e.pointerId || (p.value = m.value.x + e.clientX - w.value.x, S.value = m.value.y + e.clientY - w.value.y);
|
|
215
|
+
}, a = (e) => {
|
|
216
|
+
if (d.value !== e.pointerId) return;
|
|
217
|
+
const s = { x: p.value, y: S.value }, u = s.x !== m.value.x || s.y !== m.value.y;
|
|
218
|
+
y.value = !1, d.value = null, $(), u && W("setOtherOffset", s);
|
|
219
|
+
}, k = (e) => {
|
|
220
|
+
t.onCanDraggable && (G.value = !!t.onCanDraggable()), q.value && (e.preventDefault(), d.value = e.pointerId, y.value = !0, w.value = { x: e.clientX, y: e.clientY }, m.value = { x: p.value, y: S.value }, window.addEventListener("pointermove", l), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a));
|
|
221
|
+
};
|
|
222
|
+
return pe(() => {
|
|
223
|
+
$();
|
|
224
|
+
}), (e, s) => (Q(), Z("div", {
|
|
225
|
+
class: X(E(M).b("bubble-line"))
|
|
226
|
+
}, [
|
|
227
|
+
ee("div", {
|
|
228
|
+
ref_key: "dragRef",
|
|
229
|
+
ref: D,
|
|
230
|
+
class: X(E(M).be("bubble-line", "drag")),
|
|
231
|
+
style: j(r.value),
|
|
232
|
+
onPointerdown: k
|
|
233
|
+
}, [
|
|
234
|
+
t.text ? (Q(), Z("div", {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: X(E(M).be("bubble-line", "name")),
|
|
237
|
+
style: j(t.textStyle)
|
|
238
|
+
}, fe(t.text), 7)) : ce("", !0)
|
|
239
|
+
], 38),
|
|
240
|
+
ee("div", {
|
|
241
|
+
ref_key: "lineRef",
|
|
242
|
+
ref: _,
|
|
243
|
+
class: X(E(M).be("bubble-line", "line")),
|
|
244
|
+
style: j(B.value),
|
|
245
|
+
onPointerdown: k
|
|
246
|
+
}, null, 38)
|
|
247
|
+
], 2));
|
|
248
|
+
}
|
|
249
|
+
}), ke = ie(de), De = ie(ge);
|
|
125
250
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
251
|
+
ke as CxMarkerBubble,
|
|
252
|
+
De as CxMarkerBubbleLine,
|
|
253
|
+
ke as default,
|
|
254
|
+
me as markerBubbleLineProps,
|
|
255
|
+
ye as markerBubbleProps
|
|
129
256
|
};
|
|
130
257
|
//# sourceMappingURL=marker-bubble.js.map
|