@baidumap/vue-bmap 1.0.0
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/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/components/Control/index.d.ts +186 -0
- package/dist/components/Layer/index.d.ts +138 -0
- package/dist/components/Map/Map.d.ts +340 -0
- package/dist/components/Map/MapRef.d.ts +204 -0
- package/dist/components/Map/index.d.ts +4 -0
- package/dist/components/Overlay/InfoWindow.d.ts +193 -0
- package/dist/components/Overlay/index.d.ts +50 -0
- package/dist/components/Overlay/types.d.ts +799 -0
- package/dist/composables/index.d.ts +12 -0
- package/dist/composables/useCapabilities.d.ts +5 -0
- package/dist/composables/useDriver.d.ts +5 -0
- package/dist/composables/useGeocoder.d.ts +17 -0
- package/dist/composables/useIcon.d.ts +5 -0
- package/dist/composables/useMap.d.ts +8 -0
- package/dist/composables/useMapEvent.d.ts +4 -0
- package/dist/composables/useMapReady.d.ts +11 -0
- package/dist/composables/useMapRef.d.ts +8 -0
- package/dist/composables/useServiceTimeout.d.ts +7 -0
- package/dist/composables/useSymbol.d.ts +5 -0
- package/dist/const/index.d.ts +19 -0
- package/dist/constants/index.d.ts +195 -0
- package/dist/context/index.d.ts +31 -0
- package/dist/drivers/capabilityMatrix.d.ts +3 -0
- package/dist/drivers/createDriver.d.ts +18 -0
- package/dist/drivers/types.d.ts +359 -0
- package/dist/drivers/unsupported.d.ts +66 -0
- package/dist/drivers/v3Driver.d.ts +13 -0
- package/dist/drivers/v4Driver.d.ts +15 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +4121 -0
- package/dist/index.js.map +1 -0
- package/dist/loader/index.d.ts +21 -0
- package/dist/loader/registry.d.ts +13 -0
- package/dist/loader/stableHash.d.ts +2 -0
- package/dist/provider/BMapProvider.d.ts +108 -0
- package/dist/types/core.d.ts +82 -0
- package/dist/types/index.d.ts +111 -0
- package/dist/types/results.d.ts +171 -0
- package/dist/types-skd.d.ts +21 -0
- package/dist/utils/createComponent.d.ts +51 -0
- package/dist/utils/debugWarn.d.ts +22 -0
- package/dist/utils/event.d.ts +7 -0
- package/dist/utils/handle.d.ts +16 -0
- package/dist/utils/pointEquals.d.ts +7 -0
- package/dist/utils/sdk.d.ts +47 -0
- package/dist/utils/shallowEqual.d.ts +2 -0
- package/dist/utils/stableStringify.d.ts +10 -0
- package/package.json +71 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4121 @@
|
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Gt = (o, a, r) => a in o ? xt(o, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[a] = r;
|
|
3
|
+
var Y = (o, a, r) => Gt(o, typeof a != "symbol" ? a + "" : a, r);
|
|
4
|
+
import { inject as F, defineComponent as w, shallowRef as Q, provide as Le, onMounted as At, onBeforeUnmount as Tt, watch as T, h as Zt, onUnmounted as ue, computed as K, onScopeDispose as se, ref as ce } from "vue";
|
|
5
|
+
const _t = Symbol("vue-bmap:context"), $ = Symbol("vue-bmap:map"), Me = Symbol("vue-bmap:overlay-target");
|
|
6
|
+
function ee() {
|
|
7
|
+
const o = F(_t, null);
|
|
8
|
+
if (!o)
|
|
9
|
+
throw new Error("[vue-bmap] 组件必须用在 <BMapProvider> 内部");
|
|
10
|
+
return o;
|
|
11
|
+
}
|
|
12
|
+
function xo() {
|
|
13
|
+
return F($, null);
|
|
14
|
+
}
|
|
15
|
+
function ye() {
|
|
16
|
+
const o = F($, null);
|
|
17
|
+
if (!o)
|
|
18
|
+
throw new Error("[vue-bmap] 组件必须用在 <Map> 内部");
|
|
19
|
+
return o;
|
|
20
|
+
}
|
|
21
|
+
const Ht = [
|
|
22
|
+
"Map.flyTo",
|
|
23
|
+
"Map.setHeading",
|
|
24
|
+
"Map.getHeading",
|
|
25
|
+
"Map.setTilt",
|
|
26
|
+
"Map.getTilt",
|
|
27
|
+
"Map.startViewAnimation",
|
|
28
|
+
"Map.pauseViewAnimation",
|
|
29
|
+
"Map.continueViewAnimation",
|
|
30
|
+
"Map.cancelViewAnimation",
|
|
31
|
+
"Map.restrictBounds",
|
|
32
|
+
"Map.setDisplayOptions",
|
|
33
|
+
"Map.setOptions",
|
|
34
|
+
"Map.enableRotate",
|
|
35
|
+
"Map.disableRotate",
|
|
36
|
+
"Map.enableTilt",
|
|
37
|
+
"Map.disableTilt",
|
|
38
|
+
"Map.enableRotateGestures",
|
|
39
|
+
"Map.disableRotateGestures",
|
|
40
|
+
"Map.enableTiltGestures",
|
|
41
|
+
"Map.disableTiltGestures",
|
|
42
|
+
"Map.enableResizeOnCenter",
|
|
43
|
+
"Map.disableResizeOnCenter"
|
|
44
|
+
], Wt = [
|
|
45
|
+
"NormalLayer",
|
|
46
|
+
"GeoJSONLayer",
|
|
47
|
+
"DistrictLayer",
|
|
48
|
+
"RasterTileLayer",
|
|
49
|
+
"WMSLayer",
|
|
50
|
+
"WMTSLayer",
|
|
51
|
+
"XYZLayer",
|
|
52
|
+
"MVTLayer",
|
|
53
|
+
"FillLayer",
|
|
54
|
+
"DOMLayer",
|
|
55
|
+
"PointIconLayer",
|
|
56
|
+
"PointShapeLayer",
|
|
57
|
+
"LineLayer",
|
|
58
|
+
"PixelLayer",
|
|
59
|
+
"BaiduLayer",
|
|
60
|
+
"ThreeLayer"
|
|
61
|
+
], Vt = [
|
|
62
|
+
"Map.addNormalLayer",
|
|
63
|
+
"Map.removeNormalLayer",
|
|
64
|
+
"Map.addGeoJSONLayer",
|
|
65
|
+
"Map.removeGeoJSONLayer",
|
|
66
|
+
"Map.addDistrictLayer",
|
|
67
|
+
"Map.removeDistrictLayer",
|
|
68
|
+
"Map.setTrafficOn",
|
|
69
|
+
"Map.setTrafficOff"
|
|
70
|
+
], Ut = [
|
|
71
|
+
// 注:Rectangle 在源码快照 publicListForMap.js 未导出,但运行时 CDN 版 BMapGL 存在(driver 实测可用)
|
|
72
|
+
"Prism",
|
|
73
|
+
"Rectangle",
|
|
74
|
+
"BezierCurve",
|
|
75
|
+
"CustomOverlay",
|
|
76
|
+
"GroundPoint",
|
|
77
|
+
"Marker3D",
|
|
78
|
+
"SimpleInfoWindow",
|
|
79
|
+
"MapMask"
|
|
80
|
+
], Yt = [
|
|
81
|
+
"NavigationControl3D",
|
|
82
|
+
"ZoomControl",
|
|
83
|
+
"LogoControl"
|
|
84
|
+
], Dt = [
|
|
85
|
+
"PlaceDetail",
|
|
86
|
+
"PlaceDetailPanel"
|
|
87
|
+
], Ft = [
|
|
88
|
+
"MapConfig",
|
|
89
|
+
"SVGSymbol",
|
|
90
|
+
"PolylineMultipart",
|
|
91
|
+
"ParkingSpot",
|
|
92
|
+
"IndoorManager",
|
|
93
|
+
"DistanceTool",
|
|
94
|
+
"Animation",
|
|
95
|
+
"ViewAnimation",
|
|
96
|
+
"Transitions",
|
|
97
|
+
"Event",
|
|
98
|
+
"GeoJSONParse",
|
|
99
|
+
"Entity",
|
|
100
|
+
"DrivingRouteLine",
|
|
101
|
+
"XYZProjection"
|
|
102
|
+
], jt = [
|
|
103
|
+
"Map.getScreenshot",
|
|
104
|
+
"Map.lnglatToMercator",
|
|
105
|
+
"Map.mercatorToLnglat",
|
|
106
|
+
"Map.isLoaded",
|
|
107
|
+
"Map.getCoordType",
|
|
108
|
+
"Map.getMinZoom",
|
|
109
|
+
"Map.getMaxZoom",
|
|
110
|
+
"Map.getContainerSize",
|
|
111
|
+
"Map.getZoomUnits",
|
|
112
|
+
"Map.addSpots",
|
|
113
|
+
"Map.getSpots",
|
|
114
|
+
"Map.removeSpots",
|
|
115
|
+
"Map.clearSpots",
|
|
116
|
+
"Map.hightlightSpotByUid",
|
|
117
|
+
"Map.addMapLabels",
|
|
118
|
+
"Map.removeMapLabels",
|
|
119
|
+
"Map.enablePreferredLanguage",
|
|
120
|
+
"Map.disablePreferredLanguage",
|
|
121
|
+
"Marker.openInfoWindow",
|
|
122
|
+
// 4.0+ Marker 打开信息窗口
|
|
123
|
+
"Map.destroy",
|
|
124
|
+
// 4.0+ 显式销毁
|
|
125
|
+
"Map.checkResize"
|
|
126
|
+
// 4.0+ resize API
|
|
127
|
+
], Jt = [
|
|
128
|
+
"Map.enableMapClick",
|
|
129
|
+
"Map.disableMapClick",
|
|
130
|
+
"Map.enable3DBuilding",
|
|
131
|
+
"Map.disable3DBuilding",
|
|
132
|
+
"Map.highResolutionEnabled",
|
|
133
|
+
"Map.setCurrentCity",
|
|
134
|
+
"Map.setPanorama",
|
|
135
|
+
"Map.getPanorama",
|
|
136
|
+
// Hotspot v4 也支持(publicListForMap.js 导出 + SpotManager),故归 COMMON 而非此处
|
|
137
|
+
"Map.openInfoWindow",
|
|
138
|
+
// 3.0-only map.openInfoWindow(v4 移到 Marker)
|
|
139
|
+
"Map.closeInfoWindow",
|
|
140
|
+
"Map.addTileLayer",
|
|
141
|
+
"Map.removeTileLayer",
|
|
142
|
+
"Map.getTileLayer"
|
|
143
|
+
], $t = [
|
|
144
|
+
"CustomLayer",
|
|
145
|
+
// v4 无此类(对应物是 CustomHtmlLayer/DOMLayer)
|
|
146
|
+
"PanoramaFlashInterface",
|
|
147
|
+
// v3 publish.js:82 导出,v4 无
|
|
148
|
+
"PointCollection"
|
|
149
|
+
// @removed 4.0,仅 v3(@baidumap/jsapi-v4-types 无此类)
|
|
150
|
+
], It = [
|
|
151
|
+
// 基础 Map 类(全版本)
|
|
152
|
+
"Map",
|
|
153
|
+
// 基础 Map 命令(全版本)
|
|
154
|
+
"Map.setCenter",
|
|
155
|
+
"Map.setZoom",
|
|
156
|
+
"Map.centerAndZoom",
|
|
157
|
+
"Map.panTo",
|
|
158
|
+
"Map.panBy",
|
|
159
|
+
"Map.setViewport",
|
|
160
|
+
"Map.getViewport",
|
|
161
|
+
"Map.zoomIn",
|
|
162
|
+
"Map.zoomOut",
|
|
163
|
+
"Map.reset",
|
|
164
|
+
"Map.getCenter",
|
|
165
|
+
"Map.getZoom",
|
|
166
|
+
"Map.getBounds",
|
|
167
|
+
"Map.getSize",
|
|
168
|
+
"Map.getDistance",
|
|
169
|
+
"Map.pointToPixel",
|
|
170
|
+
"Map.pixelToPoint",
|
|
171
|
+
"Map.pointToOverlayPixel",
|
|
172
|
+
"Map.overlayPixelToPoint",
|
|
173
|
+
// 交互开关(全版本)
|
|
174
|
+
"Map.enableDragging",
|
|
175
|
+
"Map.disableDragging",
|
|
176
|
+
"Map.enableScrollWheelZoom",
|
|
177
|
+
"Map.disableScrollWheelZoom",
|
|
178
|
+
"Map.enableDoubleClickZoom",
|
|
179
|
+
"Map.disableDoubleClickZoom",
|
|
180
|
+
"Map.enableKeyboard",
|
|
181
|
+
"Map.disableKeyboard",
|
|
182
|
+
"Map.enableInertialDragging",
|
|
183
|
+
"Map.disableInertialDragging",
|
|
184
|
+
"Map.enableContinuousZoom",
|
|
185
|
+
"Map.disableContinuousZoom",
|
|
186
|
+
"Map.enablePinchToZoom",
|
|
187
|
+
"Map.disablePinchToZoom",
|
|
188
|
+
"Map.enableAutoResize",
|
|
189
|
+
"Map.disableAutoResize",
|
|
190
|
+
// enableIconInfoWindow/disableIconInfoWindow:全版本可调用。3.0 下转发到
|
|
191
|
+
// enableMapClick/disableMapClick,其内部会异步加载 mapclick 模块,点击底图
|
|
192
|
+
// 标注本身就会创建并弹出 InfoWindow,效果与 4.0 基本等价,归入"全版本"。
|
|
193
|
+
"Map.enableIconInfoWindow",
|
|
194
|
+
"Map.disableIconInfoWindow",
|
|
195
|
+
// addControl/removeControl:v3 与 v4 均有(@baidumap/jsapi-v4-types core/Map.d.ts:730/743 确认 v4 存在)
|
|
196
|
+
"Map.addControl",
|
|
197
|
+
"Map.removeControl",
|
|
198
|
+
// 个性化样式:setMapStyle 两版本均有(v4 types core/Map.d.ts:870 确认);
|
|
199
|
+
// setMapStyleV2 v3Driver 实测可用,v4 同名转发,归 COMMON
|
|
200
|
+
"Map.setMapStyle",
|
|
201
|
+
"Map.setMapStyleV2",
|
|
202
|
+
"Map.clearOverlays",
|
|
203
|
+
"Map.getOverlays",
|
|
204
|
+
"Map.addOverlay",
|
|
205
|
+
"Map.removeOverlay",
|
|
206
|
+
// 覆盖物(全版本)
|
|
207
|
+
"Overlay",
|
|
208
|
+
// 公开抽象基类
|
|
209
|
+
"Marker",
|
|
210
|
+
"Label",
|
|
211
|
+
"Polyline",
|
|
212
|
+
"Polygon",
|
|
213
|
+
"Circle",
|
|
214
|
+
"GroundOverlay",
|
|
215
|
+
"InfoWindow",
|
|
216
|
+
"Symbol",
|
|
217
|
+
"Icon",
|
|
218
|
+
"IconSequence",
|
|
219
|
+
"Hotspot",
|
|
220
|
+
// 控件(全版本)
|
|
221
|
+
"Control",
|
|
222
|
+
// 公开抽象基类
|
|
223
|
+
"NavigationControl",
|
|
224
|
+
"ScaleControl",
|
|
225
|
+
"OverviewMapControl",
|
|
226
|
+
"MapTypeControl",
|
|
227
|
+
"CopyrightControl",
|
|
228
|
+
"Copyright",
|
|
229
|
+
"GeolocationControl",
|
|
230
|
+
"PanoramaControl",
|
|
231
|
+
"CityListControl",
|
|
232
|
+
// 注:LocationControl 的 SDK 类仅 4.0 存在,但 react-bmap 用 GeolocationControl 别名实现,两个版本均可用
|
|
233
|
+
"LocationControl",
|
|
234
|
+
// 图层(全版本)
|
|
235
|
+
"TileLayer",
|
|
236
|
+
"TrafficLayer",
|
|
237
|
+
"CanvasLayer",
|
|
238
|
+
"PanoramaCoverageLayer",
|
|
239
|
+
// 服务(全版本)
|
|
240
|
+
"LocalSearch",
|
|
241
|
+
"Geocoder",
|
|
242
|
+
"DrivingRoute",
|
|
243
|
+
"WalkingRoute",
|
|
244
|
+
"TransitRoute",
|
|
245
|
+
"RidingRoute",
|
|
246
|
+
"Geolocation",
|
|
247
|
+
"LocalCity",
|
|
248
|
+
"TruckRoute",
|
|
249
|
+
"BusLineSearch",
|
|
250
|
+
"Autocomplete",
|
|
251
|
+
"Boundary",
|
|
252
|
+
"Convertor",
|
|
253
|
+
"PanoramaService",
|
|
254
|
+
"RouteSearch",
|
|
255
|
+
// 坐标投影(全版本公开类)
|
|
256
|
+
"Projection",
|
|
257
|
+
"MercatorProjection",
|
|
258
|
+
"PerspectiveProjection",
|
|
259
|
+
// 全景(全版本)
|
|
260
|
+
"Panorama",
|
|
261
|
+
"PanoramaLabel",
|
|
262
|
+
// 右键菜单
|
|
263
|
+
"ContextMenu",
|
|
264
|
+
"MenuItem"
|
|
265
|
+
], qt = /* @__PURE__ */ new Set([...It, ...Jt, ...$t]), Xt = /* @__PURE__ */ new Set([
|
|
266
|
+
...It,
|
|
267
|
+
...Ht,
|
|
268
|
+
...Wt,
|
|
269
|
+
...Vt,
|
|
270
|
+
...Ut,
|
|
271
|
+
...Yt,
|
|
272
|
+
...Dt,
|
|
273
|
+
...jt,
|
|
274
|
+
...Ft
|
|
275
|
+
]), kt = {
|
|
276
|
+
"3.0": qt,
|
|
277
|
+
"4.0": Xt
|
|
278
|
+
};
|
|
279
|
+
function Qt(o) {
|
|
280
|
+
return typeof o == "object" && o !== null && "__brand" in o;
|
|
281
|
+
}
|
|
282
|
+
function wt(o) {
|
|
283
|
+
return Qt(o) ? o.raw : o;
|
|
284
|
+
}
|
|
285
|
+
function St(o, a) {
|
|
286
|
+
a !== void 0 ? ve(`${o} 调用失败:`, a) : ve(`${o} 调用失败`);
|
|
287
|
+
}
|
|
288
|
+
function ve(o, a) {
|
|
289
|
+
var r;
|
|
290
|
+
try {
|
|
291
|
+
const s = (r = globalThis.process) == null ? void 0 : r.env;
|
|
292
|
+
if ((s == null ? void 0 : s.NODE_ENV) === "production" || typeof console > "u") return;
|
|
293
|
+
a !== void 0 ? console.warn(`[react-bmap] ${o}`, a) : console.warn(`[react-bmap] ${o}`);
|
|
294
|
+
} catch {
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
class Ae extends Error {
|
|
298
|
+
constructor(a, r) {
|
|
299
|
+
super(`[react-bmap] ${a} is not supported in JSAPI ${r}`), this.capability = a, this.version = r, this.name = "UnsupportedCapabilityError";
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function M(o, a, r) {
|
|
303
|
+
if (r === "throw")
|
|
304
|
+
throw new Ae(o, a);
|
|
305
|
+
r === "warn" && typeof console < "u" && console.warn(`[react-bmap] ${o} not supported in JSAPI ${a} (noop)`);
|
|
306
|
+
}
|
|
307
|
+
function Kt(o) {
|
|
308
|
+
return o instanceof TypeError && /is not a (function|constructor)/.test(o.message);
|
|
309
|
+
}
|
|
310
|
+
function W(o, a, r, s) {
|
|
311
|
+
if (Kt(s)) {
|
|
312
|
+
M(o, a, r);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
St(o, s);
|
|
316
|
+
}
|
|
317
|
+
function S(o, a, r, s) {
|
|
318
|
+
return M(o, a, r), s;
|
|
319
|
+
}
|
|
320
|
+
function Go(o) {
|
|
321
|
+
try {
|
|
322
|
+
return { ok: !0, value: o() };
|
|
323
|
+
} catch (a) {
|
|
324
|
+
if (a instanceof Ae)
|
|
325
|
+
return { ok: !1, reason: "unsupported", capability: a.capability };
|
|
326
|
+
throw a;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function eo(o, a, r = 1e-7) {
|
|
330
|
+
return !o || !a ? o === a : Math.abs(o.lng - a.lng) <= r && Math.abs(o.lat - a.lat) <= r;
|
|
331
|
+
}
|
|
332
|
+
function to(o) {
|
|
333
|
+
if (!o) return null;
|
|
334
|
+
const a = o;
|
|
335
|
+
return typeof a.lng != "number" || typeof a.lat != "number" ? null : { lng: a.lng, lat: a.lat };
|
|
336
|
+
}
|
|
337
|
+
const ft = (o) => ({ __brand: "MapHandle", raw: o }), fe = (o, a) => ({ __brand: "OverlayHandle", raw: o, type: a }), oo = (o, a) => ({ __brand: "ControlHandle", raw: o, type: a }), ht = (o, a) => ({ __brand: "LayerHandle", raw: o, kind: a }), he = (o, a) => ({ __brand: "ServiceHandle", raw: o, isNull: a }), L = (o) => o.raw, y = (o) => L(o), mt = (o) => o.kind === "canvas", no = ["isNormalLayer", "isGeoJSONLayer", "isTileLayer", "isDistrictLayer", "isCustomHtmlLayer", "isWebGLLayer"], gt = (o) => {
|
|
338
|
+
var a;
|
|
339
|
+
return !o || no.some((r) => o[r]) ? o : (a = o.layer) != null && a.isTileLayer ? o.layer : o;
|
|
340
|
+
}, D = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet();
|
|
341
|
+
class io {
|
|
342
|
+
constructor(a) {
|
|
343
|
+
Y(this, "mapRaw");
|
|
344
|
+
Y(this, "markers", /* @__PURE__ */ new Set());
|
|
345
|
+
Y(this, "unsub", null);
|
|
346
|
+
Y(this, "rafId", null);
|
|
347
|
+
Y(this, "retryCount", 0);
|
|
348
|
+
Y(this, "pendingContainers", !1);
|
|
349
|
+
this.mapRaw = a;
|
|
350
|
+
const r = () => this.schedule();
|
|
351
|
+
try {
|
|
352
|
+
const s = () => r(), h = () => r();
|
|
353
|
+
a.addEventListener("moveend", s), a.addEventListener("zoomend", h), this.unsub = () => {
|
|
354
|
+
var c, p;
|
|
355
|
+
try {
|
|
356
|
+
(c = a.removeEventListener) == null || c.call(a, "moveend", s);
|
|
357
|
+
} catch {
|
|
358
|
+
}
|
|
359
|
+
try {
|
|
360
|
+
(p = a.removeEventListener) == null || p.call(a, "zoomend", h);
|
|
361
|
+
} catch {
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
} catch {
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
register(a) {
|
|
368
|
+
this.markers.add(a), D.set(a, { hidden: !1, userVisible: !0 }), Ce.set(a, this), this.retryCount = 0, this.schedule();
|
|
369
|
+
}
|
|
370
|
+
unregister(a) {
|
|
371
|
+
this.markers.delete(a), D.delete(a), Ce.delete(a);
|
|
372
|
+
}
|
|
373
|
+
clear() {
|
|
374
|
+
for (const a of this.markers) D.delete(a);
|
|
375
|
+
this.markers.clear();
|
|
376
|
+
}
|
|
377
|
+
schedule() {
|
|
378
|
+
this.rafId == null && (this.rafId = requestAnimationFrame(() => {
|
|
379
|
+
this.rafId = null, this.evaluate();
|
|
380
|
+
}));
|
|
381
|
+
}
|
|
382
|
+
evaluate() {
|
|
383
|
+
var s, h, c, p, d, u, C, v;
|
|
384
|
+
if (this.markers.size < 2) return;
|
|
385
|
+
const a = [];
|
|
386
|
+
for (const t of this.markers)
|
|
387
|
+
try {
|
|
388
|
+
const i = (s = t.getPosition) == null ? void 0 : s.call(t);
|
|
389
|
+
if (!i) continue;
|
|
390
|
+
const e = (c = (h = this.mapRaw).pointToPixel) == null ? void 0 : c.call(h, i);
|
|
391
|
+
if (!e || typeof e.x != "number") continue;
|
|
392
|
+
a.push({ raw: t, px: { x: e.x, y: e.y }, rank: ((p = t.getRank) == null ? void 0 : p.call(t)) ?? 0 });
|
|
393
|
+
} catch {
|
|
394
|
+
}
|
|
395
|
+
if (a.length < 2) return;
|
|
396
|
+
const r = 32 * 32;
|
|
397
|
+
for (const t of a) {
|
|
398
|
+
const i = D.get(t.raw);
|
|
399
|
+
i && (i.hidden = !1);
|
|
400
|
+
}
|
|
401
|
+
for (let t = 0; t < a.length; t++)
|
|
402
|
+
for (let i = t + 1; i < a.length; i++) {
|
|
403
|
+
const e = a[t], n = a[i], l = e.px.x - n.px.x, f = e.px.y - n.px.y;
|
|
404
|
+
if (l * l + f * f < r) {
|
|
405
|
+
if (e.rank > n.rank) {
|
|
406
|
+
const m = D.get(e.raw);
|
|
407
|
+
m && (m.hidden = !0);
|
|
408
|
+
} else if (n.rank > e.rank) {
|
|
409
|
+
const m = D.get(n.raw);
|
|
410
|
+
m && (m.hidden = !0);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
for (const t of a) {
|
|
415
|
+
const i = D.get(t.raw);
|
|
416
|
+
if (i)
|
|
417
|
+
try {
|
|
418
|
+
const e = t.raw._container ?? t.raw.domElement;
|
|
419
|
+
if (i.hidden && i.userVisible !== !1) {
|
|
420
|
+
try {
|
|
421
|
+
(u = (d = t.raw).hide) == null || u.call(d);
|
|
422
|
+
} catch {
|
|
423
|
+
}
|
|
424
|
+
e ? e.style.display = "none" : this.pendingContainers = !0;
|
|
425
|
+
} else if (!i.hidden && i.userVisible !== !1) {
|
|
426
|
+
e && (e.style.display = "");
|
|
427
|
+
try {
|
|
428
|
+
(v = (C = t.raw).show) == null || v.call(C);
|
|
429
|
+
} catch {
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
} catch {
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
this.pendingContainers && (this.pendingContainers = !1, this.retryCount++ < 5 && setTimeout(() => this.schedule(), 300));
|
|
436
|
+
}
|
|
437
|
+
destroy() {
|
|
438
|
+
var a;
|
|
439
|
+
(a = this.unsub) == null || a.call(this), this.rafId != null && cancelAnimationFrame(this.rafId), this.clear();
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function I(o, a) {
|
|
443
|
+
return !a || a instanceof o.Point ? a : new o.Point(a.lng, a.lat);
|
|
444
|
+
}
|
|
445
|
+
function X(o, a) {
|
|
446
|
+
if (!a) return a;
|
|
447
|
+
if (a.raw) return a.raw;
|
|
448
|
+
if (a.symbol && typeof a.symbol == "object") {
|
|
449
|
+
const p = a.symbol, d = p.path ?? p.shapeType;
|
|
450
|
+
if (d !== void 0) {
|
|
451
|
+
const u = {};
|
|
452
|
+
return p.anchor && (u.anchor = new o.Size(p.anchor.width, p.anchor.height)), typeof p.fillColor == "string" && (u.fillColor = p.fillColor), typeof p.fillOpacity == "number" && (u.fillOpacity = p.fillOpacity), typeof p.scale == "number" && (u.scale = p.scale), typeof p.rotation == "number" && (u.rotation = p.rotation), typeof p.strokeColor == "string" && (u.strokeColor = p.strokeColor), typeof p.strokeOpacity == "number" && (u.strokeOpacity = p.strokeOpacity), typeof p.strokeWeight == "number" && (u.strokeWeight = p.strokeWeight), new o.Symbol(d, u);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
if (!a.url) return a;
|
|
456
|
+
if (!a.size)
|
|
457
|
+
return console.warn("[react-bmap] PlainIcon.size is required"), a;
|
|
458
|
+
const r = new o.Size(a.size.width, a.size.height), s = typeof globalThis.BMapGL > "u", h = {};
|
|
459
|
+
if (a.imageOffset) {
|
|
460
|
+
const p = s ? new o.Size(-a.imageOffset.width, -a.imageOffset.height) : new o.Size(a.imageOffset.width, a.imageOffset.height);
|
|
461
|
+
h.imageOffset = p;
|
|
462
|
+
}
|
|
463
|
+
a.imageSize && (h.imageSize = new o.Size(a.imageSize.width, a.imageSize.height)), a.anchor && (h.anchor = new o.Size(a.anchor.width, a.anchor.height)), a.infoWindowAnchor && (h.infoWindowAnchor = new o.Size(a.infoWindowAnchor.width, a.infoWindowAnchor.height)), a.printImageUrl && (h.printImageUrl = a.printImageUrl), a.srcset && (h.srcset = a.srcset);
|
|
464
|
+
const c = new o.Icon(a.url, r, h);
|
|
465
|
+
return a.imageSize && typeof c.setImageSize == "function" && c.setImageSize(new o.Size(a.imageSize.width, a.imageSize.height)), c;
|
|
466
|
+
}
|
|
467
|
+
function E(o, a) {
|
|
468
|
+
return !a || a instanceof o.Size ? a : new o.Size(a.width ?? 0, a.height ?? 0);
|
|
469
|
+
}
|
|
470
|
+
const ao = {
|
|
471
|
+
url: { get: "getImageUrl", set: "setImageUrl" },
|
|
472
|
+
imageURL: { get: "getImageUrl", set: "setImageURL" }
|
|
473
|
+
};
|
|
474
|
+
function Mt(o) {
|
|
475
|
+
const a = ao[o];
|
|
476
|
+
if (a) return a;
|
|
477
|
+
const r = o.charAt(0).toUpperCase() + o.slice(1);
|
|
478
|
+
return { get: `get${r}`, set: `set${r}` };
|
|
479
|
+
}
|
|
480
|
+
function x(o, a) {
|
|
481
|
+
return Array.isArray(a) ? a.map((r) => I(o, r)) : a;
|
|
482
|
+
}
|
|
483
|
+
function ie(o, a) {
|
|
484
|
+
return Array.isArray(a) ? a.map((r) => x(o, r)) : a;
|
|
485
|
+
}
|
|
486
|
+
function Nt(o) {
|
|
487
|
+
return Array.isArray(o) && Array.isArray(o[0]);
|
|
488
|
+
}
|
|
489
|
+
function ge(o, a) {
|
|
490
|
+
return Nt(a) ? ie(o, a) : x(o, a);
|
|
491
|
+
}
|
|
492
|
+
function ne(o, a, r) {
|
|
493
|
+
a != null && a.node && (r.node = X(o, a.node)), a != null && a.nodeT && (r.nodeT = X(o, a.nodeT));
|
|
494
|
+
}
|
|
495
|
+
function pe(o, a) {
|
|
496
|
+
return !a || a instanceof o.Pixel ? a : new o.Pixel(a.x, a.y);
|
|
497
|
+
}
|
|
498
|
+
function j(o, a) {
|
|
499
|
+
return !a || a instanceof o.Bounds ? a : new o.Bounds(I(o, a.sw), I(o, a.ne));
|
|
500
|
+
}
|
|
501
|
+
function ae(o) {
|
|
502
|
+
return to(o);
|
|
503
|
+
}
|
|
504
|
+
function ro(o) {
|
|
505
|
+
if (!o) return null;
|
|
506
|
+
const a = typeof o.getSouthWest == "function" ? o.getSouthWest() : o.sw ?? o.southWest, r = typeof o.getNorthEast == "function" ? o.getNorthEast() : o.ne ?? o.northEast, s = ae(a), h = ae(r);
|
|
507
|
+
return !s || !h ? null : { sw: s, ne: h };
|
|
508
|
+
}
|
|
509
|
+
function vt(o) {
|
|
510
|
+
return o ? { width: o.width ?? 0, height: o.height ?? 0 } : null;
|
|
511
|
+
}
|
|
512
|
+
function Ct(o) {
|
|
513
|
+
return o ? { x: o.x ?? 0, y: o.y ?? 0 } : null;
|
|
514
|
+
}
|
|
515
|
+
function z(o, a) {
|
|
516
|
+
const r = a, s = {};
|
|
517
|
+
if (!r) return s;
|
|
518
|
+
for (const [h, c] of Object.entries(r))
|
|
519
|
+
c != null && (h === "children" || h === "visible" || h.startsWith("on") && h !== "onLocationStart" && h !== "onChangeBefore" && h !== "onChangeAfter" && h !== "onChangeSuccess" && h !== "onOpen" && h !== "onClose" || (h === "offset" || h === "size" ? s[h] = E(o, c) : h === "locationIcon" ? s[h] = X(o, c) : h === "mapTypes" && Array.isArray(c) ? s[h] = c.map((p) => p && typeof p == "object" && "raw" in p ? L(p) : p) : h !== "showStreetLayer" && h !== "copyrights" && (s[h] = c)));
|
|
520
|
+
return s;
|
|
521
|
+
}
|
|
522
|
+
function bt(o, a, r) {
|
|
523
|
+
var s;
|
|
524
|
+
if (Array.isArray(r))
|
|
525
|
+
for (const h of r) {
|
|
526
|
+
if (!h || typeof h != "object") continue;
|
|
527
|
+
const c = { ...h };
|
|
528
|
+
c.bounds && (c.bounds = j(o, c.bounds)), (s = a.addCopyright) == null || s.call(a, c);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
const so = /* @__PURE__ */ new Set([
|
|
532
|
+
"strokeColor",
|
|
533
|
+
"strokeWeight",
|
|
534
|
+
"strokeOpacity",
|
|
535
|
+
"strokeStyle",
|
|
536
|
+
"fillColor",
|
|
537
|
+
"fillOpacity",
|
|
538
|
+
"topFillColor",
|
|
539
|
+
"topFillOpacity",
|
|
540
|
+
"sideFillColor",
|
|
541
|
+
"sideFillOpacity",
|
|
542
|
+
"enableEditing",
|
|
543
|
+
"enableDragging",
|
|
544
|
+
"enableMassClear",
|
|
545
|
+
"radius",
|
|
546
|
+
"bounds",
|
|
547
|
+
"controlPoints",
|
|
548
|
+
"altitude",
|
|
549
|
+
"url",
|
|
550
|
+
"imageURL",
|
|
551
|
+
"displayOnMinLevel",
|
|
552
|
+
"displayOnMaxLevel",
|
|
553
|
+
"rotation",
|
|
554
|
+
"title",
|
|
555
|
+
"content",
|
|
556
|
+
"styles",
|
|
557
|
+
"opacity",
|
|
558
|
+
"height",
|
|
559
|
+
"fillColor",
|
|
560
|
+
"fillOpacity",
|
|
561
|
+
"shape",
|
|
562
|
+
"size",
|
|
563
|
+
"icon",
|
|
564
|
+
"anchor",
|
|
565
|
+
"zIndex",
|
|
566
|
+
"offset",
|
|
567
|
+
"size",
|
|
568
|
+
"scale",
|
|
569
|
+
"shape",
|
|
570
|
+
"color",
|
|
571
|
+
"path",
|
|
572
|
+
"imageOffset",
|
|
573
|
+
"imageSize",
|
|
574
|
+
"infoWindowAnchor",
|
|
575
|
+
"printImageUrl",
|
|
576
|
+
"srcset",
|
|
577
|
+
"text",
|
|
578
|
+
"userData",
|
|
579
|
+
"point",
|
|
580
|
+
"rotationInit",
|
|
581
|
+
"properties",
|
|
582
|
+
"rank",
|
|
583
|
+
"rotationOrigin",
|
|
584
|
+
// visible 不走 setOverlayOptions,由 showOverlay/hideOverlay 单独处理
|
|
585
|
+
"visible"
|
|
586
|
+
]), Ot = /* @__PURE__ */ new Set();
|
|
587
|
+
function lo(o, a) {
|
|
588
|
+
var s;
|
|
589
|
+
const r = (s = globalThis.process) == null ? void 0 : s.env;
|
|
590
|
+
if ((r == null ? void 0 : r.NODE_ENV) !== "production" && !(typeof console > "u"))
|
|
591
|
+
for (const h of Object.keys(a)) {
|
|
592
|
+
if (so.has(h)) continue;
|
|
593
|
+
const c = `${o}.${h}`;
|
|
594
|
+
Ot.has(c) || (Ot.add(c), console.warn(
|
|
595
|
+
`[react-bmap] ${o} 的 "${h}" 声明在 optionProps 里,但 v4Driver.setOverlayOptions 没有对应的 SDK setter 分支,运行时修改该 prop 不会生效。要么补上分支,要么把它移到 ctorOnlyProps(改动时重建覆盖物)。`
|
|
596
|
+
));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function Rt(o, a) {
|
|
600
|
+
const r = kt["4.0"], s = a.unsupportedBehavior, h = a.version ?? "4.0", c = (t, i) => {
|
|
601
|
+
try {
|
|
602
|
+
i();
|
|
603
|
+
} catch (e) {
|
|
604
|
+
if ((e == null ? void 0 : e.name) === "UnsupportedCapabilityError") throw e;
|
|
605
|
+
W(t, h, s, e);
|
|
606
|
+
}
|
|
607
|
+
}, p = (t, i, e) => {
|
|
608
|
+
try {
|
|
609
|
+
return i() ?? e;
|
|
610
|
+
} catch (n) {
|
|
611
|
+
if ((n == null ? void 0 : n.name) === "UnsupportedCapabilityError") throw n;
|
|
612
|
+
return W(t, h, s, n), e;
|
|
613
|
+
}
|
|
614
|
+
}, d = (t, i, e) => {
|
|
615
|
+
if (!r.has(t))
|
|
616
|
+
return M(t, h, s), null;
|
|
617
|
+
try {
|
|
618
|
+
return fe(i(), e);
|
|
619
|
+
} catch (n) {
|
|
620
|
+
return W(t, h, s, n), null;
|
|
621
|
+
}
|
|
622
|
+
}, u = (t, i, e) => {
|
|
623
|
+
if (!r.has(t))
|
|
624
|
+
return M(t, h, s), null;
|
|
625
|
+
try {
|
|
626
|
+
return oo(i(), e);
|
|
627
|
+
} catch (n) {
|
|
628
|
+
return W(t, h, s, n), null;
|
|
629
|
+
}
|
|
630
|
+
}, C = (t, i, e) => {
|
|
631
|
+
if (!r.has(t))
|
|
632
|
+
return M(t, h, s), null;
|
|
633
|
+
try {
|
|
634
|
+
return ht(i(), e);
|
|
635
|
+
} catch (n) {
|
|
636
|
+
return W(t, h, s, n), null;
|
|
637
|
+
}
|
|
638
|
+
}, v = (t, i) => {
|
|
639
|
+
if (!r.has(t)) return he(null, !0);
|
|
640
|
+
try {
|
|
641
|
+
return he(i(), !1);
|
|
642
|
+
} catch (e) {
|
|
643
|
+
return St(t, e), he(null, !0);
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
return {
|
|
647
|
+
version: h,
|
|
648
|
+
rawSDK: o,
|
|
649
|
+
capabilities: r,
|
|
650
|
+
unsupportedBehavior: s,
|
|
651
|
+
// ─────────────── 1. Map 工厂 ───────────────
|
|
652
|
+
createMap(t, i) {
|
|
653
|
+
const n = i && typeof i == "object" && Object.keys(i).length > 0 ? new o.Map(t, i) : new o.Map(t);
|
|
654
|
+
return q.set(n, new io(n)), ft(n);
|
|
655
|
+
},
|
|
656
|
+
destroyMap(t) {
|
|
657
|
+
var e, n, l, f, g;
|
|
658
|
+
const i = y(t);
|
|
659
|
+
me.add(i), (e = q.get(i)) == null || e.destroy(), q.delete(i);
|
|
660
|
+
try {
|
|
661
|
+
(n = i.clearOverlays) == null || n.call(i);
|
|
662
|
+
} catch {
|
|
663
|
+
}
|
|
664
|
+
try {
|
|
665
|
+
const m = ((l = i.getLayers) == null ? void 0 : l.call(i)) ?? [];
|
|
666
|
+
for (const b of m)
|
|
667
|
+
try {
|
|
668
|
+
(f = i.removeLayer) == null || f.call(i, b);
|
|
669
|
+
} catch {
|
|
670
|
+
}
|
|
671
|
+
} catch {
|
|
672
|
+
}
|
|
673
|
+
if (typeof i.destroy == "function")
|
|
674
|
+
try {
|
|
675
|
+
i.destroy();
|
|
676
|
+
} catch {
|
|
677
|
+
}
|
|
678
|
+
else {
|
|
679
|
+
const m = typeof i.getContainer == "function" ? i.getContainer() : null;
|
|
680
|
+
if (m) try {
|
|
681
|
+
(g = m.replaceChildren) == null || g.call(m);
|
|
682
|
+
} catch {
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
// ─────────────── 2. 交互开关 ───────────────
|
|
687
|
+
enableDragging: (t) => c("Map.enableDragging", () => y(t).enableDragging()),
|
|
688
|
+
disableDragging: (t) => c("Map.disableDragging", () => y(t).disableDragging()),
|
|
689
|
+
enableInertialDragging: (t) => c("Map.enableInertialDragging", () => y(t).enableInertialDragging()),
|
|
690
|
+
disableInertialDragging: (t) => c("Map.disableInertialDragging", () => y(t).disableInertialDragging()),
|
|
691
|
+
enableScrollWheelZoom: (t) => c("Map.enableScrollWheelZoom", () => y(t).enableScrollWheelZoom()),
|
|
692
|
+
disableScrollWheelZoom: (t) => c("Map.disableScrollWheelZoom", () => y(t).disableScrollWheelZoom()),
|
|
693
|
+
enableContinuousZoom: (t) => c("Map.enableContinuousZoom", () => y(t).enableContinuousZoom()),
|
|
694
|
+
disableContinuousZoom: (t) => c("Map.disableContinuousZoom", () => y(t).disableContinuousZoom()),
|
|
695
|
+
enableResizeOnCenter: (t) => c("Map.enableResizeOnCenter", () => y(t).enableResizeOnCenter()),
|
|
696
|
+
disableResizeOnCenter: (t) => c("Map.disableResizeOnCenter", () => y(t).disableResizeOnCenter()),
|
|
697
|
+
enableDoubleClickZoom: (t) => c("Map.enableDoubleClickZoom", () => y(t).enableDoubleClickZoom()),
|
|
698
|
+
disableDoubleClickZoom: (t) => c("Map.disableDoubleClickZoom", () => y(t).disableDoubleClickZoom()),
|
|
699
|
+
enableKeyboard: (t) => c("Map.enableKeyboard", () => y(t).enableKeyboard()),
|
|
700
|
+
disableKeyboard: (t) => c("Map.disableKeyboard", () => y(t).disableKeyboard()),
|
|
701
|
+
enablePinchToZoom: (t) => c("Map.enablePinchToZoom", () => y(t).enablePinchToZoom()),
|
|
702
|
+
disablePinchToZoom: (t) => c("Map.disablePinchToZoom", () => y(t).disablePinchToZoom()),
|
|
703
|
+
enableRotate: (t) => c("Map.enableRotate", () => y(t).enableRotate()),
|
|
704
|
+
disableRotate: (t) => c("Map.disableRotate", () => y(t).disableRotate()),
|
|
705
|
+
enableRotateGestures: (t) => c("Map.enableRotateGestures", () => y(t).enableRotateGestures()),
|
|
706
|
+
disableRotateGestures: (t) => c("Map.disableRotateGestures", () => y(t).disableRotateGestures()),
|
|
707
|
+
enableTilt: (t) => c("Map.enableTilt", () => y(t).enableTilt()),
|
|
708
|
+
disableTilt: (t) => c("Map.disableTilt", () => y(t).disableTilt()),
|
|
709
|
+
enableTiltGestures: (t) => c("Map.enableTiltGestures", () => y(t).enableTiltGestures()),
|
|
710
|
+
disableTiltGestures: (t) => c("Map.disableTiltGestures", () => y(t).disableTiltGestures()),
|
|
711
|
+
enableAutoResize: (t) => c("Map.enableAutoResize", () => y(t).enableAutoResize()),
|
|
712
|
+
disableAutoResize: (t) => c("Map.disableAutoResize", () => y(t).disableAutoResize()),
|
|
713
|
+
enableIconInfoWindow: (t) => c("Map.enableIconInfoWindow", () => y(t).enableIconInfoWindow()),
|
|
714
|
+
disableIconInfoWindow: (t) => c("Map.disableIconInfoWindow", () => y(t).disableIconInfoWindow()),
|
|
715
|
+
// ─────────────── 3. 视角 ───────────────
|
|
716
|
+
setHeading: (t, i, e) => c("Map.setHeading", () => y(t).setHeading(i, e)),
|
|
717
|
+
getHeading: (t) => p("Map.getHeading", () => y(t).getHeading(), NaN),
|
|
718
|
+
setTilt: (t, i, e) => c("Map.setTilt", () => y(t).setTilt(i, e)),
|
|
719
|
+
getTilt: (t) => p("Map.getTilt", () => y(t).getTilt(), NaN),
|
|
720
|
+
getCurrentMaxTilt: (t) => p("Map.getCurrentMaxTilt", () => y(t).getCurrentMaxTilt(), NaN),
|
|
721
|
+
// ─────────────── 4. 缩放级别 ───────────────
|
|
722
|
+
setMinZoom: (t, i) => c("Map.setMinZoom", () => y(t).setMinZoom(i)),
|
|
723
|
+
setMaxZoom: (t, i) => c("Map.setMaxZoom", () => y(t).setMaxZoom(i)),
|
|
724
|
+
getMinZoom: (t) => p("Map.getMinZoom", () => y(t).getMinZoom(), NaN),
|
|
725
|
+
getMaxZoom: (t) => p("Map.getMaxZoom", () => y(t).getMaxZoom(), NaN),
|
|
726
|
+
// ─────────────── 5. resize ───────────────
|
|
727
|
+
checkResize: (t) => c("Map.checkResize", () => y(t).checkResize()),
|
|
728
|
+
resize: (t) => c("Map.checkResize", () => {
|
|
729
|
+
var i, e;
|
|
730
|
+
return (e = (i = y(t)).checkResize) == null ? void 0 : e.call(i);
|
|
731
|
+
}),
|
|
732
|
+
setSize: (t, i) => c("Map.setSize", () => {
|
|
733
|
+
var e, n;
|
|
734
|
+
(n = (e = y(t)).setSize) == null || n.call(e, i);
|
|
735
|
+
}),
|
|
736
|
+
zoomTo: (t, i, e) => c("Map.zoomTo", () => {
|
|
737
|
+
var l, f;
|
|
738
|
+
const n = y(t);
|
|
739
|
+
e ? (l = n.zoomTo) == null || l.call(n, i, pe(o, e)) : (f = n.zoomTo) == null || f.call(n, i);
|
|
740
|
+
}),
|
|
741
|
+
// ─────────────── 6. 显示配置 ───────────────
|
|
742
|
+
setDisplayOptions: (t, i) => c("Map.setDisplayOptions", () => y(t).setDisplayOptions(i)),
|
|
743
|
+
setOptions: (t, i) => c("Map.setOptions", () => y(t).setOptions(i)),
|
|
744
|
+
// ─────────────── 7. 容器信息 ───────────────
|
|
745
|
+
getSize: (t) => p("Map.getSize", () => vt(y(t).getSize()) ?? { width: 0, height: 0 }, { width: 0, height: 0 }),
|
|
746
|
+
getContainerSize: (t) => p("Map.getContainerSize", () => vt(y(t).getContainerSize()) ?? { width: 0, height: 0 }, { width: 0, height: 0 }),
|
|
747
|
+
getZoomUnits: (t) => p("Map.getZoomUnits", () => y(t).getZoomUnits(), NaN),
|
|
748
|
+
getContainer: (t) => p("Map.getContainer", () => y(t).getContainer(), document.createElement("div")),
|
|
749
|
+
// ─────────────── 8. 坐标转换 ───────────────
|
|
750
|
+
pixelToPoint: (t, i, e) => p("Map.pixelToPoint", () => ae(y(t).pixelToPoint(pe(o, i), e)) ?? { lng: NaN, lat: NaN }, { lng: NaN, lat: NaN }),
|
|
751
|
+
pointToPixel: (t, i, e) => p("Map.pointToPixel", () => Ct(y(t).pointToPixel(I(o, i), e)) ?? { x: 0, y: 0 }, { x: 0, y: 0 }),
|
|
752
|
+
lnglatToMercator: (t, i, e) => p("Map.lnglatToMercator", () => y(t).lnglatToMercator(i, e) ?? [NaN, NaN], [NaN, NaN]),
|
|
753
|
+
mercatorToLnglat: (t, i, e) => p("Map.mercatorToLnglat", () => y(t).mercatorToLnglat(i, e) ?? [NaN, NaN], [NaN, NaN]),
|
|
754
|
+
pointToOverlayPixel: (t, i, e) => p("Map.pointToOverlayPixel", () => Ct(y(t).pointToOverlayPixel(I(o, i), e)) ?? { x: 0, y: 0 }, { x: 0, y: 0 }),
|
|
755
|
+
overlayPixelToPoint: (t, i, e) => p("Map.overlayPixelToPoint", () => ae(y(t).overlayPixelToPoint(pe(o, i), e)) ?? { lng: NaN, lat: NaN }, { lng: NaN, lat: NaN }),
|
|
756
|
+
getDistance: (t, i, e) => p("Map.getDistance", () => y(t).getDistance(I(o, i), I(o, e)), NaN),
|
|
757
|
+
// ─────────────── 9. 地图状态 ───────────────
|
|
758
|
+
isLoaded: (t) => p("Map.isLoaded", () => typeof y(t).isLoaded == "function" ? y(t).isLoaded() : !0, !0),
|
|
759
|
+
getCoordType: (t) => p("Map.getCoordType", () => y(t).getCoordType(), ""),
|
|
760
|
+
getMapTypeId: (t) => p("Map.getMapTypeId", () => {
|
|
761
|
+
var i, e, n, l;
|
|
762
|
+
return ((e = (i = y(t)).getMapTypeId) == null ? void 0 : e.call(i)) ?? ((l = (n = y(t)).getMapType) == null ? void 0 : l.call(n)) ?? "";
|
|
763
|
+
}, ""),
|
|
764
|
+
getMapCoordType: (t) => p("Map.getMapCoordType", () => {
|
|
765
|
+
var i, e;
|
|
766
|
+
return (e = (i = y(t)).getMapCoordType) == null ? void 0 : e.call(i);
|
|
767
|
+
}, ""),
|
|
768
|
+
getMapStyleId: (t) => p("Map.getMapStyleId", () => {
|
|
769
|
+
var i, e;
|
|
770
|
+
return (e = (i = y(t)).getMapStyleId) == null ? void 0 : e.call(i);
|
|
771
|
+
}, ""),
|
|
772
|
+
getAreaStyleId: (t) => p("Map.getAreaStyleId", () => {
|
|
773
|
+
var i, e;
|
|
774
|
+
return (e = (i = y(t)).getAreaStyleId) == null ? void 0 : e.call(i);
|
|
775
|
+
}, ""),
|
|
776
|
+
getRenderType: (t) => p("Map.getRenderType", () => {
|
|
777
|
+
var i, e;
|
|
778
|
+
return (e = (i = y(t)).getRenderType) == null ? void 0 : e.call(i);
|
|
779
|
+
}, ""),
|
|
780
|
+
isCanvasMap: (t) => p("Map.isCanvasMap", () => {
|
|
781
|
+
var i, e;
|
|
782
|
+
return ((e = (i = y(t)).isCanvasMap) == null ? void 0 : e.call(i)) ?? !1;
|
|
783
|
+
}, !1),
|
|
784
|
+
getProjection: (t) => p("Map.getProjection", () => {
|
|
785
|
+
var i, e;
|
|
786
|
+
return (e = (i = y(t)).getProjection) == null ? void 0 : e.call(i);
|
|
787
|
+
}, null),
|
|
788
|
+
getSolarInfo: (t, i) => p("Map.getSolarInfo", () => {
|
|
789
|
+
var e, n;
|
|
790
|
+
return (n = (e = y(t)).getSolarInfo) == null ? void 0 : n.call(e, i);
|
|
791
|
+
}, null),
|
|
792
|
+
getTileId: (t, i, e) => p("Map.getTileId", () => {
|
|
793
|
+
var n, l;
|
|
794
|
+
return (l = (n = y(t)).getTileId) == null ? void 0 : l.call(n, I(o, i), e);
|
|
795
|
+
}, ""),
|
|
796
|
+
getPoiByUid: (t, i, e) => c("Map.getPoiByUid", () => {
|
|
797
|
+
var n, l;
|
|
798
|
+
return (l = (n = y(t)).getPoiByUid) == null ? void 0 : l.call(n, i, e);
|
|
799
|
+
}),
|
|
800
|
+
getPanes: (t) => p("Map.getPanes", () => {
|
|
801
|
+
var i, e;
|
|
802
|
+
return (e = (i = y(t)).getPanes) == null ? void 0 : e.call(i);
|
|
803
|
+
}, null),
|
|
804
|
+
getInfoWindow: (t) => p("Map.getInfoWindow", () => {
|
|
805
|
+
var e, n;
|
|
806
|
+
const i = (n = (e = y(t)).getInfoWindow) == null ? void 0 : n.call(e);
|
|
807
|
+
return i ? fe(i, "infoWindow") : null;
|
|
808
|
+
}, null),
|
|
809
|
+
// ─────────────── 10. Spots / 标注 ───────────────
|
|
810
|
+
addSpots: (t, i, e) => p("Map.addSpots", () => y(t).addSpots(i, e) ?? "", ""),
|
|
811
|
+
getSpots: (t, i) => p("Map.getSpots", () => y(t).getSpots(i) ?? [], []),
|
|
812
|
+
removeSpots: (t, i) => c("Map.removeSpots", () => y(t).removeSpots(i)),
|
|
813
|
+
clearSpots: (t) => c("Map.clearSpots", () => y(t).clearSpots()),
|
|
814
|
+
resetSpotStatus: (t) => c("Map.resetSpotStatus", () => {
|
|
815
|
+
var i, e;
|
|
816
|
+
return (e = (i = y(t)).resetSpotStatus) == null ? void 0 : e.call(i);
|
|
817
|
+
}),
|
|
818
|
+
hightlightSpotByUid: (t, i, e) => c("Map.hightlightSpotByUid", () => y(t).hightlightSpotByUid(i, e)),
|
|
819
|
+
addAreaSpot: (t, i, e) => p("Map.addAreaSpot", () => y(t).addAreaSpot(i, e) ?? "", ""),
|
|
820
|
+
getAreaSpot: (t, i) => p("Map.getAreaSpot", () => y(t).getAreaSpot(i) ?? [], []),
|
|
821
|
+
removeAreaSpot: (t, i) => c("Map.removeAreaSpot", () => y(t).removeAreaSpot(i)),
|
|
822
|
+
clearAreaSpots: (t) => c("Map.clearAreaSpots", () => y(t).clearAreaSpots()),
|
|
823
|
+
clearLabels: (t) => c("Map.clearLabels", () => {
|
|
824
|
+
var i, e;
|
|
825
|
+
return (e = (i = y(t)).clearLabels) == null ? void 0 : e.call(i);
|
|
826
|
+
}),
|
|
827
|
+
addMapLabels: (t, i) => p("Map.addMapLabels", () => y(t).addMapLabels(i) ?? [], []),
|
|
828
|
+
removeMapLabels: (t, i) => c("Map.removeMapLabels", () => y(t).removeMapLabels(i)),
|
|
829
|
+
getIconByClickPosition: (t, i) => p("Map.getIconByClickPosition", () => {
|
|
830
|
+
var e, n;
|
|
831
|
+
return ((n = (e = y(t)).getIconByClickPosition) == null ? void 0 : n.call(e, pe(o, i))) ?? null;
|
|
832
|
+
}, null),
|
|
833
|
+
setBounds: (t, i) => c("Map.setBounds", () => {
|
|
834
|
+
var e, n;
|
|
835
|
+
return (n = (e = y(t)).setBounds) == null ? void 0 : n.call(e, j(o, i));
|
|
836
|
+
}),
|
|
837
|
+
// ─────────────── 11. 视野控制 ───────────────
|
|
838
|
+
centerAndZoom: (t, i, e, n) => c("Map.centerAndZoom", () => {
|
|
839
|
+
const l = y(t);
|
|
840
|
+
typeof i == "string" ? l.centerAndZoom(i, e, n) : l.centerAndZoom(I(o, i), e, n);
|
|
841
|
+
}),
|
|
842
|
+
panTo: (t, i, e) => c("Map.panTo", () => y(t).panTo(I(o, i), e)),
|
|
843
|
+
panBy: (t, i, e, n) => c("Map.panBy", () => y(t).panBy(i, e, n)),
|
|
844
|
+
flyTo: (t, i, e, n) => c("Map.flyTo", () => y(t).flyTo(I(o, i), e, n)),
|
|
845
|
+
reset: (t) => c("Map.reset", () => y(t).reset()),
|
|
846
|
+
setCenter: (t, i, e) => c("Map.setCenter", () => y(t).setCenter(typeof i == "string" ? i : I(o, i), e)),
|
|
847
|
+
getCenter: (t) => p("Map.getCenter", () => ae(y(t).getCenter()) ?? { lng: NaN, lat: NaN }, { lng: NaN, lat: NaN }),
|
|
848
|
+
setViewport: (t, i, e) => c("Map.setViewport", () => y(t).setViewport(Array.isArray(i) ? x(o, i) : i, e)),
|
|
849
|
+
getViewport: (t, i, e) => p("Map.getViewport", () => y(t).getViewport(Array.isArray(i) ? x(o, i) : i, e), null),
|
|
850
|
+
setZoom: (t, i, e) => c("Map.setZoom", () => y(t).setZoom(i, e)),
|
|
851
|
+
getZoom: (t) => p("Map.getZoom", () => y(t).getZoom(), NaN),
|
|
852
|
+
zoomIn: (t, i) => c("Map.zoomIn", () => y(t).zoomIn(i && I(o, i))),
|
|
853
|
+
zoomOut: (t, i) => c("Map.zoomOut", () => y(t).zoomOut(i && I(o, i))),
|
|
854
|
+
getBounds: (t) => p("Map.getBounds", () => ro(y(t).getBounds()) ?? { sw: { lng: NaN, lat: NaN }, ne: { lng: NaN, lat: NaN } }, { sw: { lng: NaN, lat: NaN }, ne: { lng: NaN, lat: NaN } }),
|
|
855
|
+
restrictBounds: (t, i) => c("Map.restrictBounds", () => y(t).restrictBounds(i ? j(o, i) : null)),
|
|
856
|
+
// ─────────────── 12. 地图类型 ───────────────
|
|
857
|
+
setMapType: (t, i) => c("Map.setMapType", () => y(t).setMapType(i)),
|
|
858
|
+
getMapType: (t) => p("Map.getMapType", () => {
|
|
859
|
+
var i, e;
|
|
860
|
+
return ((e = (i = y(t)).getMapType) == null ? void 0 : e.call(i)) ?? "";
|
|
861
|
+
}, ""),
|
|
862
|
+
// ─────────────── 13. 控件 / 右键菜单 ───────────────
|
|
863
|
+
addControl: (t, i) => c("Map.addControl", () => y(t).addControl(L(i))),
|
|
864
|
+
removeControl: (t, i) => c("Map.removeControl", () => y(t).removeControl(L(i))),
|
|
865
|
+
setControlOptions: (t, i) => {
|
|
866
|
+
var e, n, l, f, g, m, b, P;
|
|
867
|
+
try {
|
|
868
|
+
const O = L(t), A = z(o, i);
|
|
869
|
+
if (A.anchor !== void 0 && ((e = O.setAnchor) == null || e.call(O, A.anchor)), A.offset !== void 0 && ((n = O.setOffset) == null || n.call(O, A.offset)), t.type === "navigation" && A.type !== void 0 && ((l = O.setType) == null || l.call(O, A.type)), t.type === "scale" && (i == null ? void 0 : i.unit) !== void 0 && ((f = O.setUnit) == null || f.call(O, i.unit)), t.type === "overview" && (A.size !== void 0 && ((g = O.setSize) == null || g.call(O, A.size)), (i == null ? void 0 : i.isOpen) !== void 0)) {
|
|
870
|
+
const k = typeof O.isOpen == "function" ? O.isOpen() : (m = O._opts) == null ? void 0 : m.isOpen, N = i.isOpen;
|
|
871
|
+
k !== N && ((b = O.changeView) == null || b.call(O));
|
|
872
|
+
}
|
|
873
|
+
(t.type === "geolocation" || t.type === "location") && O.setOptions && O.setOptions(A), t.type === "mapType" && (i == null ? void 0 : i.showStreetLayer) !== void 0 && ((P = O.showStreetLayer) == null || P.call(O, i.showStreetLayer)), t.type === "copyright" && bt(o, O, i == null ? void 0 : i.copyrights);
|
|
874
|
+
} catch {
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
showControl: (t) => {
|
|
878
|
+
var i, e;
|
|
879
|
+
try {
|
|
880
|
+
(e = (i = L(t)).show) == null || e.call(i);
|
|
881
|
+
} catch {
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
hideControl: (t) => {
|
|
885
|
+
var i, e;
|
|
886
|
+
try {
|
|
887
|
+
(e = (i = L(t)).hide) == null || e.call(i);
|
|
888
|
+
} catch {
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
addContextMenu: (t, i) => c("Map.addContextMenu", () => L(t).addContextMenu(L(i))),
|
|
892
|
+
removeContextMenu: (t, i) => {
|
|
893
|
+
var n;
|
|
894
|
+
const e = L(t);
|
|
895
|
+
me.has(e) || me.has((n = e == null ? void 0 : e.getMap) == null ? void 0 : n.call(e)) || c("Map.removeContextMenu", () => e.removeContextMenu(L(i)));
|
|
896
|
+
},
|
|
897
|
+
// ─────────────── 14. 覆盖物 ───────────────
|
|
898
|
+
addOverlay: (t, i) => {
|
|
899
|
+
var n, l;
|
|
900
|
+
c("Map.addOverlay", () => y(t).addOverlay(L(i)));
|
|
901
|
+
const e = L(i);
|
|
902
|
+
(n = e == null ? void 0 : e._config) != null && n.enableCollisionDetection && ((l = q.get(y(t))) == null || l.register(e));
|
|
903
|
+
},
|
|
904
|
+
removeOverlay: (t, i) => {
|
|
905
|
+
var n, l;
|
|
906
|
+
const e = L(i);
|
|
907
|
+
(n = q.get(y(t))) == null || n.unregister(e);
|
|
908
|
+
try {
|
|
909
|
+
(l = e == null ? void 0 : e.disableEditing) == null || l.call(e);
|
|
910
|
+
} catch {
|
|
911
|
+
}
|
|
912
|
+
c("Map.removeOverlay", () => y(t).removeOverlay(e));
|
|
913
|
+
},
|
|
914
|
+
clearOverlays: (t) => {
|
|
915
|
+
var i;
|
|
916
|
+
(i = q.get(y(t))) == null || i.clear(), c("Map.clearOverlays", () => y(t).clearOverlays());
|
|
917
|
+
},
|
|
918
|
+
getOverlays: (t) => p("Map.getOverlays", () => (y(t).getOverlays() ?? []).map((i) => fe(i, co(i))), []),
|
|
919
|
+
// Label 挂到 Marker:marker.setLabel 会把 label 定位到 marker 的 point,并随 marker 定位/拖拽跟随。
|
|
920
|
+
setMarkerLabel: (t, i) => c("Marker.setLabel", () => {
|
|
921
|
+
var e, n;
|
|
922
|
+
return (n = (e = L(t)) == null ? void 0 : e.setLabel) == null ? void 0 : n.call(e, L(i));
|
|
923
|
+
}),
|
|
924
|
+
// SDK 没有官方「解除 label」API(setLabel(null) 会因 instanceof 检查被忽略):
|
|
925
|
+
// 兜底隐藏 label 实例并清掉 marker 内部引用,避免 label 组件卸载后残留在 marker 上。
|
|
926
|
+
removeMarkerLabel: (t, i) => {
|
|
927
|
+
var e, n, l, f;
|
|
928
|
+
try {
|
|
929
|
+
(n = (e = L(i)) == null ? void 0 : e.hide) == null || n.call(e);
|
|
930
|
+
const g = L(t);
|
|
931
|
+
g != null && g._config && g._config.label === L(i) && (g._config.label = null);
|
|
932
|
+
try {
|
|
933
|
+
(f = g == null ? void 0 : g.setPoint) == null || f.call(g, ((l = g.getPosition) == null ? void 0 : l.call(g)) ?? g.point);
|
|
934
|
+
} catch {
|
|
935
|
+
}
|
|
936
|
+
} catch {
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
// ─────────────── 15. 图层 ───────────────
|
|
940
|
+
addLayer: (t, i) => {
|
|
941
|
+
if (mt(i)) {
|
|
942
|
+
c("Map.addOverlay", () => y(t).addOverlay(L(i)));
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
c("Map.addLayer", () => y(t).addLayer(gt(L(i))));
|
|
946
|
+
},
|
|
947
|
+
removeLayer: (t, i) => {
|
|
948
|
+
if (mt(i)) {
|
|
949
|
+
c("Map.removeOverlay", () => y(t).removeOverlay(L(i)));
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
c("Map.removeLayer", () => y(t).removeLayer(gt(L(i))));
|
|
953
|
+
},
|
|
954
|
+
addTileLayer: (t, i) => c("Map.addTileLayer", () => y(t).addTileLayer(L(i))),
|
|
955
|
+
removeTileLayer: (t, i) => c("Map.removeTileLayer", () => y(t).removeTileLayer(L(i))),
|
|
956
|
+
getTileLayer: (t, i) => {
|
|
957
|
+
var n, l;
|
|
958
|
+
if (!r.has("Map.getTileLayer"))
|
|
959
|
+
return M("Map.getTileLayer", h, s), null;
|
|
960
|
+
const e = (l = (n = y(t)).getTileLayer) == null ? void 0 : l.call(n, i);
|
|
961
|
+
return e ? ht(e, "tile") : null;
|
|
962
|
+
},
|
|
963
|
+
addGeoJSONLayer: (t, i) => c("Map.addGeoJSONLayer", () => y(t).addGeoJSONLayer(L(i))),
|
|
964
|
+
removeGeoJSONLayer: (t, i) => c("Map.removeGeoJSONLayer", () => y(t).removeGeoJSONLayer(L(i))),
|
|
965
|
+
addDistrictLayer: (t, i) => c("Map.addDistrictLayer", () => y(t).addDistrictLayer(L(i))),
|
|
966
|
+
removeDistrictLayer: (t, i) => c("Map.removeDistrictLayer", () => y(t).removeDistrictLayer(L(i))),
|
|
967
|
+
addNormalLayer: (t, i) => c("Map.addNormalLayer", () => y(t).addNormalLayer(L(i))),
|
|
968
|
+
removeNormalLayer: (t, i) => c("Map.removeNormalLayer", () => y(t).removeNormalLayer(L(i))),
|
|
969
|
+
setTrafficOn: (t) => c("Map.setTrafficOn", () => y(t).setTrafficOn()),
|
|
970
|
+
setTrafficOff: (t) => c("Map.setTrafficOff", () => y(t).setTrafficOff()),
|
|
971
|
+
showOverlayContainer: (t) => c("Map.showOverlayContainer", () => {
|
|
972
|
+
var i, e;
|
|
973
|
+
return (e = (i = y(t)).showOverlayContainer) == null ? void 0 : e.call(i);
|
|
974
|
+
}),
|
|
975
|
+
hideOverlayContainer: (t) => c("Map.hideOverlayContainer", () => {
|
|
976
|
+
var i, e;
|
|
977
|
+
return (e = (i = y(t)).hideOverlayContainer) == null ? void 0 : e.call(i);
|
|
978
|
+
}),
|
|
979
|
+
// ─────────────── 16. 信息窗口(v4 由 Marker 承载) ───────────────
|
|
980
|
+
openInfoWindow: (t, i, e) => {
|
|
981
|
+
const n = L(t);
|
|
982
|
+
typeof n.openInfoWindow == "function" ? c("Marker.openInfoWindow", () => n.openInfoWindow(L(i), e && I(o, e))) : M("Marker.openInfoWindow", h, s);
|
|
983
|
+
},
|
|
984
|
+
closeInfoWindow: (t) => c("Map.closeInfoWindow", () => {
|
|
985
|
+
var i, e;
|
|
986
|
+
return (e = (i = L(t)).closeInfoWindow) == null ? void 0 : e.call(i);
|
|
987
|
+
}),
|
|
988
|
+
openSimpleInfoWindow: (t, i, e) => c("Map.openSimpleInfoWindow", () => {
|
|
989
|
+
var n, l;
|
|
990
|
+
return (l = (n = y(t)).openSimpleInfoWindow) == null ? void 0 : l.call(n, L(i), I(o, e));
|
|
991
|
+
}),
|
|
992
|
+
closeSimpleInfoWindow: (t) => c("Map.closeSimpleInfoWindow", () => {
|
|
993
|
+
var i, e;
|
|
994
|
+
return (e = (i = y(t)).closeSimpleInfoWindow) == null ? void 0 : e.call(i);
|
|
995
|
+
}),
|
|
996
|
+
// ─────────────── 17. 样式 / 主题 ───────────────
|
|
997
|
+
setMapStyle: (t, i) => c("Map.setMapStyle", () => y(t).setMapStyle(i)),
|
|
998
|
+
setMapStyleV2: (t, i) => c("Map.setMapStyleV2", () => y(t).setMapStyleV2(i)),
|
|
999
|
+
setTheme: (t, i, e) => c("Map.setTheme", () => y(t).setTheme(i, e)),
|
|
1000
|
+
setCopyrightOffset: (t, i, e) => c("Map.setCopyrightOffset", () => y(t).setCopyrightOffset(i, e)),
|
|
1001
|
+
setDefaultCursor: (t, i) => c("Map.setDefaultCursor", () => y(t).setDefaultCursor(i)),
|
|
1002
|
+
getDefaultCursor: (t) => p("Map.getDefaultCursor", () => {
|
|
1003
|
+
var i, e;
|
|
1004
|
+
return ((e = (i = y(t)).getDefaultCursor) == null ? void 0 : e.call(i)) ?? "";
|
|
1005
|
+
}, ""),
|
|
1006
|
+
setDraggingCursor: (t, i) => c("Map.setDraggingCursor", () => y(t).setDraggingCursor(i)),
|
|
1007
|
+
getDraggingCursor: (t) => p("Map.getDraggingCursor", () => {
|
|
1008
|
+
var i, e;
|
|
1009
|
+
return ((e = (i = y(t)).getDraggingCursor) == null ? void 0 : e.call(i)) ?? "";
|
|
1010
|
+
}, ""),
|
|
1011
|
+
setOverlayMoveCursor: (t, i) => c("Map.setOverlayMoveCursor", () => {
|
|
1012
|
+
var e, n;
|
|
1013
|
+
return (n = (e = y(t)).setOverlayMoveCursor) == null ? void 0 : n.call(e, i);
|
|
1014
|
+
}),
|
|
1015
|
+
// ─────────────── 18. 视角动画 ───────────────
|
|
1016
|
+
// pause/continue/cancel 在没有进行中的动画时会抛 TypeError(读 _viewAnimationController 为 undefined),
|
|
1017
|
+
// 这是 SDK 正常行为,不算"不支持",静默吞掉即可。
|
|
1018
|
+
startViewAnimation: (t, i) => p("Map.startViewAnimation", () => y(t).startViewAnimation(i) ?? 0, 0),
|
|
1019
|
+
pauseViewAnimation: (t, i) => {
|
|
1020
|
+
var e, n;
|
|
1021
|
+
try {
|
|
1022
|
+
(n = (e = y(t)).pauseViewAnimation) == null || n.call(e, i);
|
|
1023
|
+
} catch {
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
continueViewAnimation: (t, i) => {
|
|
1027
|
+
var e, n;
|
|
1028
|
+
try {
|
|
1029
|
+
(n = (e = y(t)).continueViewAnimation) == null || n.call(e, i);
|
|
1030
|
+
} catch {
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
cancelViewAnimation: (t, i) => {
|
|
1034
|
+
var e, n;
|
|
1035
|
+
try {
|
|
1036
|
+
(n = (e = y(t)).cancelViewAnimation) == null || n.call(e, i);
|
|
1037
|
+
} catch {
|
|
1038
|
+
}
|
|
1039
|
+
},
|
|
1040
|
+
// ─────────────── 19. 截图 ───────────────
|
|
1041
|
+
getScreenshot: (t) => p("Map.getScreenshot", () => {
|
|
1042
|
+
var i, e, n, l;
|
|
1043
|
+
return ((e = (i = y(t)).getScreenshot) == null ? void 0 : e.call(i)) ?? ((l = (n = y(t)).getMapScreenshot) == null ? void 0 : l.call(n)) ?? "";
|
|
1044
|
+
}, ""),
|
|
1045
|
+
// ─────────────── 20. 地球模式 ───────────────
|
|
1046
|
+
isSupportEarth: (t) => p("Map.isSupportEarth", () => {
|
|
1047
|
+
var i, e;
|
|
1048
|
+
return ((e = (i = y(t)).isSupportEarth) == null ? void 0 : e.call(i)) ?? !1;
|
|
1049
|
+
}, !1),
|
|
1050
|
+
getEarth: (t) => p("Map.getEarth", () => {
|
|
1051
|
+
var i, e;
|
|
1052
|
+
return (e = (i = y(t)).getEarth) == null ? void 0 : e.call(i);
|
|
1053
|
+
}, null),
|
|
1054
|
+
showEarthBoundary: (t) => c("Map.showEarthBoundary", () => {
|
|
1055
|
+
var i, e;
|
|
1056
|
+
return (e = (i = y(t)).showEarthBoundary) == null ? void 0 : e.call(i);
|
|
1057
|
+
}),
|
|
1058
|
+
hideEarthBoundary: (t) => c("Map.hideEarthBoundary", () => {
|
|
1059
|
+
var i, e;
|
|
1060
|
+
return (e = (i = y(t)).hideEarthBoundary) == null ? void 0 : e.call(i);
|
|
1061
|
+
}),
|
|
1062
|
+
setEarthMaxZoom: (t, i) => c("Map.setEarthMaxZoom", () => {
|
|
1063
|
+
var e, n;
|
|
1064
|
+
return (n = (e = y(t)).setEarthMaxZoom) == null ? void 0 : n.call(e, i);
|
|
1065
|
+
}),
|
|
1066
|
+
setEarthMinZoom: (t, i) => c("Map.setEarthMinZoom", () => {
|
|
1067
|
+
var e, n;
|
|
1068
|
+
return (n = (e = y(t)).setEarthMinZoom) == null ? void 0 : n.call(e, i);
|
|
1069
|
+
}),
|
|
1070
|
+
// ─────────────── 21. 室内 ───────────────
|
|
1071
|
+
showIndoor: (t, i, e) => c("Map.showIndoor", () => {
|
|
1072
|
+
var n, l;
|
|
1073
|
+
return (l = (n = y(t)).showIndoor) == null ? void 0 : l.call(n, i, e);
|
|
1074
|
+
}),
|
|
1075
|
+
setIndoor: (t, i, e) => c("Map.setIndoor", () => {
|
|
1076
|
+
var n, l;
|
|
1077
|
+
return (l = (n = y(t)).setIndoor) == null ? void 0 : l.call(n, i, e);
|
|
1078
|
+
}),
|
|
1079
|
+
getIndoorInfo: (t) => p("Map.getIndoorInfo", () => {
|
|
1080
|
+
var i, e;
|
|
1081
|
+
return ((e = (i = y(t)).getIndoorInfo) == null ? void 0 : e.call(i)) ?? null;
|
|
1082
|
+
}, null),
|
|
1083
|
+
initIndoorLayer: (t, i) => p("Map.initIndoorLayer", () => {
|
|
1084
|
+
var e, n;
|
|
1085
|
+
return (n = (e = y(t)).initIndoorLayer) == null ? void 0 : n.call(e, i);
|
|
1086
|
+
}, null),
|
|
1087
|
+
setNormalMapDisplay: (t, i) => c("Map.setNormalMapDisplay", () => {
|
|
1088
|
+
var e, n;
|
|
1089
|
+
return (n = (e = y(t)).setNormalMapDisplay) == null ? void 0 : n.call(e, i);
|
|
1090
|
+
}),
|
|
1091
|
+
getVectorContainer: (t) => p("Map.getVectorContainer", () => {
|
|
1092
|
+
var i, e;
|
|
1093
|
+
return (e = (i = y(t)).getVectorContainer) == null ? void 0 : e.call(i);
|
|
1094
|
+
}, null),
|
|
1095
|
+
// ─────────────── 22. 街景图层 ───────────────
|
|
1096
|
+
showStreetLayer: (t, i) => c("Map.showStreetLayer", () => {
|
|
1097
|
+
var e, n;
|
|
1098
|
+
return (n = (e = y(t)).showStreetLayer) == null ? void 0 : n.call(e, i);
|
|
1099
|
+
}),
|
|
1100
|
+
hideStreetLayer: (t) => c("Map.hideStreetLayer", () => {
|
|
1101
|
+
var i, e;
|
|
1102
|
+
return (e = (i = y(t)).hideStreetLayer) == null ? void 0 : e.call(i);
|
|
1103
|
+
}),
|
|
1104
|
+
isStreetLayerShow: (t) => p("Map.isStreetLayerShow", () => {
|
|
1105
|
+
var i, e;
|
|
1106
|
+
return ((e = (i = y(t)).isStreetLayerShow) == null ? void 0 : e.call(i)) ?? !1;
|
|
1107
|
+
}, !1),
|
|
1108
|
+
showVectorStreetLayer: (t) => c("Map.showVectorStreetLayer", () => {
|
|
1109
|
+
var i, e;
|
|
1110
|
+
return (e = (i = y(t)).showVectorStreetLayer) == null ? void 0 : e.call(i);
|
|
1111
|
+
}),
|
|
1112
|
+
hideVectorStreetLayer: (t) => c("Map.hideVectorStreetLayer", () => {
|
|
1113
|
+
var i, e;
|
|
1114
|
+
return (e = (i = y(t)).hideVectorStreetLayer) == null ? void 0 : e.call(i);
|
|
1115
|
+
}),
|
|
1116
|
+
// ─────────────── 23. 语言 ───────────────
|
|
1117
|
+
getLanguage: (t) => p("Map.getLanguage", () => {
|
|
1118
|
+
var i, e;
|
|
1119
|
+
return ((e = (i = y(t)).getLanguage) == null ? void 0 : e.call(i)) ?? "";
|
|
1120
|
+
}, ""),
|
|
1121
|
+
changeLanguage: (t, i) => c("Map.changeLanguage", () => {
|
|
1122
|
+
var e, n;
|
|
1123
|
+
return (n = (e = y(t)).changeLanguage) == null ? void 0 : n.call(e, i);
|
|
1124
|
+
}),
|
|
1125
|
+
enablePreferredLanguage: (t, i) => c("Map.enablePreferredLanguage", () => {
|
|
1126
|
+
var e, n;
|
|
1127
|
+
return (n = (e = y(t)).enablePreferredLanguage) == null ? void 0 : n.call(e, i);
|
|
1128
|
+
}),
|
|
1129
|
+
disablePreferredLanguage: (t) => c("Map.disablePreferredLanguage", () => {
|
|
1130
|
+
var i, e;
|
|
1131
|
+
return (e = (i = y(t)).disablePreferredLanguage) == null ? void 0 : e.call(i);
|
|
1132
|
+
}),
|
|
1133
|
+
// ─────────────── 24. 私有 / 焦点遮罩 / 自定义 HTML 图层 ───────────────
|
|
1134
|
+
setLock: (t, i) => c("Map.setLock", () => {
|
|
1135
|
+
var e, n;
|
|
1136
|
+
return (n = (e = y(t)).setLock) == null ? void 0 : n.call(e, i);
|
|
1137
|
+
}),
|
|
1138
|
+
setPrivateRegions: (t, i) => c("Map.setPrivateRegions", () => {
|
|
1139
|
+
var e, n;
|
|
1140
|
+
return (n = (e = y(t)).setPrivateRegions) == null ? void 0 : n.call(e, i);
|
|
1141
|
+
}),
|
|
1142
|
+
getPrivateRegions: (t) => p("Map.getPrivateRegions", () => {
|
|
1143
|
+
var i, e;
|
|
1144
|
+
return ((e = (i = y(t)).getPrivateRegions) == null ? void 0 : e.call(i)) ?? [];
|
|
1145
|
+
}, []),
|
|
1146
|
+
setPrivateStatus: (t, i) => c("Map.setPrivateStatus", () => {
|
|
1147
|
+
var e, n;
|
|
1148
|
+
return (n = (e = y(t)).setPrivateStatus) == null ? void 0 : n.call(e, i);
|
|
1149
|
+
}),
|
|
1150
|
+
getPrivateStatus: (t) => p("Map.getPrivateStatus", () => {
|
|
1151
|
+
var i, e;
|
|
1152
|
+
return ((e = (i = y(t)).getPrivateStatus) == null ? void 0 : e.call(i)) ?? !1;
|
|
1153
|
+
}, !1),
|
|
1154
|
+
setCustomArea: (t, i) => c("Map.setCustomArea", () => {
|
|
1155
|
+
var l, f;
|
|
1156
|
+
const e = i ?? {}, n = Array.isArray(e.area) ? { ...e, area: x(o, e.area) } : e;
|
|
1157
|
+
return (f = (l = y(t)).setCustomArea) == null ? void 0 : f.call(l, n);
|
|
1158
|
+
}),
|
|
1159
|
+
addFocusMask: (t, i) => c("Map.addFocusMask", () => {
|
|
1160
|
+
var e, n;
|
|
1161
|
+
return (n = (e = y(t)).addFocusMask) == null ? void 0 : n.call(e, i);
|
|
1162
|
+
}),
|
|
1163
|
+
removeFocusMask: (t, i) => c("Map.removeFocusMask", () => {
|
|
1164
|
+
var e, n;
|
|
1165
|
+
return (n = (e = y(t)).removeFocusMask) == null ? void 0 : n.call(e, i);
|
|
1166
|
+
}),
|
|
1167
|
+
clearFocusMasks: (t) => c("Map.clearFocusMasks", () => {
|
|
1168
|
+
var i, e;
|
|
1169
|
+
return (e = (i = y(t)).clearFocusMasks) == null ? void 0 : e.call(i);
|
|
1170
|
+
}),
|
|
1171
|
+
addCustomHtmlLayer: (t, i) => c("Map.addCustomHtmlLayer", () => {
|
|
1172
|
+
var e, n;
|
|
1173
|
+
return (n = (e = y(t)).addCustomHtmlLayer) == null ? void 0 : n.call(e, i);
|
|
1174
|
+
}),
|
|
1175
|
+
removeCustomHtmlLayer: (t, i) => c("Map.removeCustomHtmlLayer", () => {
|
|
1176
|
+
var e, n;
|
|
1177
|
+
return (n = (e = y(t)).removeCustomHtmlLayer) == null ? void 0 : n.call(e, i);
|
|
1178
|
+
}),
|
|
1179
|
+
addParkingSpot: (t, i) => c("Map.addParkingSpot", () => {
|
|
1180
|
+
var e, n;
|
|
1181
|
+
return (n = (e = y(t)).addParkingSpot) == null ? void 0 : n.call(e, i);
|
|
1182
|
+
}),
|
|
1183
|
+
removeParkingSpot: (t, i) => c("Map.removeParkingSpot", () => {
|
|
1184
|
+
var e, n;
|
|
1185
|
+
return (n = (e = y(t)).removeParkingSpot) == null ? void 0 : n.call(e, i);
|
|
1186
|
+
}),
|
|
1187
|
+
// ─────────────── 25. 3.0-only(v4 不支持) ───────────────
|
|
1188
|
+
enableMapClick: () => M("Map.enableMapClick", h, s),
|
|
1189
|
+
disableMapClick: () => M("Map.disableMapClick", h, s),
|
|
1190
|
+
enable3DBuilding: () => M("Map.enable3DBuilding", h, s),
|
|
1191
|
+
disable3DBuilding: () => M("Map.disable3DBuilding", h, s),
|
|
1192
|
+
setPanorama: () => M("Map.setPanorama", h, s),
|
|
1193
|
+
getPanorama: () => S("Map.getPanorama", h, s, null),
|
|
1194
|
+
setCurrentCity: () => M("Map.setCurrentCity", h, s),
|
|
1195
|
+
highResolutionEnabled: (t) => p("Map.highResolutionEnabled", () => {
|
|
1196
|
+
var i, e;
|
|
1197
|
+
return ((e = (i = y(t)).highResolutionEnabled) == null ? void 0 : e.call(i)) ?? !1;
|
|
1198
|
+
}, !1),
|
|
1199
|
+
addHotspot: (t, i) => {
|
|
1200
|
+
var e, n;
|
|
1201
|
+
try {
|
|
1202
|
+
(n = (e = y(t)).addHotspot) == null || n.call(e, L(i));
|
|
1203
|
+
} catch {
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
removeHotspot: (t, i) => {
|
|
1207
|
+
var e, n;
|
|
1208
|
+
try {
|
|
1209
|
+
(n = (e = y(t)).removeHotspot) == null || n.call(e, L(i));
|
|
1210
|
+
} catch {
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
clearHotspots: (t) => {
|
|
1214
|
+
var i, e;
|
|
1215
|
+
try {
|
|
1216
|
+
(e = (i = y(t)).clearHotspots) == null || e.call(i);
|
|
1217
|
+
} catch {
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
// ─────────────── 26. Overlay 工厂 ───────────────
|
|
1221
|
+
createMarker: (t, i) => {
|
|
1222
|
+
const e = i, n = {};
|
|
1223
|
+
e != null && e.icon && (n.icon = X(o, e.icon)), e != null && e.offset && (n.offset = E(o, e.offset)), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), typeof (e == null ? void 0 : e.raiseOnDrag) == "boolean" && (n.raiseOnDrag = e.raiseOnDrag), typeof (e == null ? void 0 : e.draggingCursor) == "string" && (n.draggingCursor = e.draggingCursor), typeof (e == null ? void 0 : e.enableCollisionDetection) == "boolean" && (n.enableCollisionDetection = e.enableCollisionDetection), typeof (e == null ? void 0 : e.enableDraggingMap) == "boolean" && (n.enableDraggingMap = e.enableDraggingMap), typeof (e == null ? void 0 : e.baseZIndex) == "number" && (n.baseZIndex = e.baseZIndex), typeof (e == null ? void 0 : e.restrictDraggingArea) == "boolean" && (n.restrictDraggingArea = e.restrictDraggingArea), typeof (e == null ? void 0 : e.anchor) == "number" && (n.anchor = e.anchor), e != null && e.shadow && (n.shadow = X(o, e.shadow));
|
|
1224
|
+
const l = Object.keys(n).length > 0, f = I(o, t);
|
|
1225
|
+
return d(
|
|
1226
|
+
"Marker",
|
|
1227
|
+
() => l ? new o.Marker(f, n) : new o.Marker(f),
|
|
1228
|
+
"marker"
|
|
1229
|
+
);
|
|
1230
|
+
},
|
|
1231
|
+
createLabel: (t, i) => {
|
|
1232
|
+
const e = i, n = {};
|
|
1233
|
+
if (e != null && e.offset && (n.offset = E(o, e.offset)), e != null && e.position && (n.position = I(o, e.position)), typeof (e == null ? void 0 : e.anchor) == "number" && (n.anchor = e.anchor), typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), typeof (e == null ? void 0 : e.width) == "number" && e.width > 0 && (n.width = e.width), e != null && e.styles && typeof e.styles == "object") {
|
|
1234
|
+
const f = e.styles;
|
|
1235
|
+
n.styles = "whiteSpace" in f ? f : { whiteSpace: "nowrap", ...f };
|
|
1236
|
+
}
|
|
1237
|
+
const l = Object.keys(n).length > 0;
|
|
1238
|
+
return d(
|
|
1239
|
+
"Label",
|
|
1240
|
+
() => l ? new o.Label(t, n) : new o.Label(t),
|
|
1241
|
+
"label"
|
|
1242
|
+
);
|
|
1243
|
+
},
|
|
1244
|
+
createPolyline: (t, i) => {
|
|
1245
|
+
const e = i, n = {}, l = ["strokeColor", "strokeWeight", "strokeOpacity", "strokeStyle", "strokeLineCap", "strokeLineJoin"];
|
|
1246
|
+
for (const g of l)
|
|
1247
|
+
(e == null ? void 0 : e[g]) !== void 0 && (n[g] = e[g]);
|
|
1248
|
+
typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableEditing) == "boolean" && (n.enableEditing = e.enableEditing), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), typeof (e == null ? void 0 : e.geodesic) == "boolean" && (n.geodesic = e.geodesic), typeof (e == null ? void 0 : e.linkRight) == "boolean" && (n.linkRight = e.linkRight), typeof (e == null ? void 0 : e.clip) == "boolean" && (n.clip = e.clip), typeof (e == null ? void 0 : e.coordType) == "string" && (n.coordType = e.coordType), e != null && e.icons && (n.icons = e.icons.map(
|
|
1249
|
+
(g) => g && typeof g == "object" && "raw" in g ? L(g) : g
|
|
1250
|
+
)), e != null && e.dashArray && (n.dashArray = e.dashArray), e != null && e.strokeTexture && (n.strokeTexture = e.strokeTexture), typeof (e == null ? void 0 : e.zIndex) == "number" && (n.zIndex = e.zIndex), ne(o, e, n);
|
|
1251
|
+
const f = Object.keys(n).length > 0;
|
|
1252
|
+
return d(
|
|
1253
|
+
"Polyline",
|
|
1254
|
+
() => f ? new o.Polyline(x(o, t), n) : new o.Polyline(x(o, t)),
|
|
1255
|
+
"polyline"
|
|
1256
|
+
);
|
|
1257
|
+
},
|
|
1258
|
+
createPolygon: (t, i) => {
|
|
1259
|
+
const e = i, n = {}, l = ["strokeColor", "fillColor", "strokeWeight", "strokeOpacity", "fillOpacity", "strokeStyle", "strokeLineCap", "strokeLineJoin"];
|
|
1260
|
+
for (const m of l)
|
|
1261
|
+
(e == null ? void 0 : e[m]) !== void 0 && (n[m] = e[m]);
|
|
1262
|
+
typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableEditing) == "boolean" && (n.enableEditing = e.enableEditing), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), typeof (e == null ? void 0 : e.linkRight) == "boolean" && (n.linkRight = e.linkRight), typeof (e == null ? void 0 : e.coordType) == "string" && (n.coordType = e.coordType), e != null && e.dashArray && (n.dashArray = e.dashArray), typeof (e == null ? void 0 : e.zIndex) == "number" && (n.zIndex = e.zIndex), ne(o, e, n);
|
|
1263
|
+
const f = Object.keys(n).length > 0, g = ge(o, t);
|
|
1264
|
+
return d(
|
|
1265
|
+
"Polygon",
|
|
1266
|
+
() => f ? new o.Polygon(g, n) : new o.Polygon(g),
|
|
1267
|
+
"polygon"
|
|
1268
|
+
);
|
|
1269
|
+
},
|
|
1270
|
+
createCircle: (t, i, e) => {
|
|
1271
|
+
const n = e, l = (n == null ? void 0 : n.enableEditing) === !0, f = {}, g = ["strokeColor", "fillColor", "strokeWeight", "strokeOpacity", "fillOpacity", "strokeStyle"];
|
|
1272
|
+
for (const b of g)
|
|
1273
|
+
(n == null ? void 0 : n[b]) !== void 0 && (f[b] = n[b]);
|
|
1274
|
+
typeof (n == null ? void 0 : n.enableMassClear) == "boolean" && (f.enableMassClear = n.enableMassClear), typeof (n == null ? void 0 : n.enableClicking) == "boolean" && (f.enableClicking = n.enableClicking), typeof (n == null ? void 0 : n.coordType) == "string" && (f.coordType = n.coordType), n != null && n.dashArray && (f.dashArray = n.dashArray), typeof (n == null ? void 0 : n.zIndex) == "number" && (f.zIndex = n.zIndex), ne(o, n, f);
|
|
1275
|
+
const m = Object.keys(f).length > 0;
|
|
1276
|
+
return d("Circle", () => {
|
|
1277
|
+
var P;
|
|
1278
|
+
const b = m ? new o.Circle(I(o, t), i, f) : new o.Circle(I(o, t), i);
|
|
1279
|
+
if (l) {
|
|
1280
|
+
const O = requestAnimationFrame(() => {
|
|
1281
|
+
var k;
|
|
1282
|
+
try {
|
|
1283
|
+
(k = b.enableEditing) == null || k.call(b);
|
|
1284
|
+
} catch {
|
|
1285
|
+
}
|
|
1286
|
+
}), A = (P = b.remove) == null ? void 0 : P.bind(b);
|
|
1287
|
+
A && (b.remove = function() {
|
|
1288
|
+
return cancelAnimationFrame(O), A();
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
return b;
|
|
1292
|
+
}, "circle");
|
|
1293
|
+
},
|
|
1294
|
+
createRectangle: (t, i) => {
|
|
1295
|
+
const e = i, n = {}, l = ["strokeColor", "fillColor", "strokeWeight", "strokeOpacity", "fillOpacity", "strokeStyle"];
|
|
1296
|
+
for (const g of l)
|
|
1297
|
+
(e == null ? void 0 : e[g]) !== void 0 && (n[g] = e[g]);
|
|
1298
|
+
typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), typeof (e == null ? void 0 : e.linkRight) == "boolean" && (n.linkRight = e.linkRight), typeof (e == null ? void 0 : e.coordType) == "string" && (n.coordType = e.coordType), e != null && e.dashArray && (n.dashArray = e.dashArray), typeof (e == null ? void 0 : e.zIndex) == "number" && (n.zIndex = e.zIndex), ne(o, e, n);
|
|
1299
|
+
const f = Object.keys(n).length > 0;
|
|
1300
|
+
return d(
|
|
1301
|
+
"Rectangle",
|
|
1302
|
+
() => f ? new o.Rectangle(j(o, t), n) : new o.Rectangle(j(o, t)),
|
|
1303
|
+
"rectangle"
|
|
1304
|
+
);
|
|
1305
|
+
},
|
|
1306
|
+
createBezierCurve: (t, i, e) => {
|
|
1307
|
+
const n = e, l = Array.isArray(i) ? i : [], f = Array.isArray(t) ? t.length : 0;
|
|
1308
|
+
if (l.length < Math.max(0, f - 1))
|
|
1309
|
+
for (console.warn(`[react-bmap] BezierCurve: controlPoints 需要 ${f - 1} 组,实际 ${l.length} 组,已自动补齐`); l.length < f - 1; ) l.push([{ lng: 0, lat: 0 }]);
|
|
1310
|
+
const g = {}, m = ["strokeColor", "strokeWeight", "strokeOpacity", "strokeStyle"];
|
|
1311
|
+
for (const P of m)
|
|
1312
|
+
(n == null ? void 0 : n[P]) !== void 0 && (g[P] = n[P]);
|
|
1313
|
+
typeof (n == null ? void 0 : n.enableMassClear) == "boolean" && (g.enableMassClear = n.enableMassClear), typeof (n == null ? void 0 : n.enableClicking) == "boolean" && (g.enableClicking = n.enableClicking), typeof (n == null ? void 0 : n.enableEditing) == "boolean" && (g.enableEditing = n.enableEditing), n != null && n.dashArray && (g.dashArray = n.dashArray), typeof (n == null ? void 0 : n.zIndex) == "number" && (g.zIndex = n.zIndex), ne(o, n, g);
|
|
1314
|
+
const b = Object.keys(g).length > 0;
|
|
1315
|
+
return d(
|
|
1316
|
+
"BezierCurve",
|
|
1317
|
+
() => b ? new o.BezierCurve(x(o, t), ie(o, l), g) : new o.BezierCurve(x(o, t), ie(o, l)),
|
|
1318
|
+
"bezierCurve"
|
|
1319
|
+
);
|
|
1320
|
+
},
|
|
1321
|
+
createPrism: (t, i, e) => {
|
|
1322
|
+
const n = e, l = {}, f = ["topFillColor", "topFillOpacity", "sideFillColor", "sideFillOpacity"];
|
|
1323
|
+
for (const m of f)
|
|
1324
|
+
(n == null ? void 0 : n[m]) !== void 0 && (l[m] = n[m]);
|
|
1325
|
+
typeof (n == null ? void 0 : n.enableMassClear) == "boolean" && (l.enableMassClear = n.enableMassClear), typeof (n == null ? void 0 : n.enableClicking) == "boolean" && (l.enableClicking = n.enableClicking), typeof (n == null ? void 0 : n.zIndex) == "number" && (l.zIndex = n.zIndex);
|
|
1326
|
+
const g = Object.keys(l).length > 0;
|
|
1327
|
+
return d(
|
|
1328
|
+
"Prism",
|
|
1329
|
+
() => g ? new o.Prism(ge(o, t), i, l) : new o.Prism(ge(o, t), i),
|
|
1330
|
+
"prism"
|
|
1331
|
+
);
|
|
1332
|
+
},
|
|
1333
|
+
createGroundOverlay: (t, i) => {
|
|
1334
|
+
const e = i, n = {};
|
|
1335
|
+
typeof (e == null ? void 0 : e.opacity) == "number" && (n.opacity = e.opacity), typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), (e == null ? void 0 : e.url) !== void 0 && (n.url = e.url, typeof e.url == "string" && typeof e.imageURL != "string" && (n.imageURL = e.url)), typeof (e == null ? void 0 : e.displayOnMinLevel) == "number" && (n.displayOnMinLevel = e.displayOnMinLevel), typeof (e == null ? void 0 : e.displayOnMaxLevel) == "number" && (n.displayOnMaxLevel = e.displayOnMaxLevel), typeof (e == null ? void 0 : e.imageURL) == "string" && (n.imageURL = e.imageURL), typeof (e == null ? void 0 : e.stretch) == "boolean" && (n.stretch = e.stretch), typeof (e == null ? void 0 : e.type) == "string" && (n.type = e.type), typeof (e == null ? void 0 : e.top) == "boolean" && (n.top = e.top), typeof (e == null ? void 0 : e.isReDraw) == "boolean" && (n.isReDraw = e.isReDraw), typeof (e == null ? void 0 : e.drawHook) == "function" && (n.drawHook = e.drawHook);
|
|
1336
|
+
const l = Object.keys(n).length > 0;
|
|
1337
|
+
return d(
|
|
1338
|
+
"GroundOverlay",
|
|
1339
|
+
() => l ? new o.GroundOverlay(j(o, t), n) : new o.GroundOverlay(j(o, t)),
|
|
1340
|
+
"groundOverlay"
|
|
1341
|
+
);
|
|
1342
|
+
},
|
|
1343
|
+
createGroundPoint: (t, i) => {
|
|
1344
|
+
const e = i, n = {};
|
|
1345
|
+
return typeof (e == null ? void 0 : e.url) == "string" && (n.url = e.url), e != null && e.size && (n.size = E(o, e.size)), e != null && e.anchor && (n.anchor = E(o, e.anchor)), typeof (e == null ? void 0 : e.scale) == "number" && (n.scale = e.scale), typeof (e == null ? void 0 : e.rotation) == "number" && (n.rotation = e.rotation), e != null && e.offset && (n.offset = E(o, e.offset)), typeof (e == null ? void 0 : e.level) == "number" && (n.level = e.level), typeof (e == null ? void 0 : e.opacity) == "number" && (n.opacity = e.opacity), typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableClicking) == "boolean" && (n.enableClicking = e.enableClicking), typeof (e == null ? void 0 : e.displayOnMinLevel) == "number" && (n.displayOnMinLevel = e.displayOnMinLevel), typeof (e == null ? void 0 : e.displayOnMaxLevel) == "number" && (n.displayOnMaxLevel = e.displayOnMaxLevel), typeof (e == null ? void 0 : e.imageURL) == "string" && (n.imageURL = e.imageURL), typeof (e == null ? void 0 : e.type) == "string" && (n.type = e.type), typeof (e == null ? void 0 : e.top) == "boolean" && (n.top = e.top), typeof (e == null ? void 0 : e.isReDraw) == "boolean" && (n.isReDraw = e.isReDraw), typeof (e == null ? void 0 : e.drawHook) == "function" && (n.drawHook = e.drawHook), d(
|
|
1346
|
+
"GroundPoint",
|
|
1347
|
+
() => new o.GroundPoint(I(o, t), n),
|
|
1348
|
+
"groundPoint"
|
|
1349
|
+
);
|
|
1350
|
+
},
|
|
1351
|
+
createPointCollection: (t, i) => {
|
|
1352
|
+
const e = i, n = {};
|
|
1353
|
+
(e == null ? void 0 : e.shape) !== void 0 && (n.shape = e.shape), typeof (e == null ? void 0 : e.color) == "string" && (n.color = e.color), (e == null ? void 0 : e.size) !== void 0 && (n.size = e.size);
|
|
1354
|
+
const l = Object.keys(n).length > 0;
|
|
1355
|
+
return d(
|
|
1356
|
+
"PointCollection",
|
|
1357
|
+
() => l ? new o.PointCollection(x(o, t), n) : new o.PointCollection(x(o, t)),
|
|
1358
|
+
"pointCollection"
|
|
1359
|
+
);
|
|
1360
|
+
},
|
|
1361
|
+
createInfoWindow: (t, i) => {
|
|
1362
|
+
const e = i, n = {};
|
|
1363
|
+
typeof (e == null ? void 0 : e.width) == "number" && (n.width = e.width), typeof (e == null ? void 0 : e.height) == "number" && (n.height = e.height), typeof (e == null ? void 0 : e.maxWidth) == "number" && (n.maxWidth = e.maxWidth), e != null && e.offset && (n.offset = E(o, e.offset)), typeof (e == null ? void 0 : e.title) == "string" && (n.title = e.title), typeof (e == null ? void 0 : e.enableAutoPan) == "boolean" && (n.enableAutoPan = e.enableAutoPan), typeof (e == null ? void 0 : e.enableCloseOnClick) == "boolean" && (n.enableCloseOnClick = e.enableCloseOnClick), typeof (e == null ? void 0 : e.enableMessage) == "boolean" && (n.enableMessage = e.enableMessage), typeof (e == null ? void 0 : e.message) == "string" && (n.message = e.message), typeof (e == null ? void 0 : e.maxContent) == "string" && (n.maxContent = e.maxContent), typeof (e == null ? void 0 : e.enableMaximize) == "boolean" && (n.enableMaximize = e.enableMaximize), typeof (e == null ? void 0 : e.enableSearchTool) == "boolean" && (n.enableSearchTool = e.enableSearchTool);
|
|
1364
|
+
const l = Object.keys(n).length > 0;
|
|
1365
|
+
return d(
|
|
1366
|
+
"InfoWindow",
|
|
1367
|
+
() => l ? new o.InfoWindow(t, n) : new o.InfoWindow(t),
|
|
1368
|
+
"infoWindow"
|
|
1369
|
+
);
|
|
1370
|
+
},
|
|
1371
|
+
createSymbol: (t, i) => {
|
|
1372
|
+
const e = i, n = {};
|
|
1373
|
+
e != null && e.anchor && (n.anchor = E(o, e.anchor)), typeof (e == null ? void 0 : e.fillColor) == "string" && (n.fillColor = e.fillColor), typeof (e == null ? void 0 : e.fillOpacity) == "number" && (n.fillOpacity = e.fillOpacity), typeof (e == null ? void 0 : e.scale) == "number" && (n.scale = e.scale), typeof (e == null ? void 0 : e.rotation) == "number" && (n.rotation = e.rotation), typeof (e == null ? void 0 : e.strokeColor) == "string" && (n.strokeColor = e.strokeColor), typeof (e == null ? void 0 : e.strokeOpacity) == "number" && (n.strokeOpacity = e.strokeOpacity), typeof (e == null ? void 0 : e.strokeWeight) == "number" && (n.strokeWeight = e.strokeWeight);
|
|
1374
|
+
const l = Object.keys(n).length > 0;
|
|
1375
|
+
return d(
|
|
1376
|
+
"Symbol",
|
|
1377
|
+
() => l ? new o.Symbol(t, n) : new o.Symbol(t),
|
|
1378
|
+
"symbol"
|
|
1379
|
+
);
|
|
1380
|
+
},
|
|
1381
|
+
createIcon: (t, i, e) => {
|
|
1382
|
+
const n = e, l = typeof globalThis.BMapGL > "u", f = {};
|
|
1383
|
+
if (n != null && n.anchor && (f.anchor = E(o, n.anchor)), n != null && n.imageOffset) {
|
|
1384
|
+
const b = n.imageOffset;
|
|
1385
|
+
f.imageOffset = l ? new o.Size(-b.width, -b.height) : E(o, b);
|
|
1386
|
+
}
|
|
1387
|
+
n != null && n.imageSize && (f.imageSize = E(o, n.imageSize)), n != null && n.infoWindowAnchor && (f.infoWindowAnchor = E(o, n.infoWindowAnchor)), typeof (n == null ? void 0 : n.printImageUrl) == "string" && (f.printImageUrl = n.printImageUrl), n != null && n.srcset && (f.srcset = n.srcset);
|
|
1388
|
+
const g = Object.keys(f).length > 0, m = n != null && n.imageSize ? E(o, n.imageSize) : null;
|
|
1389
|
+
return d("Icon", () => {
|
|
1390
|
+
const b = g ? new o.Icon(t, new o.Size(i.width, i.height), f) : new o.Icon(t, new o.Size(i.width, i.height));
|
|
1391
|
+
return m && typeof b.setImageSize == "function" && b.setImageSize(m), b;
|
|
1392
|
+
}, "icon");
|
|
1393
|
+
},
|
|
1394
|
+
createIconSequence: (t, i, e, n) => d("IconSequence", () => new o.IconSequence(t ? L(t) : void 0, i, e ?? "", n), "iconSequence"),
|
|
1395
|
+
createHotspot: (t, i) => {
|
|
1396
|
+
const e = i, n = {};
|
|
1397
|
+
typeof (e == null ? void 0 : e.text) == "string" && (n.text = e.text), Array.isArray(e == null ? void 0 : e.offsets) && (n.offsets = e.offsets), (e == null ? void 0 : e.userData) !== void 0 && (n.userData = e.userData), typeof (e == null ? void 0 : e.minZoom) == "number" && (n.minZoom = e.minZoom), typeof (e == null ? void 0 : e.maxZoom) == "number" && (n.maxZoom = e.maxZoom);
|
|
1398
|
+
const l = Object.keys(n).length > 0;
|
|
1399
|
+
return d(
|
|
1400
|
+
"Hotspot",
|
|
1401
|
+
() => l ? new o.Hotspot(I(o, t), n) : new o.Hotspot(I(o, t)),
|
|
1402
|
+
"hotspot"
|
|
1403
|
+
);
|
|
1404
|
+
},
|
|
1405
|
+
createCustomOverlay: (t, i) => {
|
|
1406
|
+
const e = i, n = {};
|
|
1407
|
+
return e != null && e.point && (n.point = I(o, e.point)), e != null && e.anchors && (n.anchors = e.anchors), typeof (e == null ? void 0 : e.offsetX) == "number" && (n.offsetX = e.offsetX), typeof (e == null ? void 0 : e.offsetY) == "number" && (n.offsetY = e.offsetY), typeof (e == null ? void 0 : e.rotation) == "number" && (n.rotation = e.rotation), typeof (e == null ? void 0 : e.rotationInit) == "number" && (n.rotationInit = e.rotationInit), typeof (e == null ? void 0 : e.minZoom) == "number" && (n.minZoom = e.minZoom), typeof (e == null ? void 0 : e.maxZoom) == "number" && (n.maxZoom = e.maxZoom), (e == null ? void 0 : e.properties) !== void 0 && (n.properties = e.properties), typeof (e == null ? void 0 : e.fixBottom) == "boolean" && (n.fixBottom = e.fixBottom), typeof (e == null ? void 0 : e.useTranslate) == "boolean" && (n.useTranslate = e.useTranslate), typeof (e == null ? void 0 : e.autoFollowHeadingChanged) == "boolean" && (n.autoFollowHeadingChanged = e.autoFollowHeadingChanged), typeof (e == null ? void 0 : e.zIndex) == "number" && (n.zIndex = e.zIndex), typeof (e == null ? void 0 : e.enableMassClear) == "boolean" && (n.enableMassClear = e.enableMassClear), typeof (e == null ? void 0 : e.enableDraggingMap) == "boolean" && (n.enableDraggingMap = e.enableDraggingMap), d(
|
|
1408
|
+
"CustomOverlay",
|
|
1409
|
+
() => new o.CustomOverlay(t ?? (() => document.createElement("div")), n),
|
|
1410
|
+
"customOverlay"
|
|
1411
|
+
);
|
|
1412
|
+
},
|
|
1413
|
+
createMarker3D: (t, i, e) => {
|
|
1414
|
+
const n = e, l = {};
|
|
1415
|
+
typeof (n == null ? void 0 : n.shape) == "number" && (l.shape = n.shape), typeof (n == null ? void 0 : n.size) == "number" && (l.size = n.size), typeof (n == null ? void 0 : n.fillColor) == "string" && (l.fillColor = n.fillColor), typeof (n == null ? void 0 : n.fillOpacity) == "number" && (l.fillOpacity = n.fillOpacity), typeof (n == null ? void 0 : n.enableMassClear) == "boolean" && (l.enableMassClear = n.enableMassClear);
|
|
1416
|
+
const f = Object.keys(l).length > 0;
|
|
1417
|
+
return d(
|
|
1418
|
+
"Marker3D",
|
|
1419
|
+
() => f ? new o.Marker3D(I(o, t), i, l) : new o.Marker3D(I(o, t), i),
|
|
1420
|
+
"marker3d"
|
|
1421
|
+
);
|
|
1422
|
+
},
|
|
1423
|
+
// ─────────────── 27. Overlay 属性 setter ───────────────
|
|
1424
|
+
setOverlayPosition: (t, i) => {
|
|
1425
|
+
var e, n, l;
|
|
1426
|
+
try {
|
|
1427
|
+
const f = L(t);
|
|
1428
|
+
t.type === "circle" ? (e = f.setCenter) == null || e.call(f, I(o, i)) : t.type === "groundPoint" ? (n = f.setPoint) == null || n.call(f, I(o, i)) : (l = f.setPosition) == null || l.call(f, I(o, i));
|
|
1429
|
+
} catch {
|
|
1430
|
+
}
|
|
1431
|
+
},
|
|
1432
|
+
setOverlayPath: (t, i) => {
|
|
1433
|
+
var e, n, l, f, g, m;
|
|
1434
|
+
try {
|
|
1435
|
+
if (t.type === "pointCollection") {
|
|
1436
|
+
(n = (e = L(t)).setPoints) == null || n.call(e, x(o, i));
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
if (Nt(i)) {
|
|
1440
|
+
t.type === "polygon" && ((f = (l = L(t)).setPath) == null || f.call(l, ie(o, i)));
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
(m = (g = L(t)).setPath) == null || m.call(g, x(o, i));
|
|
1444
|
+
} catch {
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
setOverlayOptions: (t, i) => {
|
|
1448
|
+
var l, f, g, m, b, P, O, A, k, N, R, _, G, U, le, te, Te, _e, Ie, ke, Se, Ne, Re, Ee, Be, ze, xe, Ge, Ze, He, We, Ve, Ue, Ye, De, Fe, je, Je, $e, qe, Xe, Qe, we, Ke, et, tt, ot, nt, it, at, rt, st, lt, ct, pt, dt, ut, yt;
|
|
1449
|
+
const e = L(t), n = i;
|
|
1450
|
+
lo(t.type, n);
|
|
1451
|
+
try {
|
|
1452
|
+
if (typeof n.strokeColor == "string" && ((l = e.setStrokeColor) == null || l.call(e, n.strokeColor)), typeof n.strokeWeight == "number" && ((f = e.setStrokeWeight) == null || f.call(e, n.strokeWeight)), typeof n.strokeOpacity == "number" && ((g = e.setStrokeOpacity) == null || g.call(e, n.strokeOpacity)), typeof n.strokeStyle == "string" && ((m = e.setStrokeStyle) == null || m.call(e, n.strokeStyle)), n.enableEditing === !0 ? (b = e.enableEditing) == null || b.call(e) : n.enableEditing === !1 && t.type !== "circle" && ((P = e.disableEditing) == null || P.call(e)), typeof n.fillColor == "string" && ((O = e.setFillColor) == null || O.call(e, n.fillColor)), typeof n.fillOpacity == "number" && ((A = e.setFillOpacity) == null || A.call(e, n.fillOpacity)), typeof n.topFillColor == "string" && ((k = e.setTopFillColor) == null || k.call(e, n.topFillColor)), typeof n.topFillOpacity == "number" && ((N = e.setTopFillOpacity) == null || N.call(e, n.topFillOpacity)), typeof n.sideFillColor == "string" && ((R = e.setSideFillColor) == null || R.call(e, n.sideFillColor)), typeof n.sideFillOpacity == "number" && ((_ = e.setSideFillOpacity) == null || _.call(e, n.sideFillOpacity)), typeof n.radius == "number" && t.type === "circle" && ((G = e.setRadius) == null || G.call(e, n.radius)), n.bounds && (t.type === "rectangle" || t.type === "groundOverlay") && ((U = e.setBounds) == null || U.call(e, j(o, n.bounds))), n.controlPoints && t.type === "bezierCurve" && ((le = e.setControlPoints) == null || le.call(e, ie(o, n.controlPoints))), typeof n.altitude == "number" && t.type === "prism" && ((te = e.setAltitude) == null || te.call(e, n.altitude)), (t.type === "groundOverlay" || t.type === "groundPoint") && (typeof n.url == "string" && ((Te = e.setImage) == null || Te.call(e, n.url)), typeof n.imageURL == "string" ? (_e = e.setImageURL) == null || _e.call(e, n.imageURL) : typeof n.url == "string" && ((Ie = e.setImageURL) == null || Ie.call(e, n.url)), typeof n.displayOnMinLevel == "number" && ((ke = e.setDisplayOnMinLevel) == null || ke.call(e, n.displayOnMinLevel)), typeof n.displayOnMaxLevel == "number" && ((Se = e.setDisplayOnMaxLevel) == null || Se.call(e, n.displayOnMaxLevel))), t.type === "groundPoint" && n.size && typeof n.size == "object" && ((Ne = e.setSize) == null || Ne.call(e, E(o, n.size))), typeof n.scale == "number" && (t.type === "groundPoint" || t.type === "symbol") && ((Re = e.setScale) == null || Re.call(e, n.scale)), t.type === "symbol" && n.path !== void 0 && ((Ee = e.setPath) == null || Ee.call(e, n.path)), t.type === "icon" && (typeof n.url == "string" && ((Be = e.setImageUrl) == null || Be.call(e, n.url)), n.size && typeof n.size == "object" && ((ze = e.setSize) == null || ze.call(e, E(o, n.size))), n.imageOffset && typeof n.imageOffset == "object" && ((xe = e.setImageOffset) == null || xe.call(e, E(o, n.imageOffset))), n.imageSize && typeof n.imageSize == "object" && ((Ge = e.setImageSize) == null || Ge.call(e, E(o, n.imageSize))), n.infoWindowAnchor && typeof n.infoWindowAnchor == "object" && ((Ze = e.setInfoWindowAnchor) == null || Ze.call(e, E(o, n.infoWindowAnchor))), typeof n.printImageUrl == "string" && ((He = e.setPrintImageUrl) == null || He.call(e, n.printImageUrl)), n.srcset && ((We = e.setImageSrcset) == null || We.call(e, n.srcset))), t.type === "pointCollection") {
|
|
1453
|
+
const oe = {};
|
|
1454
|
+
n.shape !== void 0 && (oe.shape = n.shape), typeof n.color == "string" && (oe.color = n.color), n.size !== void 0 && (oe.size = n.size), Object.keys(oe).length > 0 && ((Ve = e.setStyles) == null || Ve.call(e, oe));
|
|
1455
|
+
}
|
|
1456
|
+
typeof n.rotation == "number" && ((Ue = e.setRotation) == null || Ue.call(e, n.rotation)), typeof n.title == "string" && ((Ye = e.setTitle) == null || Ye.call(e, n.title)), typeof n.content == "string" && ((De = e.setContent) == null || De.call(e, n.content)), t.type === "hotspot" && (typeof n.text == "string" && ((Fe = e.setText) == null || Fe.call(e, n.text)), n.userData !== void 0 && ((je = e.setUserData) == null || je.call(e, n.userData))), t.type === "customOverlay" && (n.point && ((Je = e.setPoint) == null || Je.call(e, I(o, n.point))), typeof n.rotationInit == "number" && (($e = e.setRotationOrigin) == null || $e.call(e, n.rotationInit)), n.properties !== void 0 && ((qe = e.setProperties) == null || qe.call(e, n.properties))), t.type === "marker3d" && (typeof n.height == "number" && ((Xe = e.setHeight) == null || Xe.call(e, n.height)), typeof n.fillColor == "string" && ((Qe = e.setFillColor) == null || Qe.call(e, n.fillColor)), typeof n.fillOpacity == "number" && ((we = e.setFillOpacity) == null || we.call(e, n.fillOpacity))), n.styles && typeof n.styles == "object" && ((Ke = e.setStyles) == null || Ke.call(e, n.styles)), typeof n.opacity == "number" && (t.type === "marker" && typeof e.setOptions == "function" ? e.setOptions({ opacity: n.opacity }) : (et = e.setOpacity) == null || et.call(e, n.opacity)), n.icon !== void 0 && ((tt = e.setIcon) == null || tt.call(e, X(o, n.icon))), typeof n.anchor == "number" ? (ot = e.setAnchor) == null || ot.call(e, n.anchor) : n.anchor && typeof n.anchor == "object" && (t.type === "groundPoint" || t.type === "symbol" || t.type === "icon") && ((nt = e.setAnchor) == null || nt.call(e, E(o, n.anchor))), n.enableDragging === !0 ? (it = e.enableDragging) == null || it.call(e) : n.enableDragging === !1 && ((at = e.disableDragging) == null || at.call(e)), n.enableMassClear === !0 ? (rt = e.enableMassClear) == null || rt.call(e) : n.enableMassClear === !1 && ((st = e.disableMassClear) == null || st.call(e)), typeof n.zIndex == "number" && ((lt = e.setZIndex) == null || lt.call(e, n.zIndex)), n.offset && ((ct = e.setOffset) == null || ct.call(e, E(o, n.offset))), typeof n.color == "string" && t.type === "marker" && ((pt = e.setColor) == null || pt.call(e, n.color)), typeof n.rank == "number" && t.type === "marker" && ((dt = e.setRank) == null || dt.call(e, n.rank), (ut = Ce.get(e)) == null || ut.schedule()), typeof n.rotationOrigin == "number" && t.type === "marker" && ((yt = e.setRotationOrigin) == null || yt.call(e, n.rotationOrigin));
|
|
1457
|
+
} catch {
|
|
1458
|
+
}
|
|
1459
|
+
},
|
|
1460
|
+
// ─────────────── 27b. Overlay 默认值快照 / 还原 ───────────────
|
|
1461
|
+
// prop 从有值变回 undefined 时,框架需要「SDK 默认值」才能真正复原。SDK 没有 unset 语义,
|
|
1462
|
+
// 唯一可靠来源是实例自己的 getter:挂载后先读一份,之后按需写回。
|
|
1463
|
+
snapshotOverlayOptions: (t, i) => {
|
|
1464
|
+
const e = {}, n = L(t);
|
|
1465
|
+
if (!n) return e;
|
|
1466
|
+
for (const l of i) {
|
|
1467
|
+
const { get: f, set: g } = Mt(l);
|
|
1468
|
+
if (!(typeof n[f] != "function" || typeof n[g] != "function"))
|
|
1469
|
+
try {
|
|
1470
|
+
const m = n[f]();
|
|
1471
|
+
m != null && (e[l] = m);
|
|
1472
|
+
} catch {
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return e;
|
|
1476
|
+
},
|
|
1477
|
+
restoreOverlayOptions: (t, i) => {
|
|
1478
|
+
const e = [], n = L(t);
|
|
1479
|
+
for (const [l, f] of Object.entries(i)) {
|
|
1480
|
+
const { set: g } = Mt(l);
|
|
1481
|
+
if (!n || typeof n[g] != "function") {
|
|
1482
|
+
e.push(l);
|
|
1483
|
+
continue;
|
|
1484
|
+
}
|
|
1485
|
+
try {
|
|
1486
|
+
n[g](f);
|
|
1487
|
+
} catch {
|
|
1488
|
+
e.push(l);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
return e;
|
|
1492
|
+
},
|
|
1493
|
+
// ─────────────── 27c. Overlay 可见性 / PlaceDetail ───────────────
|
|
1494
|
+
showOverlay: (t) => {
|
|
1495
|
+
var l, f;
|
|
1496
|
+
const i = L(t), e = D.get(i);
|
|
1497
|
+
if (e && (e.userVisible = !0, e.hidden))
|
|
1498
|
+
return;
|
|
1499
|
+
try {
|
|
1500
|
+
(l = i.show) == null || l.call(i);
|
|
1501
|
+
} catch {
|
|
1502
|
+
}
|
|
1503
|
+
const n = ((f = i == null ? void 0 : i.getContainer) == null ? void 0 : f.call(i)) ?? (i == null ? void 0 : i._container);
|
|
1504
|
+
n && (n.style.display = "");
|
|
1505
|
+
},
|
|
1506
|
+
hideOverlay: (t) => {
|
|
1507
|
+
var l, f;
|
|
1508
|
+
const i = L(t), e = D.get(i);
|
|
1509
|
+
e && (e.userVisible = !1);
|
|
1510
|
+
try {
|
|
1511
|
+
(l = i.hide) == null || l.call(i);
|
|
1512
|
+
} catch {
|
|
1513
|
+
}
|
|
1514
|
+
const n = ((f = i == null ? void 0 : i.getContainer) == null ? void 0 : f.call(i)) ?? (i == null ? void 0 : i._container);
|
|
1515
|
+
n && (n.style.display = "none");
|
|
1516
|
+
},
|
|
1517
|
+
openPlaceDetail: (t, i) => c("Marker.openPlaceDetail", () => {
|
|
1518
|
+
var e, n;
|
|
1519
|
+
return (n = (e = L(t)).openPlaceDetail) == null ? void 0 : n.call(e, L(i));
|
|
1520
|
+
}),
|
|
1521
|
+
closePlaceDetail: (t) => {
|
|
1522
|
+
var i, e;
|
|
1523
|
+
try {
|
|
1524
|
+
(e = (i = L(t)).closePlaceDetail) == null || e.call(i);
|
|
1525
|
+
} catch {
|
|
1526
|
+
}
|
|
1527
|
+
},
|
|
1528
|
+
// ─────────────── 28. Control 工厂 ───────────────
|
|
1529
|
+
createNavigationControl: (t) => u("NavigationControl", () => new o.NavigationControl(z(o, t)), "navigation"),
|
|
1530
|
+
createNavigationControl3D: (t) => u("NavigationControl3D", () => new o.NavigationControl3D(z(o, t)), "navigation3D"),
|
|
1531
|
+
createScaleControl: (t) => u("ScaleControl", () => new o.ScaleControl(z(o, t)), "scale"),
|
|
1532
|
+
createOverviewMapControl: (t) => u("OverviewMapControl", () => new o.OverviewMapControl(z(o, t)), "overview"),
|
|
1533
|
+
createMapTypeControl: (t) => u("MapTypeControl", () => new o.MapTypeControl(z(o, t)), "mapType"),
|
|
1534
|
+
createCopyrightControl: (t) => u("CopyrightControl", () => {
|
|
1535
|
+
const i = new o.CopyrightControl(z(o, t));
|
|
1536
|
+
return bt(o, i, t == null ? void 0 : t.copyrights), i;
|
|
1537
|
+
}, "copyright"),
|
|
1538
|
+
createGeolocationControl: (t) => u("GeolocationControl", () => new o.GeolocationControl(z(o, t)), "geolocation"),
|
|
1539
|
+
createPanoramaControl: () => u("PanoramaControl", () => new o.PanoramaControl(), "panorama"),
|
|
1540
|
+
createZoomControl: (t) => u("ZoomControl", () => new o.ZoomControl(z(o, t)), "zoom"),
|
|
1541
|
+
createCityListControl: (t) => u("CityListControl", () => new o.CityListControl(z(o, t)), "cityList"),
|
|
1542
|
+
createLocationControl: (t) => u("GeolocationControl", () => new o.GeolocationControl(z(o, t)), "geolocation"),
|
|
1543
|
+
createLogoControl: (t) => u("LogoControl", () => new o.LogoControl(z(o, t)), "logo"),
|
|
1544
|
+
createControl: (t) => u("Control", () => {
|
|
1545
|
+
const i = new o.Control();
|
|
1546
|
+
return Object.assign(i, z(o, t)), i;
|
|
1547
|
+
}, "custom"),
|
|
1548
|
+
createCustomControl: (t, i) => u("Control", () => {
|
|
1549
|
+
const e = z(o, i);
|
|
1550
|
+
class n extends o.Control {
|
|
1551
|
+
constructor() {
|
|
1552
|
+
super(...arguments);
|
|
1553
|
+
Y(this, "defaultAnchor", 0);
|
|
1554
|
+
// BMAP_ANCHOR_TOP_LEFT
|
|
1555
|
+
Y(this, "defaultOffset", new o.Size(0, 0));
|
|
1556
|
+
}
|
|
1557
|
+
initialize(m) {
|
|
1558
|
+
const b = t();
|
|
1559
|
+
return m.getContainer().appendChild(b), this._opts = { printable: !1, anchor: e.anchor }, e.offset !== void 0 && this.setOffset(e.offset), b;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
return new n();
|
|
1563
|
+
}, "custom"),
|
|
1564
|
+
// ─────────────── 29. Layer 工厂 ───────────────
|
|
1565
|
+
createTileLayer: (t) => C("TileLayer", () => new o.TileLayer(t), "tile"),
|
|
1566
|
+
createNormalLayer: (t) => C("NormalLayer", () => new o.NormalLayer(t), "normal"),
|
|
1567
|
+
createGeoJSONLayer: (t) => {
|
|
1568
|
+
const i = t, e = (i == null ? void 0 : i.layerName) || "react-bmap-geojson";
|
|
1569
|
+
return C("GeoJSONLayer", () => new o.GeoJSONLayer(e, i), "geojson");
|
|
1570
|
+
},
|
|
1571
|
+
createDistrictLayer: (t) => C("DistrictLayer", () => new o.DistrictLayer(t), "district"),
|
|
1572
|
+
createTrafficLayer: (t) => C("TrafficLayer", () => new o.TrafficLayer(t), "traffic"),
|
|
1573
|
+
createCustomLayer: (t) => C("CustomLayer", () => new o.CustomLayer(t), "custom"),
|
|
1574
|
+
createCanvasLayer: (t) => C("CanvasLayer", () => new o.CanvasLayer(t), "canvas"),
|
|
1575
|
+
// 高级图层(4.0+)
|
|
1576
|
+
createRasterTileLayer: (t) => C("RasterTileLayer", () => new o.RasterTileLayer(t), "tile"),
|
|
1577
|
+
createWMSLayer: (t) => C("WMSLayer", () => new o.WMSLayer(t), "tile"),
|
|
1578
|
+
createWMTSLayer: (t) => C("WMTSLayer", () => new o.WMTSLayer(t), "tile"),
|
|
1579
|
+
createXYZLayer: (t) => C("XYZLayer", () => new o.XYZLayer(t), "tile"),
|
|
1580
|
+
createMVTLayer: (t) => C("MVTLayer", () => new o.MVTLayer(t), "tile"),
|
|
1581
|
+
createFeatureLayer: (t) => C("FeatureLayer", () => new o.FeatureLayer(t), "custom"),
|
|
1582
|
+
createFillLayer: (t) => C("FillLayer", () => new o.FillLayer(t), "custom"),
|
|
1583
|
+
createDOMLayer: (t) => C("DOMLayer", () => {
|
|
1584
|
+
const i = t == null ? void 0 : t.createDOM;
|
|
1585
|
+
if (!i) throw new Error("DOMLayer requires createDOM function");
|
|
1586
|
+
const { createDOM: e, ...n } = t;
|
|
1587
|
+
return new o.DOMLayer(i, n);
|
|
1588
|
+
}, "custom"),
|
|
1589
|
+
createPointIconLayer: (t) => C("PointIconLayer", () => new o.PointIconLayer(t), "custom"),
|
|
1590
|
+
createPointShapeLayer: (t) => C("PointShapeLayer", () => new o.PointShapeLayer(t), "custom"),
|
|
1591
|
+
createPanoramaCoverageLayer: (t) => C("PanoramaCoverageLayer", () => new o.PanoramaCoverageLayer(t), "custom"),
|
|
1592
|
+
createLineLayer: (t) => C("LineLayer", () => new o.LineLayer(t), "custom"),
|
|
1593
|
+
createPixelLayer: (t) => C("PixelLayer", () => new o.PixelLayer(t), "custom"),
|
|
1594
|
+
createBaiduLayer: (t) => C("BaiduLayer", () => new o.BaiduLayer(t), "custom"),
|
|
1595
|
+
createThreeLayer: (t) => C("ThreeLayer", () => new o.ThreeLayer(t), "custom"),
|
|
1596
|
+
// ─────────────── 30. ContextMenu ───────────────
|
|
1597
|
+
createContextMenu: (t) => d("ContextMenu", () => new o.ContextMenu(t), "contextMenu"),
|
|
1598
|
+
createMenuItem: (t, i, e) => d("MenuItem", () => new o.MenuItem(t, i, e), "menuItem"),
|
|
1599
|
+
addMenuItem: (t, i, e) => {
|
|
1600
|
+
var n, l;
|
|
1601
|
+
try {
|
|
1602
|
+
(l = (n = L(t)).addItem) == null || l.call(n, L(i), e);
|
|
1603
|
+
} catch {
|
|
1604
|
+
}
|
|
1605
|
+
},
|
|
1606
|
+
removeMenuItem: (t, i) => {
|
|
1607
|
+
var e, n;
|
|
1608
|
+
try {
|
|
1609
|
+
(n = (e = L(t)).removeItem) == null || n.call(e, L(i));
|
|
1610
|
+
} catch {
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
// ─────────────── 31. Panorama ───────────────
|
|
1614
|
+
createPanorama: (t, i) => {
|
|
1615
|
+
if (!r.has("Panorama"))
|
|
1616
|
+
return M("Panorama", h, s), null;
|
|
1617
|
+
try {
|
|
1618
|
+
return ft(new o.Panorama(t, i));
|
|
1619
|
+
} catch (e) {
|
|
1620
|
+
return W("Panorama", h, s, e), null;
|
|
1621
|
+
}
|
|
1622
|
+
},
|
|
1623
|
+
createPanoramaLabel: (t) => {
|
|
1624
|
+
const i = t, e = (i == null ? void 0 : i.content) || "", n = {};
|
|
1625
|
+
return i != null && i.position && (n.position = I(o, i.position)), typeof (i == null ? void 0 : i.altitude) == "number" && (n.altitude = i.altitude), typeof (i == null ? void 0 : i.displayDistance) == "boolean" && (n.displayDistance = i.displayDistance), i != null && i.customStyle && (n.customStyle = i.customStyle), d("PanoramaLabel", () => new o.PanoramaLabel(e, n), "panoramaLabel");
|
|
1626
|
+
},
|
|
1627
|
+
destroyPanorama: (t) => {
|
|
1628
|
+
var i, e;
|
|
1629
|
+
try {
|
|
1630
|
+
(e = (i = L(t)).destroy) == null || e.call(i);
|
|
1631
|
+
} catch {
|
|
1632
|
+
}
|
|
1633
|
+
},
|
|
1634
|
+
// ─────────────── 32. 服务工厂 ───────────────
|
|
1635
|
+
createLocalSearch: (t, i) => v("LocalSearch", () => new o.LocalSearch(wt(t), i)),
|
|
1636
|
+
createGeocoder: () => v("Geocoder", () => new o.Geocoder()),
|
|
1637
|
+
createDrivingRoute: (t) => v("DrivingRoute", () => new o.DrivingRoute(t == null ? void 0 : t.location, t)),
|
|
1638
|
+
createWalkingRoute: (t) => v("WalkingRoute", () => new o.WalkingRoute(t == null ? void 0 : t.location, t)),
|
|
1639
|
+
createRidingRoute: (t) => v("RidingRoute", () => new o.RidingRoute(t == null ? void 0 : t.location, t)),
|
|
1640
|
+
createTransitRoute: (t) => v("TransitRoute", () => new o.TransitRoute(t == null ? void 0 : t.location, t)),
|
|
1641
|
+
createBusLineSearch: (t) => v("BusLineSearch", () => new o.BusLineSearch(t == null ? void 0 : t.location, t)),
|
|
1642
|
+
createAutocomplete: (t) => v("Autocomplete", () => new o.Autocomplete(t)),
|
|
1643
|
+
createBoundary: () => v("Boundary", () => new o.Boundary()),
|
|
1644
|
+
createGeolocation: (t) => v("Geolocation", () => new o.Geolocation(t)),
|
|
1645
|
+
createLocalCity: (t) => v("LocalCity", () => new o.LocalCity(t)),
|
|
1646
|
+
createPlaceDetail: (t) => v("PlaceDetail", () => {
|
|
1647
|
+
const i = (t == null ? void 0 : t.container) ?? document.createElement("div"), e = t == null ? void 0 : t.map, n = { ...t, map: e };
|
|
1648
|
+
return new o.PlaceDetail(i, n);
|
|
1649
|
+
}),
|
|
1650
|
+
createConvertor: () => v("Convertor", () => new o.Convertor()),
|
|
1651
|
+
createPanoramaService: () => v("PanoramaService", () => new o.PanoramaService()),
|
|
1652
|
+
createTruckRoute: (t) => v("TruckRoute", () => {
|
|
1653
|
+
if (!o.TruckRoute) throw new Error("TruckRoute not exposed in runtime SDK");
|
|
1654
|
+
return new o.TruckRoute(t == null ? void 0 : t.location, t);
|
|
1655
|
+
}),
|
|
1656
|
+
searchService(t, i, e) {
|
|
1657
|
+
var g;
|
|
1658
|
+
const n = L(t);
|
|
1659
|
+
if (!n) return () => {
|
|
1660
|
+
};
|
|
1661
|
+
let l = !1;
|
|
1662
|
+
const f = (m) => (b) => {
|
|
1663
|
+
l || m == null || m(b);
|
|
1664
|
+
};
|
|
1665
|
+
typeof n.setSearchCompleteCallback == "function" ? n.setSearchCompleteCallback(f(e.onSuccess)) : typeof n.setSearchComplete == "function" && n.setSearchComplete(f(e.onSuccess));
|
|
1666
|
+
try {
|
|
1667
|
+
(g = n.search) == null || g.call(n, i);
|
|
1668
|
+
} catch (m) {
|
|
1669
|
+
f(e.onError)(m);
|
|
1670
|
+
}
|
|
1671
|
+
return () => {
|
|
1672
|
+
l = !0;
|
|
1673
|
+
};
|
|
1674
|
+
},
|
|
1675
|
+
getServiceResults(t) {
|
|
1676
|
+
const i = L(t);
|
|
1677
|
+
return !i || typeof i.getResults != "function" ? null : i.getResults();
|
|
1678
|
+
},
|
|
1679
|
+
// ─────────────── 33. 事件 ───────────────
|
|
1680
|
+
addEventListener(t, i, e) {
|
|
1681
|
+
var l;
|
|
1682
|
+
const n = L(t);
|
|
1683
|
+
return (l = n.addEventListener) == null || l.call(n, i, e), () => {
|
|
1684
|
+
var f;
|
|
1685
|
+
return (f = n.removeEventListener) == null ? void 0 : f.call(n, i, e);
|
|
1686
|
+
};
|
|
1687
|
+
},
|
|
1688
|
+
removeEventListener(t, i, e) {
|
|
1689
|
+
var n, l;
|
|
1690
|
+
(l = (n = L(t)).removeEventListener) == null || l.call(n, i, e);
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
function co(o) {
|
|
1695
|
+
var a;
|
|
1696
|
+
return (((a = o == null ? void 0 : o.constructor) == null ? void 0 : a.name) ?? "unknown").toLowerCase();
|
|
1697
|
+
}
|
|
1698
|
+
const Et = globalThis;
|
|
1699
|
+
function de() {
|
|
1700
|
+
const o = Et.BMap;
|
|
1701
|
+
if (!o)
|
|
1702
|
+
throw new Error("[react-bmap] BMap SDK 尚未加载,请确认地图脚本已由 jsapi-loader 注入完成。");
|
|
1703
|
+
return o;
|
|
1704
|
+
}
|
|
1705
|
+
function po() {
|
|
1706
|
+
return Et.BMap;
|
|
1707
|
+
}
|
|
1708
|
+
function uo(o, a) {
|
|
1709
|
+
const r = a.unsupportedBehavior, s = "3.0";
|
|
1710
|
+
return {
|
|
1711
|
+
...Rt(o, { ...a, version: s }),
|
|
1712
|
+
...{
|
|
1713
|
+
// 3.0-only Map 命令真实实现
|
|
1714
|
+
enableMapClick: (p) => {
|
|
1715
|
+
var d, u;
|
|
1716
|
+
(u = (d = p.raw).enableMapClick) == null || u.call(d);
|
|
1717
|
+
},
|
|
1718
|
+
disableMapClick: (p) => {
|
|
1719
|
+
var d, u;
|
|
1720
|
+
(u = (d = p.raw).disableMapClick) == null || u.call(d);
|
|
1721
|
+
},
|
|
1722
|
+
enable3DBuilding: (p) => {
|
|
1723
|
+
var d, u;
|
|
1724
|
+
try {
|
|
1725
|
+
(u = (d = p.raw).enable3DBuilding) == null || u.call(d);
|
|
1726
|
+
} catch {
|
|
1727
|
+
}
|
|
1728
|
+
},
|
|
1729
|
+
disable3DBuilding: (p) => {
|
|
1730
|
+
var d, u;
|
|
1731
|
+
try {
|
|
1732
|
+
(u = (d = p.raw).disable3DBuilding) == null || u.call(d);
|
|
1733
|
+
} catch {
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
setPanorama: (p, d) => {
|
|
1737
|
+
var u, C;
|
|
1738
|
+
try {
|
|
1739
|
+
d && ((C = (u = p.raw).setPanorama) == null || C.call(u, d));
|
|
1740
|
+
} catch {
|
|
1741
|
+
}
|
|
1742
|
+
},
|
|
1743
|
+
getPanorama: (p) => {
|
|
1744
|
+
var d, u;
|
|
1745
|
+
return ((u = (d = p.raw).getPanorama) == null ? void 0 : u.call(d)) ?? null;
|
|
1746
|
+
},
|
|
1747
|
+
setCurrentCity: (p, d) => {
|
|
1748
|
+
var u, C;
|
|
1749
|
+
(C = (u = p.raw).setCurrentCity) == null || C.call(u, d);
|
|
1750
|
+
},
|
|
1751
|
+
highResolutionEnabled: (p) => {
|
|
1752
|
+
var d, u;
|
|
1753
|
+
return ((u = (d = p.raw).highResolutionEnabled) == null ? void 0 : u.call(d)) ?? !1;
|
|
1754
|
+
},
|
|
1755
|
+
addHotspot: (p, d) => {
|
|
1756
|
+
var u, C;
|
|
1757
|
+
try {
|
|
1758
|
+
d != null && d.raw && ((C = (u = p.raw).addHotspot) == null || C.call(u, d.raw));
|
|
1759
|
+
} catch {
|
|
1760
|
+
}
|
|
1761
|
+
},
|
|
1762
|
+
removeHotspot: (p, d) => {
|
|
1763
|
+
var u, C;
|
|
1764
|
+
(C = (u = p.raw).removeHotspot) == null || C.call(u, d.raw);
|
|
1765
|
+
},
|
|
1766
|
+
clearHotspots: (p) => {
|
|
1767
|
+
var d, u;
|
|
1768
|
+
(u = (d = p.raw).clearHotspots) == null || u.call(d);
|
|
1769
|
+
},
|
|
1770
|
+
// v3 的 setMapType 直接调用原生方法。
|
|
1771
|
+
// 3.0 的 map.mapType 存的是 MapType 实例,内部用 === 比较(this.mapType === mapType),
|
|
1772
|
+
// 不是字符串比较;react-bmap 的 BMAP_NORMAL_MAP/BMAP_SATELLITE_MAP/BMAP_HYBRID_MAP
|
|
1773
|
+
// 常量统一导出字符串(供 4.0/GL 使用,见 v4Driver 的 normalizeMapTypeRequest 逻辑),
|
|
1774
|
+
// 3.0 收到字符串会跟内部 MapType 实例永远不相等,视觉上"看起来生效但内部状态错了"。
|
|
1775
|
+
// 这里把三个约定字符串换成 3.0 SDK 挂在全局 window 上的真实 MapType 实例(反查
|
|
1776
|
+
// jsapi-core-3-0/src/scripts/bmap/exports.js:147-152 的 exportSymbol(window, {...})
|
|
1777
|
+
// 确认挂载位置是 window 顶层,不是 window.BMap 上)。
|
|
1778
|
+
setMapType: (p, d) => {
|
|
1779
|
+
var C;
|
|
1780
|
+
const u = p.raw;
|
|
1781
|
+
if (typeof window < "u") {
|
|
1782
|
+
const v = window;
|
|
1783
|
+
d === "B_NORMAL_MAP" ? d = v.BMAP_NORMAL_MAP ?? d : d === "B_SATELLITE_MAP" ? d = v.BMAP_SATELLITE_MAP ?? d : d === "B_STREET_MAP" && (d = v.BMAP_HYBRID_MAP ?? d);
|
|
1784
|
+
}
|
|
1785
|
+
(C = u.setMapType) == null || C.call(u, d);
|
|
1786
|
+
},
|
|
1787
|
+
// 3.0 的自定义控件:不复用 v4Driver 的 ES6 class extends 实现——3.0 的 Control
|
|
1788
|
+
// 用 baidu.lang.inherits(subClass, superClass) 构建原型链(反查
|
|
1789
|
+
// jsapi-core-3-0/lib/tangram.js:1282-1299 确认,只是把 superClass.prototype 塞进
|
|
1790
|
+
// 一个空函数的 prototype 再 new 出来,subClass.prototype 上的自身属性逐个拷贝过去,
|
|
1791
|
+
// 不走标准的 constructor 调用链),跟 ES6 class 语义不完全兼容,直接 extends 容易在
|
|
1792
|
+
// 字段初始化时序上出问题。这里改用 Object.create 手动搭原型链,贴近 3.0 自身写法:
|
|
1793
|
+
// new 一个空构造函数、prototype 指向 Control.prototype,再显式调用 Control.call(inst)
|
|
1794
|
+
// 跑一遍构造函数体(对照 Control.js:15-42,设置 _map/_container/_type 等字段)。
|
|
1795
|
+
createCustomControl: (p, d) => {
|
|
1796
|
+
try {
|
|
1797
|
+
const u = d ?? {}, C = u.anchor, v = u.offset, t = o.Control, i = o.Size, e = v ? new i(v.width, v.height) : void 0, n = Object.create(t.prototype);
|
|
1798
|
+
n.initialize = function(f) {
|
|
1799
|
+
var b;
|
|
1800
|
+
const g = (f == null ? void 0 : f.container) ?? ((b = f == null ? void 0 : f.getContainer) == null ? void 0 : b.call(f));
|
|
1801
|
+
if (!g) return;
|
|
1802
|
+
const m = p();
|
|
1803
|
+
return g.appendChild(m), this._container = m, this.setAnchor(C), e !== void 0 && this.setOffset(e), m;
|
|
1804
|
+
}, n.defaultAnchor = 0, n.defaultOffset = new i(0, 0);
|
|
1805
|
+
const l = Object.create(n);
|
|
1806
|
+
return t.call(l), { __brand: "ControlHandle", raw: l, type: "custom" };
|
|
1807
|
+
} catch (u) {
|
|
1808
|
+
return W("Control", s, r, u), null;
|
|
1809
|
+
}
|
|
1810
|
+
},
|
|
1811
|
+
// Hotspot 是 v3-only,v4Driver 的 createOverlayFactory 闭包捕获了 v4 能力矩阵
|
|
1812
|
+
// (Hotspot 不在 v4 矩阵中),所以必须在这里直接创建,绕过能力检查
|
|
1813
|
+
createHotspot: (p, d) => {
|
|
1814
|
+
try {
|
|
1815
|
+
const u = d, C = {};
|
|
1816
|
+
typeof (u == null ? void 0 : u.text) == "string" && (C.text = u.text), Array.isArray(u == null ? void 0 : u.offsets) && (C.offsets = u.offsets), (u == null ? void 0 : u.userData) !== void 0 && (C.userData = u.userData), typeof (u == null ? void 0 : u.minZoom) == "number" && (C.minZoom = u.minZoom), typeof (u == null ? void 0 : u.maxZoom) == "number" && (C.maxZoom = u.maxZoom);
|
|
1817
|
+
const v = Object.keys(C).length > 0, t = new o.Point(p.lng, p.lat);
|
|
1818
|
+
return { __brand: "OverlayHandle", raw: v ? new o.Hotspot(t, C) : new o.Hotspot(t), type: "hotspot" };
|
|
1819
|
+
} catch (u) {
|
|
1820
|
+
return W("Hotspot", s, r, u), null;
|
|
1821
|
+
}
|
|
1822
|
+
},
|
|
1823
|
+
// PointCollection 同理:@removed 4.0,在 v4 矩阵中不存在,闭包检查会 block
|
|
1824
|
+
createPointCollection: (p, d) => {
|
|
1825
|
+
try {
|
|
1826
|
+
const u = d, C = {};
|
|
1827
|
+
(u == null ? void 0 : u.shape) !== void 0 && (C.shape = u.shape), typeof (u == null ? void 0 : u.color) == "string" && (C.color = u.color), typeof (u == null ? void 0 : u.size) == "number" && (C.size = u.size);
|
|
1828
|
+
const v = Object.keys(C).length > 0, t = p.map((e) => new o.Point(e.lng, e.lat));
|
|
1829
|
+
return { __brand: "OverlayHandle", raw: v ? new o.PointCollection(t, C) : new o.PointCollection(t), type: "pointCollection" };
|
|
1830
|
+
} catch (u) {
|
|
1831
|
+
return W("PointCollection", s, r, u), null;
|
|
1832
|
+
}
|
|
1833
|
+
},
|
|
1834
|
+
// 3.0 的 setMapStyle 和 setMapStyleV2 均可用
|
|
1835
|
+
setMapStyle: (p, d) => {
|
|
1836
|
+
var u, C;
|
|
1837
|
+
(C = (u = p.raw).setMapStyle) == null || C.call(u, d);
|
|
1838
|
+
},
|
|
1839
|
+
setMapStyleV2: (p, d) => {
|
|
1840
|
+
var u, C;
|
|
1841
|
+
(C = (u = p.raw).setMapStyleV2) == null || C.call(u, d);
|
|
1842
|
+
},
|
|
1843
|
+
// 3.0 坐标转换
|
|
1844
|
+
lnglatToMercator: (p, d, u) => {
|
|
1845
|
+
try {
|
|
1846
|
+
const C = o == null ? void 0 : o.MercatorProjection;
|
|
1847
|
+
if (C) {
|
|
1848
|
+
const t = new C();
|
|
1849
|
+
if (typeof t.lngLatToMercator == "function") {
|
|
1850
|
+
const i = t.lngLatToMercator(new o.Point(d, u));
|
|
1851
|
+
if (i) return [i.lng ?? i.x, i.lat ?? i.y];
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
const v = p.raw;
|
|
1855
|
+
if (typeof v.lnglatToMercator == "function") {
|
|
1856
|
+
const t = v.lnglatToMercator(d, u);
|
|
1857
|
+
if (t) return [t.lng ?? t.x, t.lat ?? t.y];
|
|
1858
|
+
}
|
|
1859
|
+
} catch {
|
|
1860
|
+
}
|
|
1861
|
+
return [NaN, NaN];
|
|
1862
|
+
},
|
|
1863
|
+
mercatorToLnglat: (p, d, u) => {
|
|
1864
|
+
try {
|
|
1865
|
+
const C = o == null ? void 0 : o.MercatorProjection;
|
|
1866
|
+
if (C) {
|
|
1867
|
+
const t = new C();
|
|
1868
|
+
if (typeof t.mercatorToLngLat == "function") {
|
|
1869
|
+
const i = t.mercatorToLngLat({ x: d, y: u });
|
|
1870
|
+
if (i) return [i.lng ?? i.x, i.lat ?? i.y];
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
const v = p.raw;
|
|
1874
|
+
if (typeof v.mercatorToLnglat == "function") {
|
|
1875
|
+
const t = v.mercatorToLnglat(d, u);
|
|
1876
|
+
if (t) return [t.lng ?? t.x, t.lat ?? t.y];
|
|
1877
|
+
}
|
|
1878
|
+
} catch {
|
|
1879
|
+
}
|
|
1880
|
+
return [NaN, NaN];
|
|
1881
|
+
},
|
|
1882
|
+
// 3.0 信息窗口通过 map.openInfoWindow
|
|
1883
|
+
openInfoWindow: (p, d, u) => {
|
|
1884
|
+
const C = p.raw;
|
|
1885
|
+
if (typeof C.openInfoWindow == "function") {
|
|
1886
|
+
const v = de(), t = u && new v.Point(u.lng, u.lat);
|
|
1887
|
+
C.openInfoWindow(d.raw, t);
|
|
1888
|
+
}
|
|
1889
|
+
},
|
|
1890
|
+
// 4.0+ 全部走 unsupported(命令 noop,getter 返回兜底)
|
|
1891
|
+
flyTo: () => M("Map.flyTo", s, r),
|
|
1892
|
+
setHeading: () => M("Map.setHeading", s, r),
|
|
1893
|
+
getHeading: () => S("Map.getHeading", s, r, NaN),
|
|
1894
|
+
setTilt: () => M("Map.setTilt", s, r),
|
|
1895
|
+
getTilt: () => S("Map.getTilt", s, r, NaN),
|
|
1896
|
+
getCurrentMaxTilt: () => S("Map.getCurrentMaxTilt", s, r, NaN),
|
|
1897
|
+
startViewAnimation: () => S("Map.startViewAnimation", s, r, 0),
|
|
1898
|
+
pauseViewAnimation: () => M("Map.pauseViewAnimation", s, r),
|
|
1899
|
+
continueViewAnimation: () => M("Map.continueViewAnimation", s, r),
|
|
1900
|
+
cancelViewAnimation: () => M("Map.cancelViewAnimation", s, r),
|
|
1901
|
+
setDisplayOptions: () => M("Map.setDisplayOptions", s, r),
|
|
1902
|
+
setOptions: () => M("Map.setOptions", s, r),
|
|
1903
|
+
restrictBounds: () => M("Map.restrictBounds", s, r),
|
|
1904
|
+
enableRotate: () => M("Map.enableRotate", s, r),
|
|
1905
|
+
disableRotate: () => M("Map.disableRotate", s, r),
|
|
1906
|
+
enableRotateGestures: () => M("Map.enableRotateGestures", s, r),
|
|
1907
|
+
disableRotateGestures: () => M("Map.disableRotateGestures", s, r),
|
|
1908
|
+
enableTilt: () => M("Map.enableTilt", s, r),
|
|
1909
|
+
disableTilt: () => M("Map.disableTilt", s, r),
|
|
1910
|
+
enableTiltGestures: () => M("Map.enableTiltGestures", s, r),
|
|
1911
|
+
disableTiltGestures: () => M("Map.disableTiltGestures", s, r),
|
|
1912
|
+
enableResizeOnCenter: () => M("Map.enableResizeOnCenter", s, r),
|
|
1913
|
+
disableResizeOnCenter: () => M("Map.disableResizeOnCenter", s, r),
|
|
1914
|
+
// 3.0 没有独立的 enableIconInfoWindow API,但 enableMapClick 内部会异步加载
|
|
1915
|
+
// mapclick 模块(对照 jsapi-core-3-0/src/scripts/bmap/services/Mapclick/
|
|
1916
|
+
// Mapclick_Impl.js:441-475),点击底图标注时本身就会创建 InfoWindow 并弹出,
|
|
1917
|
+
// 所以转发到 enableMapClick/disableMapClick 后效果与 4.0 基本等价(点击可点、
|
|
1918
|
+
// 自动弹窗),不是能力降级。
|
|
1919
|
+
enableIconInfoWindow: (p) => {
|
|
1920
|
+
var d, u;
|
|
1921
|
+
(u = (d = p.raw).enableMapClick) == null || u.call(d);
|
|
1922
|
+
},
|
|
1923
|
+
disableIconInfoWindow: (p) => {
|
|
1924
|
+
var d, u;
|
|
1925
|
+
(u = (d = p.raw).disableMapClick) == null || u.call(d);
|
|
1926
|
+
},
|
|
1927
|
+
setTheme: () => M("Map.setTheme", s, r),
|
|
1928
|
+
getMapTypeId: () => S("Map.getMapTypeId", s, r, ""),
|
|
1929
|
+
getMapCoordType: () => S("Map.getMapCoordType", s, r, ""),
|
|
1930
|
+
getMapStyleId: () => S("Map.getMapStyleId", s, r, ""),
|
|
1931
|
+
getAreaStyleId: () => S("Map.getAreaStyleId", s, r, ""),
|
|
1932
|
+
getRenderType: () => S("Map.getRenderType", s, r, ""),
|
|
1933
|
+
isCanvasMap: () => S("Map.isCanvasMap", s, r, !1),
|
|
1934
|
+
getContainerSize: (p) => {
|
|
1935
|
+
var d, u;
|
|
1936
|
+
return ((u = (d = p.raw).getContainerSize) == null ? void 0 : u.call(d)) ?? p.raw.getSize();
|
|
1937
|
+
},
|
|
1938
|
+
getZoomUnits: () => S("Map.getZoomUnits", s, r, NaN),
|
|
1939
|
+
isLoaded: (p) => typeof p.raw.isLoaded == "function" ? p.raw.isLoaded() : !0,
|
|
1940
|
+
getCoordType: (p) => typeof p.raw.getCoordType == "function" ? p.raw.getCoordType() : "",
|
|
1941
|
+
getProjection: (p) => {
|
|
1942
|
+
var d, u;
|
|
1943
|
+
return ((u = (d = p.raw).getProjection) == null ? void 0 : u.call(d)) ?? null;
|
|
1944
|
+
},
|
|
1945
|
+
getSolarInfo: () => S("Map.getSolarInfo", s, r, null),
|
|
1946
|
+
getTileId: () => S("Map.getTileId", s, r, ""),
|
|
1947
|
+
getPoiByUid: () => M("Map.getPoiByUid", s, r),
|
|
1948
|
+
setLock: () => M("Map.setLock", s, r),
|
|
1949
|
+
setPrivateRegions: () => M("Map.setPrivateRegions", s, r),
|
|
1950
|
+
getPrivateRegions: () => S("Map.getPrivateRegions", s, r, []),
|
|
1951
|
+
setPrivateStatus: () => M("Map.setPrivateStatus", s, r),
|
|
1952
|
+
getPrivateStatus: () => S("Map.getPrivateStatus", s, r, !1),
|
|
1953
|
+
setCustomArea: () => M("Map.setCustomArea", s, r),
|
|
1954
|
+
addFocusMask: () => M("Map.addFocusMask", s, r),
|
|
1955
|
+
removeFocusMask: () => M("Map.removeFocusMask", s, r),
|
|
1956
|
+
clearFocusMasks: () => M("Map.clearFocusMasks", s, r),
|
|
1957
|
+
addCustomHtmlLayer: () => M("Map.addCustomHtmlLayer", s, r),
|
|
1958
|
+
removeCustomHtmlLayer: () => M("Map.removeCustomHtmlLayer", s, r),
|
|
1959
|
+
addParkingSpot: () => M("Map.addParkingSpot", s, r),
|
|
1960
|
+
removeParkingSpot: () => M("Map.removeParkingSpot", s, r),
|
|
1961
|
+
isSupportEarth: () => S("Map.isSupportEarth", s, r, !1),
|
|
1962
|
+
getEarth: () => S("Map.getEarth", s, r, null),
|
|
1963
|
+
showEarthBoundary: () => M("Map.showEarthBoundary", s, r),
|
|
1964
|
+
hideEarthBoundary: () => M("Map.hideEarthBoundary", s, r),
|
|
1965
|
+
setEarthMaxZoom: () => M("Map.setEarthMaxZoom", s, r),
|
|
1966
|
+
setEarthMinZoom: () => M("Map.setEarthMinZoom", s, r),
|
|
1967
|
+
showIndoor: () => M("Map.showIndoor", s, r),
|
|
1968
|
+
setIndoor: () => M("Map.setIndoor", s, r),
|
|
1969
|
+
getIndoorInfo: () => S("Map.getIndoorInfo", s, r, null),
|
|
1970
|
+
showStreetLayer: () => M("Map.showStreetLayer", s, r),
|
|
1971
|
+
hideStreetLayer: () => M("Map.hideStreetLayer", s, r),
|
|
1972
|
+
isStreetLayerShow: () => S("Map.isStreetLayerShow", s, r, !1),
|
|
1973
|
+
showVectorStreetLayer: () => M("Map.showVectorStreetLayer", s, r),
|
|
1974
|
+
hideVectorStreetLayer: () => M("Map.hideVectorStreetLayer", s, r),
|
|
1975
|
+
getLanguage: () => S("Map.getLanguage", s, r, ""),
|
|
1976
|
+
changeLanguage: () => M("Map.changeLanguage", s, r),
|
|
1977
|
+
enablePreferredLanguage: () => M("Map.enablePreferredLanguage", s, r),
|
|
1978
|
+
disablePreferredLanguage: () => M("Map.disablePreferredLanguage", s, r),
|
|
1979
|
+
addSpots: () => S("Map.addSpots", s, r, ""),
|
|
1980
|
+
getSpots: () => S("Map.getSpots", s, r, []),
|
|
1981
|
+
removeSpots: () => M("Map.removeSpots", s, r),
|
|
1982
|
+
clearSpots: () => M("Map.clearSpots", s, r),
|
|
1983
|
+
resetSpotStatus: () => M("Map.resetSpotStatus", s, r),
|
|
1984
|
+
hightlightSpotByUid: () => M("Map.hightlightSpotByUid", s, r),
|
|
1985
|
+
addAreaSpot: () => S("Map.addAreaSpot", s, r, ""),
|
|
1986
|
+
getAreaSpot: () => S("Map.getAreaSpot", s, r, []),
|
|
1987
|
+
removeAreaSpot: () => M("Map.removeAreaSpot", s, r),
|
|
1988
|
+
clearAreaSpots: () => M("Map.clearAreaSpots", s, r),
|
|
1989
|
+
clearLabels: () => M("Map.clearLabels", s, r),
|
|
1990
|
+
addMapLabels: () => S("Map.addMapLabels", s, r, []),
|
|
1991
|
+
removeMapLabels: () => M("Map.removeMapLabels", s, r),
|
|
1992
|
+
getIconByClickPosition: () => S("Map.getIconByClickPosition", s, r, null),
|
|
1993
|
+
setBounds: () => M("Map.setBounds", s, r),
|
|
1994
|
+
getScreenshot: () => S("Map.getScreenshot", s, r, ""),
|
|
1995
|
+
setCopyrightOffset: () => M("Map.setCopyrightOffset", s, r),
|
|
1996
|
+
setOverlayMoveCursor: () => M("Map.setOverlayMoveCursor", s, r),
|
|
1997
|
+
addNormalLayer: () => M("Map.addNormalLayer", s, r),
|
|
1998
|
+
removeNormalLayer: () => M("Map.removeNormalLayer", s, r),
|
|
1999
|
+
addGeoJSONLayer: () => M("Map.addGeoJSONLayer", s, r),
|
|
2000
|
+
removeGeoJSONLayer: () => M("Map.removeGeoJSONLayer", s, r),
|
|
2001
|
+
addDistrictLayer: () => M("Map.addDistrictLayer", s, r),
|
|
2002
|
+
removeDistrictLayer: () => M("Map.removeDistrictLayer", s, r),
|
|
2003
|
+
setTrafficOn: () => M("Map.setTrafficOn", s, r),
|
|
2004
|
+
setTrafficOff: () => M("Map.setTrafficOff", s, r),
|
|
2005
|
+
addLayer: (p, d) => {
|
|
2006
|
+
var v, t, i, e;
|
|
2007
|
+
const u = d.raw;
|
|
2008
|
+
d.kind === "tile" || typeof (u == null ? void 0 : u.getTilesUrl) == "function" ? (t = (v = p.raw).addTileLayer) == null || t.call(v, u) : (e = (i = p.raw).addOverlay) == null || e.call(i, u);
|
|
2009
|
+
},
|
|
2010
|
+
removeLayer: (p, d) => {
|
|
2011
|
+
var v, t, i, e;
|
|
2012
|
+
const u = d.raw;
|
|
2013
|
+
d.kind === "tile" || typeof (u == null ? void 0 : u.getTilesUrl) == "function" ? (t = (v = p.raw).removeTileLayer) == null || t.call(v, u) : (e = (i = p.raw).removeOverlay) == null || e.call(i, u);
|
|
2014
|
+
},
|
|
2015
|
+
showOverlayContainer: () => M("Map.showOverlayContainer", s, r),
|
|
2016
|
+
hideOverlayContainer: () => M("Map.hideOverlayContainer", s, r),
|
|
2017
|
+
// 4.0+ 服务在 v3 不支持(工厂返回 isNull: true)
|
|
2018
|
+
createPlaceDetail: () => ({ __brand: "ServiceHandle", raw: null, isNull: !0 }),
|
|
2019
|
+
// 4.0+ 类不存在 → null
|
|
2020
|
+
createNavigationControl3D: () => (M("NavigationControl3D", s, r), null),
|
|
2021
|
+
createZoomControl: () => (M("ZoomControl", s, r), null),
|
|
2022
|
+
createLogoControl: () => (M("LogoControl", s, r), null),
|
|
2023
|
+
createRectangle: () => (M("Rectangle", s, r), null),
|
|
2024
|
+
createBezierCurve: () => (M("BezierCurve", s, r), null),
|
|
2025
|
+
createPrism: () => (M("Prism", s, r), null),
|
|
2026
|
+
createGroundPoint: () => (M("GroundPoint", s, r), null),
|
|
2027
|
+
createCustomOverlay: () => (M("CustomOverlay", s, r), null),
|
|
2028
|
+
createMarker3D: () => (M("Marker3D", s, r), null),
|
|
2029
|
+
openSimpleInfoWindow: () => M("Map.openSimpleInfoWindow", s, r),
|
|
2030
|
+
closeSimpleInfoWindow: () => M("Map.closeSimpleInfoWindow", s, r),
|
|
2031
|
+
createNormalLayer: () => (M("NormalLayer", s, r), null),
|
|
2032
|
+
createGeoJSONLayer: () => (M("GeoJSONLayer", s, r), null),
|
|
2033
|
+
createDistrictLayer: () => (M("DistrictLayer", s, r), null),
|
|
2034
|
+
// 4.0+ 高级图层在 v3 不支持
|
|
2035
|
+
createRasterTileLayer: () => (M("RasterTileLayer", s, r), null),
|
|
2036
|
+
createWMSLayer: () => (M("WMSLayer", s, r), null),
|
|
2037
|
+
createWMTSLayer: () => (M("WMTSLayer", s, r), null),
|
|
2038
|
+
createXYZLayer: () => (M("XYZLayer", s, r), null),
|
|
2039
|
+
createMVTLayer: () => (M("MVTLayer", s, r), null),
|
|
2040
|
+
createFeatureLayer: () => (M("FeatureLayer", s, r), null),
|
|
2041
|
+
createFillLayer: () => (M("FillLayer", s, r), null),
|
|
2042
|
+
createDOMLayer: () => (M("DOMLayer", s, r), null),
|
|
2043
|
+
createPointIconLayer: () => (M("PointIconLayer", s, r), null),
|
|
2044
|
+
createPointShapeLayer: () => (M("PointShapeLayer", s, r), null),
|
|
2045
|
+
// PanoramaCoverageLayer:v3 SDK 也导出该类(publish.js:81),走 base 的真实实现
|
|
2046
|
+
// v3-only 图层在 v3 直接创建(v4 capability 闭包不包含这些类)
|
|
2047
|
+
createCustomLayer: (p) => {
|
|
2048
|
+
try {
|
|
2049
|
+
return { __brand: "LayerHandle", raw: new o.CustomLayer(p), kind: "custom" };
|
|
2050
|
+
} catch (d) {
|
|
2051
|
+
return W("CustomLayer", s, r, d), null;
|
|
2052
|
+
}
|
|
2053
|
+
},
|
|
2054
|
+
createCanvasLayer: (p) => {
|
|
2055
|
+
try {
|
|
2056
|
+
return { __brand: "LayerHandle", raw: new o.CanvasLayer(p), kind: "canvas" };
|
|
2057
|
+
} catch (d) {
|
|
2058
|
+
return W("CanvasLayer", s, r, d), null;
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
},
|
|
2062
|
+
version: s,
|
|
2063
|
+
capabilities: kt["3.0"]
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2066
|
+
function yo(o, a, r) {
|
|
2067
|
+
return o === "3.0" ? uo(a, r) : Rt(a, r);
|
|
2068
|
+
}
|
|
2069
|
+
function be(o) {
|
|
2070
|
+
return o === null || typeof o != "object" ? String(o) : Array.isArray(o) ? `[${o.map(be).join(",")}]` : `{${Object.keys(o).sort().map((r) => `${r}:${be(o[r])}`).join(",")}}`;
|
|
2071
|
+
}
|
|
2072
|
+
const re = /* @__PURE__ */ new Map();
|
|
2073
|
+
function fo(o) {
|
|
2074
|
+
return be({
|
|
2075
|
+
v: o.version,
|
|
2076
|
+
ak: o.ak,
|
|
2077
|
+
host: o.serviceHost ?? "",
|
|
2078
|
+
lang: o.language ?? "",
|
|
2079
|
+
plugins: (o.plugins ?? []).slice().sort()
|
|
2080
|
+
});
|
|
2081
|
+
}
|
|
2082
|
+
function ho(o) {
|
|
2083
|
+
return re.get(o);
|
|
2084
|
+
}
|
|
2085
|
+
function mo(o, a, r) {
|
|
2086
|
+
re.set(o, { promise: r, loadKey: o, components: a }), r.catch(() => re.delete(o));
|
|
2087
|
+
}
|
|
2088
|
+
function go() {
|
|
2089
|
+
return Array.from(re.values());
|
|
2090
|
+
}
|
|
2091
|
+
function Mo(o, a) {
|
|
2092
|
+
for (const r of re.values())
|
|
2093
|
+
if (r.loadKey !== o) return r.components;
|
|
2094
|
+
return null;
|
|
2095
|
+
}
|
|
2096
|
+
async function vo(o, a) {
|
|
2097
|
+
var d;
|
|
2098
|
+
const r = fo(o), s = ho(r);
|
|
2099
|
+
if (s)
|
|
2100
|
+
return { rawSDK: await s.promise, version: o.version, loadKey: r };
|
|
2101
|
+
const h = Mo(r);
|
|
2102
|
+
if (h) {
|
|
2103
|
+
(d = a.onLoadConflict) == null || d.call(a, h, o);
|
|
2104
|
+
for (const u of go())
|
|
2105
|
+
if (u.loadKey !== r)
|
|
2106
|
+
return { rawSDK: await u.promise, version: u.components.version, loadKey: u.loadKey };
|
|
2107
|
+
}
|
|
2108
|
+
const c = Co(o, a);
|
|
2109
|
+
return mo(r, o, c), { rawSDK: await c, version: o.version, loadKey: r };
|
|
2110
|
+
}
|
|
2111
|
+
async function Co(o, a) {
|
|
2112
|
+
const r = await import("@baidumap/jsapi-loader");
|
|
2113
|
+
return (r.default ?? r).load({
|
|
2114
|
+
ak: o.ak,
|
|
2115
|
+
version: o.version,
|
|
2116
|
+
...o.serviceHost ? { serviceHost: o.serviceHost } : {},
|
|
2117
|
+
...a.protocol ? { protocol: a.protocol } : {},
|
|
2118
|
+
...a.timeout ? { timeout: a.timeout } : {},
|
|
2119
|
+
...a.globalConfig ? { globalConfig: a.globalConfig } : {}
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
const Zo = w({
|
|
2123
|
+
name: "BMapProvider",
|
|
2124
|
+
props: {
|
|
2125
|
+
ak: { type: String, required: !0 },
|
|
2126
|
+
version: { type: String, default: "4.0" },
|
|
2127
|
+
protocol: { type: String, default: void 0 },
|
|
2128
|
+
serviceHost: { type: String, default: void 0 },
|
|
2129
|
+
language: { type: String, default: void 0 },
|
|
2130
|
+
plugins: { type: Array, default: void 0 },
|
|
2131
|
+
timeout: { type: Number, default: void 0 },
|
|
2132
|
+
globalConfig: { type: Object, default: void 0 },
|
|
2133
|
+
unsupportedBehavior: { type: String, default: "warn" },
|
|
2134
|
+
onError: { type: Function, default: void 0 },
|
|
2135
|
+
onLoadConflict: {
|
|
2136
|
+
type: Function,
|
|
2137
|
+
default: void 0
|
|
2138
|
+
}
|
|
2139
|
+
},
|
|
2140
|
+
setup(o, { slots: a }) {
|
|
2141
|
+
const r = Q({
|
|
2142
|
+
status: "loading",
|
|
2143
|
+
driver: null,
|
|
2144
|
+
version: o.version,
|
|
2145
|
+
error: null
|
|
2146
|
+
});
|
|
2147
|
+
Le(_t, r);
|
|
2148
|
+
let s = 0, h = !1;
|
|
2149
|
+
return At(() => {
|
|
2150
|
+
if (typeof window > "u") return;
|
|
2151
|
+
const c = ++s, p = {
|
|
2152
|
+
version: o.version,
|
|
2153
|
+
ak: o.ak,
|
|
2154
|
+
serviceHost: o.serviceHost,
|
|
2155
|
+
language: o.language,
|
|
2156
|
+
plugins: o.plugins
|
|
2157
|
+
};
|
|
2158
|
+
vo(p, {
|
|
2159
|
+
protocol: o.protocol,
|
|
2160
|
+
timeout: o.timeout,
|
|
2161
|
+
globalConfig: o.globalConfig,
|
|
2162
|
+
onLoadConflict: (d, u) => {
|
|
2163
|
+
var C;
|
|
2164
|
+
return (C = o.onLoadConflict) == null ? void 0 : C.call(o, d, u);
|
|
2165
|
+
}
|
|
2166
|
+
}).then(({ rawSDK: d, version: u }) => {
|
|
2167
|
+
if (h || c !== s) return;
|
|
2168
|
+
const C = yo(u, d, { unsupportedBehavior: o.unsupportedBehavior });
|
|
2169
|
+
r.value = { status: "ready", driver: C, version: u, error: null };
|
|
2170
|
+
}).catch((d) => {
|
|
2171
|
+
if (h || c !== s) return;
|
|
2172
|
+
const u = d instanceof Error ? d : new Error(String(d));
|
|
2173
|
+
r.value = { ...r.value, status: "error", error: u }, o.onError ? o.onError(u) : typeof console < "u" && console.error(
|
|
2174
|
+
"[vue-bmap] 地图脚本加载失败,<BMapProvider> 的子树不会渲染。请检查 ak 是否有效、是否配置了域名白名单、网络能否访问百度地图服务。",
|
|
2175
|
+
u
|
|
2176
|
+
);
|
|
2177
|
+
});
|
|
2178
|
+
}), Tt(() => {
|
|
2179
|
+
h = !0, s++;
|
|
2180
|
+
}), () => {
|
|
2181
|
+
const c = r.value;
|
|
2182
|
+
return c.status === "loading" ? a.fallback ? a.fallback() : null : c.status === "error" ? a.error ? a.error({ error: c.error }) : null : a.default ? a.default() : null;
|
|
2183
|
+
};
|
|
2184
|
+
}
|
|
2185
|
+
}), Ho = 0, Wo = 1, Vo = 2, Uo = 3, Yo = 4, Do = 5, bo = 6, Oo = 7, Fo = 8, jo = "B_NORMAL_MAP", Jo = "B_SATELLITE_MAP", $o = "B_STREET_MAP", qo = "B_EARTH_MAP", Xo = 0, Qo = 1, wo = 2, Ko = 3, en = 0, tn = 1, on = 2, nn = 1, an = 2, rn = 0, sn = 1, ln = 2, cn = 3, pn = 4, dn = 5, un = 6, yn = 7, fn = 8, hn = 0, mn = 2, gn = 3, Mn = 4, vn = 5, Cn = 6, bn = 7, On = 8, Pn = 9, Ln = 10, An = 11, Tn = 12, _n = 13, In = 0, kn = 1, Sn = 2, Nn = 3, Rn = 4, En = 5, Bn = 0, zn = 1, xn = 0, Gn = 1, Zn = 2, Hn = 0, Wn = 1, Vn = 0, Un = 1, Yn = 2, Po = "zh", Lo = "en", Dn = "zh-TW", Fn = "es", jn = "pt", Jn = "fr", $n = "de", qn = "th", Xn = "ja", Qn = "ko", wn = "tr", Kn = "it", ei = "ru", ti = "ms", oi = "vi", ni = "id", ii = "metric", ai = "us", ri = "BMAP_COORD_MERCATOR", si = "BMAP_COORD_GCJ02", li = "BMAP_COORD_BD09", ci = "BMAP_COORD_GCJ02MERCATOR", pi = "BMAP_COORD_WGS84", di = "BMAP_COORD_EPSG3857", ui = 1, yi = 2, fi = 3, hi = 4, mi = 5, gi = 6, Mi = 7, vi = 8, Ci = 9, bi = 10, Oi = 11, Pi = 12, Li = 13, Ai = 14, Ti = 1, _i = 2, Ii = 3, ki = 4, Si = 5, Ni = 0, Ri = 1, Ei = 2, Bi = 3, zi = 4, xi = 5, Gi = 6, Zi = 7, Hi = 9, Wi = 1, Vi = 2, Ui = 3, Yi = 4, Di = 5, Fi = 6, ji = 7, Ji = 1, Ao = 2, $i = 1, qi = 2, Xi = 0, Qi = 1, wi = 2, Ki = 3, ea = 4, ta = "driving", oa = "transit", na = "walking", ia = "navigation", aa = 0, ra = 1, sa = 2, la = 2, ca = 3, pa = 6, da = 0, ua = 1, ya = 2, fa = 3, ha = 200, ma = 100, ga = 50, Ma = "BMAP_CONTEXT_MENU_ICON_ZOOMIN", va = "BMAP_CONTEXT_MENU_ICON_ZOOMOUT", Ca = 0, ba = 1, Oa = 2, Pa = 3, La = 4, Aa = 5, Ta = "hotel", _a = "catering", Ia = "movie", ka = "transit", Sa = "indoor_scene", Na = "none", Ra = "street", Ea = "inter", Ba = bo, za = Oo, xa = Po, Ga = Lo, Za = Ao;
|
|
2186
|
+
function Ha(o, a) {
|
|
2187
|
+
const r = po();
|
|
2188
|
+
return (r == null ? void 0 : r[o]) ?? a;
|
|
2189
|
+
}
|
|
2190
|
+
class Bt {
|
|
2191
|
+
constructor(a, r) {
|
|
2192
|
+
this.map = a, this.driver = r;
|
|
2193
|
+
}
|
|
2194
|
+
// ─── 交互开关 ───
|
|
2195
|
+
enableDragging() {
|
|
2196
|
+
this.driver.enableDragging(this.map);
|
|
2197
|
+
}
|
|
2198
|
+
disableDragging() {
|
|
2199
|
+
this.driver.disableDragging(this.map);
|
|
2200
|
+
}
|
|
2201
|
+
enableInertialDragging() {
|
|
2202
|
+
this.driver.enableInertialDragging(this.map);
|
|
2203
|
+
}
|
|
2204
|
+
disableInertialDragging() {
|
|
2205
|
+
this.driver.disableInertialDragging(this.map);
|
|
2206
|
+
}
|
|
2207
|
+
enableScrollWheelZoom() {
|
|
2208
|
+
this.driver.enableScrollWheelZoom(this.map);
|
|
2209
|
+
}
|
|
2210
|
+
disableScrollWheelZoom() {
|
|
2211
|
+
this.driver.disableScrollWheelZoom(this.map);
|
|
2212
|
+
}
|
|
2213
|
+
enableContinuousZoom() {
|
|
2214
|
+
this.driver.enableContinuousZoom(this.map);
|
|
2215
|
+
}
|
|
2216
|
+
disableContinuousZoom() {
|
|
2217
|
+
this.driver.disableContinuousZoom(this.map);
|
|
2218
|
+
}
|
|
2219
|
+
enableResizeOnCenter() {
|
|
2220
|
+
this.driver.enableResizeOnCenter(this.map);
|
|
2221
|
+
}
|
|
2222
|
+
disableResizeOnCenter() {
|
|
2223
|
+
this.driver.disableResizeOnCenter(this.map);
|
|
2224
|
+
}
|
|
2225
|
+
enableDoubleClickZoom() {
|
|
2226
|
+
this.driver.enableDoubleClickZoom(this.map);
|
|
2227
|
+
}
|
|
2228
|
+
disableDoubleClickZoom() {
|
|
2229
|
+
this.driver.disableDoubleClickZoom(this.map);
|
|
2230
|
+
}
|
|
2231
|
+
enableKeyboard() {
|
|
2232
|
+
this.driver.enableKeyboard(this.map);
|
|
2233
|
+
}
|
|
2234
|
+
disableKeyboard() {
|
|
2235
|
+
this.driver.disableKeyboard(this.map);
|
|
2236
|
+
}
|
|
2237
|
+
enablePinchToZoom() {
|
|
2238
|
+
this.driver.enablePinchToZoom(this.map);
|
|
2239
|
+
}
|
|
2240
|
+
disablePinchToZoom() {
|
|
2241
|
+
this.driver.disablePinchToZoom(this.map);
|
|
2242
|
+
}
|
|
2243
|
+
enableRotate() {
|
|
2244
|
+
this.driver.enableRotate(this.map);
|
|
2245
|
+
}
|
|
2246
|
+
disableRotate() {
|
|
2247
|
+
this.driver.disableRotate(this.map);
|
|
2248
|
+
}
|
|
2249
|
+
enableRotateGestures() {
|
|
2250
|
+
this.driver.enableRotateGestures(this.map);
|
|
2251
|
+
}
|
|
2252
|
+
disableRotateGestures() {
|
|
2253
|
+
this.driver.disableRotateGestures(this.map);
|
|
2254
|
+
}
|
|
2255
|
+
enableTilt() {
|
|
2256
|
+
this.driver.enableTilt(this.map);
|
|
2257
|
+
}
|
|
2258
|
+
disableTilt() {
|
|
2259
|
+
this.driver.disableTilt(this.map);
|
|
2260
|
+
}
|
|
2261
|
+
enableTiltGestures() {
|
|
2262
|
+
this.driver.enableTiltGestures(this.map);
|
|
2263
|
+
}
|
|
2264
|
+
disableTiltGestures() {
|
|
2265
|
+
this.driver.disableTiltGestures(this.map);
|
|
2266
|
+
}
|
|
2267
|
+
enableAutoResize() {
|
|
2268
|
+
this.driver.enableAutoResize(this.map);
|
|
2269
|
+
}
|
|
2270
|
+
disableAutoResize() {
|
|
2271
|
+
this.driver.disableAutoResize(this.map);
|
|
2272
|
+
}
|
|
2273
|
+
// ─── 视角 ───
|
|
2274
|
+
setHeading(a, r) {
|
|
2275
|
+
this.driver.setHeading(this.map, a, r);
|
|
2276
|
+
}
|
|
2277
|
+
getHeading() {
|
|
2278
|
+
return this.driver.getHeading(this.map);
|
|
2279
|
+
}
|
|
2280
|
+
setTilt(a, r) {
|
|
2281
|
+
this.driver.setTilt(this.map, a, r);
|
|
2282
|
+
}
|
|
2283
|
+
getTilt() {
|
|
2284
|
+
return this.driver.getTilt(this.map);
|
|
2285
|
+
}
|
|
2286
|
+
getCurrentMaxTilt() {
|
|
2287
|
+
return this.driver.getCurrentMaxTilt(this.map);
|
|
2288
|
+
}
|
|
2289
|
+
// ─── 缩放级别 ───
|
|
2290
|
+
setMinZoom(a) {
|
|
2291
|
+
this.driver.setMinZoom(this.map, a);
|
|
2292
|
+
}
|
|
2293
|
+
setMaxZoom(a) {
|
|
2294
|
+
this.driver.setMaxZoom(this.map, a);
|
|
2295
|
+
}
|
|
2296
|
+
getMinZoom() {
|
|
2297
|
+
return this.driver.getMinZoom(this.map);
|
|
2298
|
+
}
|
|
2299
|
+
getMaxZoom() {
|
|
2300
|
+
return this.driver.getMaxZoom(this.map);
|
|
2301
|
+
}
|
|
2302
|
+
// ─── resize ───
|
|
2303
|
+
checkResize() {
|
|
2304
|
+
this.driver.checkResize(this.map);
|
|
2305
|
+
}
|
|
2306
|
+
resize() {
|
|
2307
|
+
this.driver.resize(this.map);
|
|
2308
|
+
}
|
|
2309
|
+
setSize(a) {
|
|
2310
|
+
this.driver.setSize(this.map, a);
|
|
2311
|
+
}
|
|
2312
|
+
zoomTo(a, r) {
|
|
2313
|
+
this.driver.zoomTo(this.map, a, r);
|
|
2314
|
+
}
|
|
2315
|
+
// ─── 显示配置 ───
|
|
2316
|
+
setDisplayOptions(a) {
|
|
2317
|
+
this.driver.setDisplayOptions(this.map, a);
|
|
2318
|
+
}
|
|
2319
|
+
setOptions(a) {
|
|
2320
|
+
this.driver.setOptions(this.map, a);
|
|
2321
|
+
}
|
|
2322
|
+
// ─── 容器信息 ───
|
|
2323
|
+
getSize() {
|
|
2324
|
+
return this.driver.getSize(this.map);
|
|
2325
|
+
}
|
|
2326
|
+
getContainerSize() {
|
|
2327
|
+
return this.driver.getContainerSize(this.map);
|
|
2328
|
+
}
|
|
2329
|
+
getZoomUnits() {
|
|
2330
|
+
return this.driver.getZoomUnits(this.map);
|
|
2331
|
+
}
|
|
2332
|
+
getContainer() {
|
|
2333
|
+
return this.driver.getContainer(this.map);
|
|
2334
|
+
}
|
|
2335
|
+
// ─── 坐标转换 ───
|
|
2336
|
+
pixelToPoint(a, r) {
|
|
2337
|
+
return this.driver.pixelToPoint(this.map, a, r);
|
|
2338
|
+
}
|
|
2339
|
+
pointToPixel(a, r) {
|
|
2340
|
+
return this.driver.pointToPixel(this.map, a, r);
|
|
2341
|
+
}
|
|
2342
|
+
lnglatToMercator(a, r) {
|
|
2343
|
+
return this.driver.lnglatToMercator(this.map, a, r);
|
|
2344
|
+
}
|
|
2345
|
+
mercatorToLnglat(a, r) {
|
|
2346
|
+
return this.driver.mercatorToLnglat(this.map, a, r);
|
|
2347
|
+
}
|
|
2348
|
+
pointToOverlayPixel(a, r) {
|
|
2349
|
+
return this.driver.pointToOverlayPixel(this.map, a, r);
|
|
2350
|
+
}
|
|
2351
|
+
overlayPixelToPoint(a, r) {
|
|
2352
|
+
return this.driver.overlayPixelToPoint(this.map, a, r);
|
|
2353
|
+
}
|
|
2354
|
+
getDistance(a, r) {
|
|
2355
|
+
return this.driver.getDistance(this.map, a, r);
|
|
2356
|
+
}
|
|
2357
|
+
// ─── 地图状态 ───
|
|
2358
|
+
isLoaded() {
|
|
2359
|
+
return this.driver.isLoaded(this.map);
|
|
2360
|
+
}
|
|
2361
|
+
getCoordType() {
|
|
2362
|
+
return this.driver.getCoordType(this.map);
|
|
2363
|
+
}
|
|
2364
|
+
getMapTypeId() {
|
|
2365
|
+
return this.driver.getMapTypeId(this.map);
|
|
2366
|
+
}
|
|
2367
|
+
getMapCoordType() {
|
|
2368
|
+
return this.driver.getMapCoordType(this.map);
|
|
2369
|
+
}
|
|
2370
|
+
getMapStyleId() {
|
|
2371
|
+
return this.driver.getMapStyleId(this.map);
|
|
2372
|
+
}
|
|
2373
|
+
getAreaStyleId() {
|
|
2374
|
+
return this.driver.getAreaStyleId(this.map);
|
|
2375
|
+
}
|
|
2376
|
+
getRenderType() {
|
|
2377
|
+
return this.driver.getRenderType(this.map);
|
|
2378
|
+
}
|
|
2379
|
+
isCanvasMap() {
|
|
2380
|
+
return this.driver.isCanvasMap(this.map);
|
|
2381
|
+
}
|
|
2382
|
+
getProjection() {
|
|
2383
|
+
return this.driver.getProjection(this.map);
|
|
2384
|
+
}
|
|
2385
|
+
getSolarInfo(a) {
|
|
2386
|
+
return this.driver.getSolarInfo(this.map, a);
|
|
2387
|
+
}
|
|
2388
|
+
getTileId(a, r) {
|
|
2389
|
+
return this.driver.getTileId(this.map, a, r);
|
|
2390
|
+
}
|
|
2391
|
+
getPoiByUid(a, r) {
|
|
2392
|
+
this.driver.getPoiByUid(this.map, a, r);
|
|
2393
|
+
}
|
|
2394
|
+
getPanes() {
|
|
2395
|
+
return this.driver.getPanes(this.map);
|
|
2396
|
+
}
|
|
2397
|
+
getInfoWindow() {
|
|
2398
|
+
return this.driver.getInfoWindow(this.map);
|
|
2399
|
+
}
|
|
2400
|
+
// ─── Spots / 标注 ───
|
|
2401
|
+
addSpots(a, r) {
|
|
2402
|
+
return this.driver.addSpots(this.map, a, r);
|
|
2403
|
+
}
|
|
2404
|
+
getSpots(a) {
|
|
2405
|
+
return this.driver.getSpots(this.map, a);
|
|
2406
|
+
}
|
|
2407
|
+
removeSpots(a) {
|
|
2408
|
+
this.driver.removeSpots(this.map, a);
|
|
2409
|
+
}
|
|
2410
|
+
clearSpots() {
|
|
2411
|
+
this.driver.clearSpots(this.map);
|
|
2412
|
+
}
|
|
2413
|
+
resetSpotStatus() {
|
|
2414
|
+
this.driver.resetSpotStatus(this.map);
|
|
2415
|
+
}
|
|
2416
|
+
hightlightSpotByUid(a, r) {
|
|
2417
|
+
this.driver.hightlightSpotByUid(this.map, a, r);
|
|
2418
|
+
}
|
|
2419
|
+
addAreaSpot(a, r) {
|
|
2420
|
+
return this.driver.addAreaSpot(this.map, a, r);
|
|
2421
|
+
}
|
|
2422
|
+
getAreaSpot(a) {
|
|
2423
|
+
return this.driver.getAreaSpot(this.map, a);
|
|
2424
|
+
}
|
|
2425
|
+
removeAreaSpot(a) {
|
|
2426
|
+
this.driver.removeAreaSpot(this.map, a);
|
|
2427
|
+
}
|
|
2428
|
+
clearAreaSpots() {
|
|
2429
|
+
this.driver.clearAreaSpots(this.map);
|
|
2430
|
+
}
|
|
2431
|
+
clearLabels() {
|
|
2432
|
+
this.driver.clearLabels(this.map);
|
|
2433
|
+
}
|
|
2434
|
+
addMapLabels(a) {
|
|
2435
|
+
return this.driver.addMapLabels(this.map, a);
|
|
2436
|
+
}
|
|
2437
|
+
removeMapLabels(a) {
|
|
2438
|
+
this.driver.removeMapLabels(this.map, a);
|
|
2439
|
+
}
|
|
2440
|
+
getIconByClickPosition(a) {
|
|
2441
|
+
return this.driver.getIconByClickPosition(this.map, a);
|
|
2442
|
+
}
|
|
2443
|
+
setBounds(a) {
|
|
2444
|
+
this.driver.setBounds(this.map, a);
|
|
2445
|
+
}
|
|
2446
|
+
// ─── 视野控制 ───
|
|
2447
|
+
centerAndZoom(a, r, s) {
|
|
2448
|
+
this.driver.centerAndZoom(this.map, a, r, s);
|
|
2449
|
+
}
|
|
2450
|
+
panTo(a, r) {
|
|
2451
|
+
this.driver.panTo(this.map, a, r);
|
|
2452
|
+
}
|
|
2453
|
+
panBy(a, r, s) {
|
|
2454
|
+
this.driver.panBy(this.map, a, r, s);
|
|
2455
|
+
}
|
|
2456
|
+
flyTo(a, r, s) {
|
|
2457
|
+
this.driver.flyTo(this.map, a, r, s);
|
|
2458
|
+
}
|
|
2459
|
+
reset() {
|
|
2460
|
+
this.driver.reset(this.map);
|
|
2461
|
+
}
|
|
2462
|
+
setCenter(a, r) {
|
|
2463
|
+
this.driver.setCenter(this.map, a, r);
|
|
2464
|
+
}
|
|
2465
|
+
getCenter() {
|
|
2466
|
+
return this.driver.getCenter(this.map);
|
|
2467
|
+
}
|
|
2468
|
+
setViewport(a, r) {
|
|
2469
|
+
this.driver.setViewport(this.map, a, r);
|
|
2470
|
+
}
|
|
2471
|
+
getViewport(a, r) {
|
|
2472
|
+
return this.driver.getViewport(this.map, a, r);
|
|
2473
|
+
}
|
|
2474
|
+
setZoom(a, r) {
|
|
2475
|
+
this.driver.setZoom(this.map, a, r);
|
|
2476
|
+
}
|
|
2477
|
+
getZoom() {
|
|
2478
|
+
return this.driver.getZoom(this.map);
|
|
2479
|
+
}
|
|
2480
|
+
zoomIn(a) {
|
|
2481
|
+
this.driver.zoomIn(this.map, a);
|
|
2482
|
+
}
|
|
2483
|
+
zoomOut(a) {
|
|
2484
|
+
this.driver.zoomOut(this.map, a);
|
|
2485
|
+
}
|
|
2486
|
+
getBounds() {
|
|
2487
|
+
return this.driver.getBounds(this.map);
|
|
2488
|
+
}
|
|
2489
|
+
restrictBounds(a) {
|
|
2490
|
+
this.driver.restrictBounds(this.map, a);
|
|
2491
|
+
}
|
|
2492
|
+
// ─── 地图类型 ───
|
|
2493
|
+
setMapType(a) {
|
|
2494
|
+
this.driver.setMapType(this.map, a);
|
|
2495
|
+
}
|
|
2496
|
+
getMapType() {
|
|
2497
|
+
return this.driver.getMapType(this.map);
|
|
2498
|
+
}
|
|
2499
|
+
// ─── 控件 / 右键菜单 ───
|
|
2500
|
+
addControl(a) {
|
|
2501
|
+
this.driver.addControl(this.map, a);
|
|
2502
|
+
}
|
|
2503
|
+
removeControl(a) {
|
|
2504
|
+
this.driver.removeControl(this.map, a);
|
|
2505
|
+
}
|
|
2506
|
+
addContextMenu(a) {
|
|
2507
|
+
this.driver.addContextMenu(this.map, a);
|
|
2508
|
+
}
|
|
2509
|
+
removeContextMenu(a) {
|
|
2510
|
+
this.driver.removeContextMenu(this.map, a);
|
|
2511
|
+
}
|
|
2512
|
+
// ─── 覆盖物 ───
|
|
2513
|
+
addOverlay(a) {
|
|
2514
|
+
this.driver.addOverlay(this.map, a);
|
|
2515
|
+
}
|
|
2516
|
+
removeOverlay(a) {
|
|
2517
|
+
this.driver.removeOverlay(this.map, a);
|
|
2518
|
+
}
|
|
2519
|
+
clearOverlays() {
|
|
2520
|
+
this.driver.clearOverlays(this.map);
|
|
2521
|
+
}
|
|
2522
|
+
getOverlays() {
|
|
2523
|
+
return this.driver.getOverlays(this.map);
|
|
2524
|
+
}
|
|
2525
|
+
// ─── 图层 ───
|
|
2526
|
+
addLayer(a) {
|
|
2527
|
+
this.driver.addLayer(this.map, a);
|
|
2528
|
+
}
|
|
2529
|
+
removeLayer(a) {
|
|
2530
|
+
this.driver.removeLayer(this.map, a);
|
|
2531
|
+
}
|
|
2532
|
+
addTileLayer(a) {
|
|
2533
|
+
this.driver.addTileLayer(this.map, a);
|
|
2534
|
+
}
|
|
2535
|
+
removeTileLayer(a) {
|
|
2536
|
+
this.driver.removeTileLayer(this.map, a);
|
|
2537
|
+
}
|
|
2538
|
+
getTileLayer(a) {
|
|
2539
|
+
return this.driver.getTileLayer(this.map, a);
|
|
2540
|
+
}
|
|
2541
|
+
addGeoJSONLayer(a) {
|
|
2542
|
+
this.driver.addGeoJSONLayer(this.map, a);
|
|
2543
|
+
}
|
|
2544
|
+
removeGeoJSONLayer(a) {
|
|
2545
|
+
this.driver.removeGeoJSONLayer(this.map, a);
|
|
2546
|
+
}
|
|
2547
|
+
addDistrictLayer(a) {
|
|
2548
|
+
this.driver.addDistrictLayer(this.map, a);
|
|
2549
|
+
}
|
|
2550
|
+
removeDistrictLayer(a) {
|
|
2551
|
+
this.driver.removeDistrictLayer(this.map, a);
|
|
2552
|
+
}
|
|
2553
|
+
addNormalLayer(a) {
|
|
2554
|
+
this.driver.addNormalLayer(this.map, a);
|
|
2555
|
+
}
|
|
2556
|
+
removeNormalLayer(a) {
|
|
2557
|
+
this.driver.removeNormalLayer(this.map, a);
|
|
2558
|
+
}
|
|
2559
|
+
setTrafficOn() {
|
|
2560
|
+
this.driver.setTrafficOn(this.map);
|
|
2561
|
+
}
|
|
2562
|
+
setTrafficOff() {
|
|
2563
|
+
this.driver.setTrafficOff(this.map);
|
|
2564
|
+
}
|
|
2565
|
+
showOverlayContainer() {
|
|
2566
|
+
this.driver.showOverlayContainer(this.map);
|
|
2567
|
+
}
|
|
2568
|
+
hideOverlayContainer() {
|
|
2569
|
+
this.driver.hideOverlayContainer(this.map);
|
|
2570
|
+
}
|
|
2571
|
+
// ─── 信息窗口 ───
|
|
2572
|
+
openInfoWindow(a, r) {
|
|
2573
|
+
this.driver.openInfoWindow(this.map, a, r);
|
|
2574
|
+
}
|
|
2575
|
+
closeInfoWindow() {
|
|
2576
|
+
this.driver.closeInfoWindow(this.map);
|
|
2577
|
+
}
|
|
2578
|
+
// ─── 样式 / 主题 ───
|
|
2579
|
+
setMapStyle(a) {
|
|
2580
|
+
this.driver.setMapStyle(this.map, a);
|
|
2581
|
+
}
|
|
2582
|
+
setMapStyleV2(a) {
|
|
2583
|
+
this.driver.setMapStyleV2(this.map, a);
|
|
2584
|
+
}
|
|
2585
|
+
setTheme(a, r) {
|
|
2586
|
+
this.driver.setTheme(this.map, a, r);
|
|
2587
|
+
}
|
|
2588
|
+
setCopyrightOffset(a, r) {
|
|
2589
|
+
this.driver.setCopyrightOffset(this.map, a, r);
|
|
2590
|
+
}
|
|
2591
|
+
setDefaultCursor(a) {
|
|
2592
|
+
this.driver.setDefaultCursor(this.map, a);
|
|
2593
|
+
}
|
|
2594
|
+
getDefaultCursor() {
|
|
2595
|
+
return this.driver.getDefaultCursor(this.map);
|
|
2596
|
+
}
|
|
2597
|
+
setDraggingCursor(a) {
|
|
2598
|
+
this.driver.setDraggingCursor(this.map, a);
|
|
2599
|
+
}
|
|
2600
|
+
getDraggingCursor() {
|
|
2601
|
+
return this.driver.getDraggingCursor(this.map);
|
|
2602
|
+
}
|
|
2603
|
+
setOverlayMoveCursor(a) {
|
|
2604
|
+
this.driver.setOverlayMoveCursor(this.map, a);
|
|
2605
|
+
}
|
|
2606
|
+
// ─── 视角动画 ───
|
|
2607
|
+
startViewAnimation(a) {
|
|
2608
|
+
return this.driver.startViewAnimation(this.map, a);
|
|
2609
|
+
}
|
|
2610
|
+
pauseViewAnimation(a) {
|
|
2611
|
+
this.driver.pauseViewAnimation(this.map, a);
|
|
2612
|
+
}
|
|
2613
|
+
continueViewAnimation(a) {
|
|
2614
|
+
this.driver.continueViewAnimation(this.map, a);
|
|
2615
|
+
}
|
|
2616
|
+
cancelViewAnimation(a) {
|
|
2617
|
+
this.driver.cancelViewAnimation(this.map, a);
|
|
2618
|
+
}
|
|
2619
|
+
// ─── 截图 ───
|
|
2620
|
+
getScreenshot() {
|
|
2621
|
+
return this.driver.getScreenshot(this.map);
|
|
2622
|
+
}
|
|
2623
|
+
// ─── 地球模式 ───
|
|
2624
|
+
isSupportEarth() {
|
|
2625
|
+
return this.driver.isSupportEarth(this.map);
|
|
2626
|
+
}
|
|
2627
|
+
getEarth() {
|
|
2628
|
+
return this.driver.getEarth(this.map);
|
|
2629
|
+
}
|
|
2630
|
+
showEarthBoundary() {
|
|
2631
|
+
this.driver.showEarthBoundary(this.map);
|
|
2632
|
+
}
|
|
2633
|
+
hideEarthBoundary() {
|
|
2634
|
+
this.driver.hideEarthBoundary(this.map);
|
|
2635
|
+
}
|
|
2636
|
+
setEarthMaxZoom(a) {
|
|
2637
|
+
this.driver.setEarthMaxZoom(this.map, a);
|
|
2638
|
+
}
|
|
2639
|
+
setEarthMinZoom(a) {
|
|
2640
|
+
this.driver.setEarthMinZoom(this.map, a);
|
|
2641
|
+
}
|
|
2642
|
+
// ─── 室内 ───
|
|
2643
|
+
showIndoor(a, r) {
|
|
2644
|
+
this.driver.showIndoor(this.map, a, r);
|
|
2645
|
+
}
|
|
2646
|
+
setIndoor(a, r) {
|
|
2647
|
+
this.driver.setIndoor(this.map, a, r);
|
|
2648
|
+
}
|
|
2649
|
+
getIndoorInfo() {
|
|
2650
|
+
return this.driver.getIndoorInfo(this.map);
|
|
2651
|
+
}
|
|
2652
|
+
initIndoorLayer(a) {
|
|
2653
|
+
return this.driver.initIndoorLayer(this.map, a);
|
|
2654
|
+
}
|
|
2655
|
+
setNormalMapDisplay(a) {
|
|
2656
|
+
this.driver.setNormalMapDisplay(this.map, a);
|
|
2657
|
+
}
|
|
2658
|
+
getVectorContainer() {
|
|
2659
|
+
return this.driver.getVectorContainer(this.map);
|
|
2660
|
+
}
|
|
2661
|
+
// ─── 街景图层 ───
|
|
2662
|
+
showStreetLayer(a) {
|
|
2663
|
+
this.driver.showStreetLayer(this.map, a);
|
|
2664
|
+
}
|
|
2665
|
+
hideStreetLayer() {
|
|
2666
|
+
this.driver.hideStreetLayer(this.map);
|
|
2667
|
+
}
|
|
2668
|
+
isStreetLayerShow() {
|
|
2669
|
+
return this.driver.isStreetLayerShow(this.map);
|
|
2670
|
+
}
|
|
2671
|
+
showVectorStreetLayer() {
|
|
2672
|
+
this.driver.showVectorStreetLayer(this.map);
|
|
2673
|
+
}
|
|
2674
|
+
hideVectorStreetLayer() {
|
|
2675
|
+
this.driver.hideVectorStreetLayer(this.map);
|
|
2676
|
+
}
|
|
2677
|
+
// ─── 语言 ───
|
|
2678
|
+
getLanguage() {
|
|
2679
|
+
return this.driver.getLanguage(this.map);
|
|
2680
|
+
}
|
|
2681
|
+
changeLanguage(a) {
|
|
2682
|
+
this.driver.changeLanguage(this.map, a);
|
|
2683
|
+
}
|
|
2684
|
+
enablePreferredLanguage(a) {
|
|
2685
|
+
this.driver.enablePreferredLanguage(this.map, a);
|
|
2686
|
+
}
|
|
2687
|
+
disablePreferredLanguage() {
|
|
2688
|
+
this.driver.disablePreferredLanguage(this.map);
|
|
2689
|
+
}
|
|
2690
|
+
// ─── 私有 / 焦点遮罩 / 自定义 HTML 图层 ───
|
|
2691
|
+
setLock(a) {
|
|
2692
|
+
this.driver.setLock(this.map, a);
|
|
2693
|
+
}
|
|
2694
|
+
setPrivateRegions(a) {
|
|
2695
|
+
this.driver.setPrivateRegions(this.map, a);
|
|
2696
|
+
}
|
|
2697
|
+
getPrivateRegions() {
|
|
2698
|
+
return this.driver.getPrivateRegions(this.map);
|
|
2699
|
+
}
|
|
2700
|
+
setPrivateStatus(a) {
|
|
2701
|
+
this.driver.setPrivateStatus(this.map, a);
|
|
2702
|
+
}
|
|
2703
|
+
getPrivateStatus() {
|
|
2704
|
+
return this.driver.getPrivateStatus(this.map);
|
|
2705
|
+
}
|
|
2706
|
+
setCustomArea(a) {
|
|
2707
|
+
this.driver.setCustomArea(this.map, a);
|
|
2708
|
+
}
|
|
2709
|
+
addFocusMask(a) {
|
|
2710
|
+
this.driver.addFocusMask(this.map, a);
|
|
2711
|
+
}
|
|
2712
|
+
removeFocusMask(a) {
|
|
2713
|
+
this.driver.removeFocusMask(this.map, a);
|
|
2714
|
+
}
|
|
2715
|
+
clearFocusMasks() {
|
|
2716
|
+
this.driver.clearFocusMasks(this.map);
|
|
2717
|
+
}
|
|
2718
|
+
addCustomHtmlLayer(a) {
|
|
2719
|
+
this.driver.addCustomHtmlLayer(this.map, a);
|
|
2720
|
+
}
|
|
2721
|
+
removeCustomHtmlLayer(a) {
|
|
2722
|
+
this.driver.removeCustomHtmlLayer(this.map, a);
|
|
2723
|
+
}
|
|
2724
|
+
addParkingSpot(a) {
|
|
2725
|
+
this.driver.addParkingSpot(this.map, a);
|
|
2726
|
+
}
|
|
2727
|
+
removeParkingSpot(a) {
|
|
2728
|
+
this.driver.removeParkingSpot(this.map, a);
|
|
2729
|
+
}
|
|
2730
|
+
// ─── 3.0-only ───
|
|
2731
|
+
enableMapClick() {
|
|
2732
|
+
this.driver.enableMapClick(this.map);
|
|
2733
|
+
}
|
|
2734
|
+
disableMapClick() {
|
|
2735
|
+
this.driver.disableMapClick(this.map);
|
|
2736
|
+
}
|
|
2737
|
+
enable3DBuilding() {
|
|
2738
|
+
this.driver.enable3DBuilding(this.map);
|
|
2739
|
+
}
|
|
2740
|
+
disable3DBuilding() {
|
|
2741
|
+
this.driver.disable3DBuilding(this.map);
|
|
2742
|
+
}
|
|
2743
|
+
setPanorama(a) {
|
|
2744
|
+
this.driver.setPanorama(this.map, a);
|
|
2745
|
+
}
|
|
2746
|
+
getPanorama() {
|
|
2747
|
+
return this.driver.getPanorama(this.map);
|
|
2748
|
+
}
|
|
2749
|
+
setCurrentCity(a) {
|
|
2750
|
+
this.driver.setCurrentCity(this.map, a);
|
|
2751
|
+
}
|
|
2752
|
+
highResolutionEnabled() {
|
|
2753
|
+
return this.driver.highResolutionEnabled(this.map);
|
|
2754
|
+
}
|
|
2755
|
+
addHotspot(a) {
|
|
2756
|
+
this.driver.addHotspot(this.map, a);
|
|
2757
|
+
}
|
|
2758
|
+
removeHotspot(a) {
|
|
2759
|
+
this.driver.removeHotspot(this.map, a);
|
|
2760
|
+
}
|
|
2761
|
+
clearHotspots() {
|
|
2762
|
+
this.driver.clearHotspots(this.map);
|
|
2763
|
+
}
|
|
2764
|
+
// ─── 事件 ───
|
|
2765
|
+
addEventListener(a, r) {
|
|
2766
|
+
return this.driver.addEventListener(this.map, a, r);
|
|
2767
|
+
}
|
|
2768
|
+
removeEventListener(a, r) {
|
|
2769
|
+
this.driver.removeEventListener(this.map, a, r);
|
|
2770
|
+
}
|
|
2771
|
+
// ─── Map 维护 ───
|
|
2772
|
+
destroy() {
|
|
2773
|
+
this.driver.destroyMap(this.map);
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
const Pt = {
|
|
2777
|
+
onClick: "click",
|
|
2778
|
+
onDblClick: "dblclick",
|
|
2779
|
+
onRightClick: "rightclick",
|
|
2780
|
+
onMouseMove: "mousemove",
|
|
2781
|
+
onMouseDown: "mousedown",
|
|
2782
|
+
onMouseUp: "mouseup",
|
|
2783
|
+
onMouseOver: "mouseover",
|
|
2784
|
+
onMouseOut: "mouseout",
|
|
2785
|
+
onDragStart: "dragstart",
|
|
2786
|
+
onDragging: "dragging",
|
|
2787
|
+
onDragEnd: "dragend",
|
|
2788
|
+
onMoveStart: "movestart",
|
|
2789
|
+
onMoving: "moving",
|
|
2790
|
+
onMoveEnd: "moveend",
|
|
2791
|
+
onZoomStart: "zoomstart",
|
|
2792
|
+
onZooming: "zooming",
|
|
2793
|
+
onZoomEnd: "zoomend",
|
|
2794
|
+
onResize: "resize",
|
|
2795
|
+
onTilesLoaded: "tilesloaded",
|
|
2796
|
+
onMapTypeChange: "maptypechange",
|
|
2797
|
+
onTouchStart: "touchstart",
|
|
2798
|
+
onTouchMove: "touchmove",
|
|
2799
|
+
onTouchEnd: "touchend",
|
|
2800
|
+
onLongPress: "longpress"
|
|
2801
|
+
}, To = [
|
|
2802
|
+
"enableDragging",
|
|
2803
|
+
"enableInertialDragging",
|
|
2804
|
+
"enableScrollWheelZoom",
|
|
2805
|
+
"enableContinuousZoom",
|
|
2806
|
+
"enableResizeOnCenter",
|
|
2807
|
+
"enableDoubleClickZoom",
|
|
2808
|
+
"enableKeyboard",
|
|
2809
|
+
"enablePinchToZoom",
|
|
2810
|
+
"enableRotate",
|
|
2811
|
+
"enableRotateGestures",
|
|
2812
|
+
"enableTilt",
|
|
2813
|
+
"enableTiltGestures",
|
|
2814
|
+
"enableAutoResize",
|
|
2815
|
+
"enableIconInfoWindow"
|
|
2816
|
+
], Wa = w({
|
|
2817
|
+
name: "Map",
|
|
2818
|
+
inheritAttrs: !1,
|
|
2819
|
+
props: {
|
|
2820
|
+
center: { type: Object, default: void 0 },
|
|
2821
|
+
zoom: { type: Number, default: void 0 },
|
|
2822
|
+
heading: { type: Number, default: void 0 },
|
|
2823
|
+
tilt: { type: Number, default: void 0 },
|
|
2824
|
+
defaultCenter: { type: Object, default: void 0 },
|
|
2825
|
+
defaultZoom: { type: Number, default: void 0 },
|
|
2826
|
+
defaultHeading: { type: Number, default: void 0 },
|
|
2827
|
+
defaultTilt: { type: Number, default: void 0 },
|
|
2828
|
+
options: { type: Object, default: void 0 },
|
|
2829
|
+
displayOptions: { type: Object, default: void 0 },
|
|
2830
|
+
mapStyle: { default: void 0 },
|
|
2831
|
+
mapStyleV2: { default: void 0 },
|
|
2832
|
+
minZoom: { type: Number, default: void 0 },
|
|
2833
|
+
maxZoom: { type: Number, default: void 0 },
|
|
2834
|
+
bounds: { type: Object, default: void 0 },
|
|
2835
|
+
mapType: { type: [String, Number], default: void 0 },
|
|
2836
|
+
defaultCursor: { type: String, default: void 0 },
|
|
2837
|
+
draggingCursor: { type: String, default: void 0 },
|
|
2838
|
+
theme: { type: String, default: void 0 },
|
|
2839
|
+
enablePreferredLanguage: { type: [String, Boolean], default: void 0 },
|
|
2840
|
+
enableDragging: { type: Boolean, default: void 0 },
|
|
2841
|
+
enableInertialDragging: { type: Boolean, default: void 0 },
|
|
2842
|
+
enableScrollWheelZoom: { type: Boolean, default: void 0 },
|
|
2843
|
+
enableContinuousZoom: { type: Boolean, default: void 0 },
|
|
2844
|
+
enableResizeOnCenter: { type: Boolean, default: void 0 },
|
|
2845
|
+
enableDoubleClickZoom: { type: Boolean, default: void 0 },
|
|
2846
|
+
enableKeyboard: { type: Boolean, default: void 0 },
|
|
2847
|
+
enablePinchToZoom: { type: Boolean, default: void 0 },
|
|
2848
|
+
enableRotate: { type: Boolean, default: void 0 },
|
|
2849
|
+
enableRotateGestures: { type: Boolean, default: void 0 },
|
|
2850
|
+
enableTilt: { type: Boolean, default: void 0 },
|
|
2851
|
+
enableTiltGestures: { type: Boolean, default: void 0 },
|
|
2852
|
+
enableAutoResize: { type: Boolean, default: void 0 },
|
|
2853
|
+
enableIconInfoWindow: { type: Boolean, default: void 0 },
|
|
2854
|
+
onReady: { type: Function, default: void 0 },
|
|
2855
|
+
onCenterChange: { type: Function, default: void 0 },
|
|
2856
|
+
onZoomChange: { type: Function, default: void 0 }
|
|
2857
|
+
},
|
|
2858
|
+
setup(o, { slots: a, attrs: r, expose: s }) {
|
|
2859
|
+
const h = ee(), c = Q(null), p = Q(null);
|
|
2860
|
+
Le($, p);
|
|
2861
|
+
let d = null, u = [], C = !1;
|
|
2862
|
+
const v = (l) => {
|
|
2863
|
+
C = !0;
|
|
2864
|
+
try {
|
|
2865
|
+
l();
|
|
2866
|
+
} catch (f) {
|
|
2867
|
+
console.warn("[vue-bmap] map controlled sync failed", f);
|
|
2868
|
+
}
|
|
2869
|
+
requestAnimationFrame(() => {
|
|
2870
|
+
C = !1;
|
|
2871
|
+
});
|
|
2872
|
+
}, t = () => {
|
|
2873
|
+
const { driver: l, status: f } = h.value;
|
|
2874
|
+
if (f !== "ready" || !l || !c.value || d) return;
|
|
2875
|
+
const g = { ...o.options ?? {} };
|
|
2876
|
+
Object.keys(g).forEach((_) => g[_] === void 0 && delete g[_]);
|
|
2877
|
+
const m = o.mapStyleV2 ?? o.mapStyle;
|
|
2878
|
+
m !== void 0 && (g.style = m), d = l.createMap(c.value, g);
|
|
2879
|
+
const b = o.defaultCenter ?? o.center, P = o.defaultZoom ?? o.zoom ?? 11;
|
|
2880
|
+
if (b)
|
|
2881
|
+
try {
|
|
2882
|
+
l.centerAndZoom(d, b, P, { noAnimation: !0 });
|
|
2883
|
+
} catch (_) {
|
|
2884
|
+
console.warn("[vue-bmap] centerAndZoom failed", _);
|
|
2885
|
+
}
|
|
2886
|
+
const O = o.defaultHeading ?? o.heading, A = o.defaultTilt ?? o.tilt;
|
|
2887
|
+
if (O != null)
|
|
2888
|
+
try {
|
|
2889
|
+
l.setHeading(d, O, { noAnimation: !0 });
|
|
2890
|
+
} catch {
|
|
2891
|
+
}
|
|
2892
|
+
if (A != null)
|
|
2893
|
+
try {
|
|
2894
|
+
l.setTilt(d, A, { noAnimation: !0 });
|
|
2895
|
+
} catch {
|
|
2896
|
+
}
|
|
2897
|
+
if (o.mapType !== void 0)
|
|
2898
|
+
try {
|
|
2899
|
+
l.setMapType(d, o.mapType);
|
|
2900
|
+
} catch {
|
|
2901
|
+
}
|
|
2902
|
+
if (o.displayOptions !== void 0)
|
|
2903
|
+
try {
|
|
2904
|
+
l.setDisplayOptions(d, o.displayOptions);
|
|
2905
|
+
} catch {
|
|
2906
|
+
}
|
|
2907
|
+
let k = !1;
|
|
2908
|
+
const N = () => {
|
|
2909
|
+
var _;
|
|
2910
|
+
k || !d || (k = !0, p.value = { map: d, driver: l }, (_ = o.onReady) == null || _.call(o, d));
|
|
2911
|
+
};
|
|
2912
|
+
u.push(l.addEventListener(d, "tilesloaded", N));
|
|
2913
|
+
const R = setTimeout(N, 500);
|
|
2914
|
+
u.push(() => clearTimeout(R)), u.push(l.addEventListener(d, "moveend", () => {
|
|
2915
|
+
var _;
|
|
2916
|
+
C || !d || (_ = o.onCenterChange) == null || _.call(o, l.getCenter(d));
|
|
2917
|
+
})), u.push(l.addEventListener(d, "zoomend", () => {
|
|
2918
|
+
var _;
|
|
2919
|
+
C || !d || (_ = o.onZoomChange) == null || _.call(o, l.getZoom(d));
|
|
2920
|
+
}));
|
|
2921
|
+
for (const [_, G] of Object.entries(Pt))
|
|
2922
|
+
typeof (o[_] ?? r[_]) == "function" && u.push(l.addEventListener(d, G, (le) => {
|
|
2923
|
+
const te = o[_] ?? r[_];
|
|
2924
|
+
typeof te == "function" && te(le);
|
|
2925
|
+
}));
|
|
2926
|
+
}, i = () => {
|
|
2927
|
+
u.forEach((f) => f()), u = [];
|
|
2928
|
+
const { driver: l } = h.value;
|
|
2929
|
+
if (d && l)
|
|
2930
|
+
try {
|
|
2931
|
+
l.destroyMap(d);
|
|
2932
|
+
} catch {
|
|
2933
|
+
}
|
|
2934
|
+
d = null, p.value = null;
|
|
2935
|
+
};
|
|
2936
|
+
At(() => {
|
|
2937
|
+
t(), T(() => h.value.status, () => t());
|
|
2938
|
+
}), Tt(i);
|
|
2939
|
+
const e = () => h.value.driver;
|
|
2940
|
+
T(() => {
|
|
2941
|
+
var l, f;
|
|
2942
|
+
return [(l = o.center) == null ? void 0 : l.lng, (f = o.center) == null ? void 0 : f.lat];
|
|
2943
|
+
}, () => {
|
|
2944
|
+
const l = e();
|
|
2945
|
+
!d || !l || !o.center || eo(l.getCenter(d), o.center) || v(() => l.setCenter(d, o.center));
|
|
2946
|
+
}), T(() => o.zoom, () => {
|
|
2947
|
+
const l = e();
|
|
2948
|
+
if (!d || !l || o.zoom == null) return;
|
|
2949
|
+
let f;
|
|
2950
|
+
try {
|
|
2951
|
+
f = l.getZoom(d);
|
|
2952
|
+
} catch {
|
|
2953
|
+
}
|
|
2954
|
+
f !== void 0 && f !== o.zoom && v(() => l.setZoom(d, o.zoom));
|
|
2955
|
+
}), T(() => o.heading, () => {
|
|
2956
|
+
const l = e();
|
|
2957
|
+
if (!d || !l || o.heading == null) return;
|
|
2958
|
+
let f;
|
|
2959
|
+
try {
|
|
2960
|
+
f = l.getHeading(d);
|
|
2961
|
+
} catch {
|
|
2962
|
+
return;
|
|
2963
|
+
}
|
|
2964
|
+
typeof f == "number" && !Number.isNaN(f) && Math.abs(f - o.heading) > 0.01 && v(() => l.setHeading(d, o.heading));
|
|
2965
|
+
}), T(() => o.tilt, () => {
|
|
2966
|
+
const l = e();
|
|
2967
|
+
if (!d || !l || o.tilt == null) return;
|
|
2968
|
+
let f;
|
|
2969
|
+
try {
|
|
2970
|
+
f = l.getTilt(d);
|
|
2971
|
+
} catch {
|
|
2972
|
+
return;
|
|
2973
|
+
}
|
|
2974
|
+
typeof f == "number" && !Number.isNaN(f) && Math.abs(f - o.tilt) > 0.01 && v(() => l.setTilt(d, o.tilt));
|
|
2975
|
+
});
|
|
2976
|
+
for (const l of To)
|
|
2977
|
+
T(() => o[l], (f) => {
|
|
2978
|
+
const g = e();
|
|
2979
|
+
if (!d || !g || f === void 0) return;
|
|
2980
|
+
const m = l.slice(6);
|
|
2981
|
+
try {
|
|
2982
|
+
g[`${f ? "enable" : "disable"}${m}`](d);
|
|
2983
|
+
} catch {
|
|
2984
|
+
}
|
|
2985
|
+
});
|
|
2986
|
+
T(() => o.minZoom, (l) => {
|
|
2987
|
+
const f = e();
|
|
2988
|
+
if (d && f && l !== void 0) try {
|
|
2989
|
+
f.setMinZoom(d, l);
|
|
2990
|
+
} catch {
|
|
2991
|
+
}
|
|
2992
|
+
}), T(() => o.maxZoom, (l) => {
|
|
2993
|
+
const f = e();
|
|
2994
|
+
if (d && f && l !== void 0) try {
|
|
2995
|
+
f.setMaxZoom(d, l);
|
|
2996
|
+
} catch {
|
|
2997
|
+
}
|
|
2998
|
+
}), T(() => o.mapType, (l) => {
|
|
2999
|
+
const f = e();
|
|
3000
|
+
if (d && f && l !== void 0) try {
|
|
3001
|
+
f.setMapType(d, l);
|
|
3002
|
+
} catch {
|
|
3003
|
+
}
|
|
3004
|
+
}), T(() => o.defaultCursor, (l) => {
|
|
3005
|
+
const f = e();
|
|
3006
|
+
if (d && f && l !== void 0) try {
|
|
3007
|
+
f.setDefaultCursor(d, l);
|
|
3008
|
+
} catch {
|
|
3009
|
+
}
|
|
3010
|
+
}), T(() => o.draggingCursor, (l) => {
|
|
3011
|
+
const f = e();
|
|
3012
|
+
if (d && f && l !== void 0) try {
|
|
3013
|
+
f.setDraggingCursor(d, l);
|
|
3014
|
+
} catch {
|
|
3015
|
+
}
|
|
3016
|
+
}), T(() => o.theme, (l) => {
|
|
3017
|
+
const f = e();
|
|
3018
|
+
if (d && f && l !== void 0) try {
|
|
3019
|
+
f.setTheme(d, l);
|
|
3020
|
+
} catch {
|
|
3021
|
+
}
|
|
3022
|
+
}), T(() => o.displayOptions, (l) => {
|
|
3023
|
+
const f = e();
|
|
3024
|
+
if (d && f && l !== void 0) try {
|
|
3025
|
+
f.setDisplayOptions(d, l);
|
|
3026
|
+
} catch {
|
|
3027
|
+
}
|
|
3028
|
+
}, { deep: !0 }), T(() => o.mapStyle, (l) => {
|
|
3029
|
+
const f = e();
|
|
3030
|
+
d && f && l !== void 0 && f.setMapStyle(d, l);
|
|
3031
|
+
}), T(() => o.mapStyleV2, (l) => {
|
|
3032
|
+
const f = e();
|
|
3033
|
+
d && f && l !== void 0 && f.setMapStyleV2(d, l);
|
|
3034
|
+
}), s({
|
|
3035
|
+
/** 命令式句柄:panTo/flyTo/setZoom/getBounds/pointToPixel/getScreenshot 等全量方法 */
|
|
3036
|
+
getMapRef: () => {
|
|
3037
|
+
const l = e();
|
|
3038
|
+
return d && l ? new Bt(d, l) : null;
|
|
3039
|
+
}
|
|
3040
|
+
});
|
|
3041
|
+
const n = () => {
|
|
3042
|
+
const l = {};
|
|
3043
|
+
for (const [f, g] of Object.entries(r))
|
|
3044
|
+
f in Pt || (l[f] = g);
|
|
3045
|
+
return l;
|
|
3046
|
+
};
|
|
3047
|
+
return () => Zt("div", { ...n(), ref: c }, p.value ? a.default ? a.default() : [] : []);
|
|
3048
|
+
}
|
|
3049
|
+
});
|
|
3050
|
+
function Z(o) {
|
|
3051
|
+
return Oe(o, /* @__PURE__ */ new WeakSet());
|
|
3052
|
+
}
|
|
3053
|
+
const Lt = /* @__PURE__ */ new WeakMap();
|
|
3054
|
+
let _o = 0;
|
|
3055
|
+
function Io(o) {
|
|
3056
|
+
const a = o.raw, r = a && typeof a == "object" ? a : o;
|
|
3057
|
+
let s = Lt.get(r);
|
|
3058
|
+
return s === void 0 && (s = ++_o, Lt.set(r, s)), `<handle#${s}>`;
|
|
3059
|
+
}
|
|
3060
|
+
function Oe(o, a) {
|
|
3061
|
+
if (o === void 0) return "undefined";
|
|
3062
|
+
if (o === null) return "null";
|
|
3063
|
+
if (typeof o == "function") return "fn";
|
|
3064
|
+
if (typeof o != "object") return String(o);
|
|
3065
|
+
if (typeof HTMLElement < "u" && o instanceof HTMLElement) return "<HTMLElement>";
|
|
3066
|
+
if (typeof Node < "u" && o instanceof Node) return "<Node>";
|
|
3067
|
+
if ("__brand" in o) return Io(o);
|
|
3068
|
+
if (a.has(o)) return "<circular>";
|
|
3069
|
+
a.add(o);
|
|
3070
|
+
let r;
|
|
3071
|
+
return Array.isArray(o) ? r = `[${o.map((s) => Oe(s, a)).join(",")}]` : r = `{${Object.keys(o).sort().map((h) => `${h}:${Oe(o[h], a)}`).join(",")}}`, a.delete(o), r;
|
|
3072
|
+
}
|
|
3073
|
+
function zt(o, a = [], r = []) {
|
|
3074
|
+
const s = {};
|
|
3075
|
+
for (const h of [...o, ...r]) s[h] = { default: void 0 };
|
|
3076
|
+
for (const h of a) s[h.prop] = { type: Function, default: void 0 };
|
|
3077
|
+
return s;
|
|
3078
|
+
}
|
|
3079
|
+
function B(o) {
|
|
3080
|
+
const a = [
|
|
3081
|
+
...o.positionProp ? [o.positionProp] : [],
|
|
3082
|
+
...o.pathProp ? [o.pathProp] : [],
|
|
3083
|
+
...o.optionProps ?? [],
|
|
3084
|
+
...o.ctorOnlyProps ?? []
|
|
3085
|
+
];
|
|
3086
|
+
return w({
|
|
3087
|
+
name: o.displayName || "OverlayComponent",
|
|
3088
|
+
props: zt(a, o.events, ["visible"]),
|
|
3089
|
+
setup(r, { slots: s }) {
|
|
3090
|
+
const h = F($, null), c = F(Me, null);
|
|
3091
|
+
if (!h) throw new Error(`[vue-bmap] <${o.displayName}> 必须用在 <Map> 内部`);
|
|
3092
|
+
let p = null;
|
|
3093
|
+
const d = Q(null);
|
|
3094
|
+
let u = [], C = {}, v = [];
|
|
3095
|
+
const t = () => {
|
|
3096
|
+
const m = {};
|
|
3097
|
+
for (const b of a) {
|
|
3098
|
+
const P = r[b];
|
|
3099
|
+
P != null && (m[b] = P);
|
|
3100
|
+
}
|
|
3101
|
+
return m;
|
|
3102
|
+
}, i = () => {
|
|
3103
|
+
const m = h.value;
|
|
3104
|
+
if (!(!p || !m || !o.events))
|
|
3105
|
+
for (const { sdk: b, prop: P } of o.events)
|
|
3106
|
+
u.push(m.driver.addEventListener(p, b, (O) => {
|
|
3107
|
+
const A = r[P];
|
|
3108
|
+
typeof A == "function" && A((O == null ? void 0 : O.point) ?? (O == null ? void 0 : O.latlng) ?? (O == null ? void 0 : O.latLng) ?? O, O);
|
|
3109
|
+
}));
|
|
3110
|
+
}, e = () => {
|
|
3111
|
+
u.forEach((m) => m()), u = [];
|
|
3112
|
+
}, n = () => {
|
|
3113
|
+
var N;
|
|
3114
|
+
const m = h.value;
|
|
3115
|
+
if (!m || !m.map) return;
|
|
3116
|
+
const { map: b, driver: P } = m, O = t(), A = o.factory(P, O);
|
|
3117
|
+
if (!A) return;
|
|
3118
|
+
p = A, d.value = A;
|
|
3119
|
+
const k = !!o.attachToMarkerAsLabel && (c == null ? void 0 : c.type) === "marker";
|
|
3120
|
+
if (!o.skipMount)
|
|
3121
|
+
if (A.type === "hotspot")
|
|
3122
|
+
(N = P.addHotspot) == null || N.call(P, b, A);
|
|
3123
|
+
else if (k) {
|
|
3124
|
+
const R = c.handle.value;
|
|
3125
|
+
R && P.setMarkerLabel(R, A);
|
|
3126
|
+
} else c != null && c.addOverlay ? c.addOverlay(A) : P.addOverlay(b, A);
|
|
3127
|
+
if (o.optionProps) {
|
|
3128
|
+
const R = o.optionProps.filter((G) => O[G] === void 0);
|
|
3129
|
+
C = R.length > 0 ? P.snapshotOverlayOptions(A, R) : {};
|
|
3130
|
+
const _ = {};
|
|
3131
|
+
for (const G of o.optionProps) {
|
|
3132
|
+
const U = O[G];
|
|
3133
|
+
U != null && (_[G] = U);
|
|
3134
|
+
}
|
|
3135
|
+
v = Object.keys(_), v.length > 0 && P.setOverlayOptions(A, _);
|
|
3136
|
+
}
|
|
3137
|
+
r.visible === !1 && P.hideOverlay(A), i();
|
|
3138
|
+
}, l = () => {
|
|
3139
|
+
var b, P;
|
|
3140
|
+
if (!p) return;
|
|
3141
|
+
const m = h.value;
|
|
3142
|
+
if (e(), !o.skipMount && (m != null && m.map)) {
|
|
3143
|
+
const O = !!o.attachToMarkerAsLabel && (c == null ? void 0 : c.type) === "marker";
|
|
3144
|
+
try {
|
|
3145
|
+
if (p.type === "hotspot") (P = (b = m.driver).removeHotspot) == null || P.call(b, m.map, p);
|
|
3146
|
+
else if (O) {
|
|
3147
|
+
const A = c.handle.value;
|
|
3148
|
+
A && m.driver.removeMarkerLabel(A, p);
|
|
3149
|
+
} else c != null && c.removeOverlay ? c.removeOverlay(p) : m.driver.removeOverlay(m.map, p);
|
|
3150
|
+
} catch {
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
p = null, d.value = null;
|
|
3154
|
+
}, f = () => {
|
|
3155
|
+
l(), n();
|
|
3156
|
+
}, g = K(() => {
|
|
3157
|
+
var b;
|
|
3158
|
+
return ((b = h.value) == null ? void 0 : b.map) ? o.attachToMarkerAsLabel && (c == null ? void 0 : c.type) === "marker" ? !!c.handle.value : !0 : !1;
|
|
3159
|
+
});
|
|
3160
|
+
if (T(g, (m) => {
|
|
3161
|
+
m && !p ? n() : !m && p && l();
|
|
3162
|
+
}, { immediate: !0 }), o.positionProp) {
|
|
3163
|
+
const m = o.positionProp;
|
|
3164
|
+
T(() => Z(r[m]), () => {
|
|
3165
|
+
const b = h.value;
|
|
3166
|
+
p && (b != null && b.driver) && r[m] != null && b.driver.setOverlayPosition(p, r[m]);
|
|
3167
|
+
});
|
|
3168
|
+
}
|
|
3169
|
+
if (o.pathProp) {
|
|
3170
|
+
const m = o.pathProp;
|
|
3171
|
+
T(() => Z(r[m]), () => {
|
|
3172
|
+
const b = h.value;
|
|
3173
|
+
p && (b != null && b.driver) && r[m] != null && b.driver.setOverlayPath(p, r[m]);
|
|
3174
|
+
});
|
|
3175
|
+
}
|
|
3176
|
+
if (o.optionProps) {
|
|
3177
|
+
const m = o.optionProps, b = () => m.reduce((P, O) => (r[O] !== void 0 && (P[O] = r[O]), P), {});
|
|
3178
|
+
T(() => Z(b()), () => {
|
|
3179
|
+
const P = h.value;
|
|
3180
|
+
if (!p || !(P != null && P.driver)) return;
|
|
3181
|
+
const O = b(), A = Object.keys(O), k = v.filter((N) => !A.includes(N));
|
|
3182
|
+
if (k.length > 0) {
|
|
3183
|
+
const N = {}, R = [];
|
|
3184
|
+
for (const _ of k)
|
|
3185
|
+
_ in C ? N[_] = C[_] : R.push(_);
|
|
3186
|
+
Object.keys(N).length > 0 && R.push(...P.driver.restoreOverlayOptions(p, N)), R.length > 0 && ve(`${o.displayName ?? "Overlay"} 的 ${R.join(" / ")} 由有值变 undefined,框架拿不到 SDK 默认值可还原`);
|
|
3187
|
+
}
|
|
3188
|
+
v = A, A.length > 0 && P.driver.setOverlayOptions(p, O);
|
|
3189
|
+
});
|
|
3190
|
+
}
|
|
3191
|
+
if (o.ctorOnlyProps) {
|
|
3192
|
+
const m = o.ctorOnlyProps;
|
|
3193
|
+
T(() => Z(m.map((b) => r[b])), () => {
|
|
3194
|
+
p && f();
|
|
3195
|
+
});
|
|
3196
|
+
}
|
|
3197
|
+
if (T(() => r.visible, (m) => {
|
|
3198
|
+
const b = h.value;
|
|
3199
|
+
!p || !(b != null && b.driver) || (m === !1 ? b.driver.hideOverlay(p) : b.driver.showOverlay(p));
|
|
3200
|
+
}), ue(l), o.supportsChildren) {
|
|
3201
|
+
const m = {
|
|
3202
|
+
type: o.childTargetType ?? "overlay",
|
|
3203
|
+
handle: d
|
|
3204
|
+
};
|
|
3205
|
+
return Le(Me, m), () => s.default ? s.default() : null;
|
|
3206
|
+
}
|
|
3207
|
+
return () => null;
|
|
3208
|
+
}
|
|
3209
|
+
});
|
|
3210
|
+
}
|
|
3211
|
+
function V(o) {
|
|
3212
|
+
const a = [...o.optionProps ?? [], ...o.ctorOnlyProps ?? []];
|
|
3213
|
+
return w({
|
|
3214
|
+
name: o.displayName || "ControlComponent",
|
|
3215
|
+
props: zt(a, o.events, ["visible"]),
|
|
3216
|
+
setup(r, { slots: s }) {
|
|
3217
|
+
const h = F($, null);
|
|
3218
|
+
if (!h) throw new Error(`[vue-bmap] <${o.displayName}> 必须用在 <Map> 内部`);
|
|
3219
|
+
let c = null, p = [];
|
|
3220
|
+
const d = () => {
|
|
3221
|
+
const t = {};
|
|
3222
|
+
for (const i of a) {
|
|
3223
|
+
const e = r[i];
|
|
3224
|
+
e != null && (t[i] = e);
|
|
3225
|
+
}
|
|
3226
|
+
return t;
|
|
3227
|
+
}, u = () => {
|
|
3228
|
+
const t = h.value;
|
|
3229
|
+
if (!t || !t.map) return;
|
|
3230
|
+
const i = o.factory(t.driver, d());
|
|
3231
|
+
if (i && (c = i, t.driver.addControl(t.map, i), r.visible === !1 && t.driver.hideControl(i), o.events))
|
|
3232
|
+
for (const { sdk: e, prop: n } of o.events)
|
|
3233
|
+
p.push(t.driver.addEventListener(i, e, (l) => {
|
|
3234
|
+
const f = r[n];
|
|
3235
|
+
typeof f == "function" && f(l);
|
|
3236
|
+
}));
|
|
3237
|
+
}, C = () => {
|
|
3238
|
+
p.forEach((i) => i()), p = [];
|
|
3239
|
+
const t = h.value;
|
|
3240
|
+
if (c && (t != null && t.map))
|
|
3241
|
+
try {
|
|
3242
|
+
t.driver.removeControl(t.map, c);
|
|
3243
|
+
} catch {
|
|
3244
|
+
}
|
|
3245
|
+
c = null;
|
|
3246
|
+
}, v = () => {
|
|
3247
|
+
C(), u();
|
|
3248
|
+
};
|
|
3249
|
+
if (T(() => {
|
|
3250
|
+
var t;
|
|
3251
|
+
return (t = h.value) == null ? void 0 : t.map;
|
|
3252
|
+
}, (t) => {
|
|
3253
|
+
t && !c ? u() : !t && c && C();
|
|
3254
|
+
}, { immediate: !0 }), o.optionProps) {
|
|
3255
|
+
const t = o.optionProps;
|
|
3256
|
+
T(() => Z(t.map((i) => r[i] == null)), () => {
|
|
3257
|
+
c && v();
|
|
3258
|
+
}), T(() => Z(t.reduce((i, e) => (r[e] !== void 0 && (i[e] = r[e]), i), {})), () => {
|
|
3259
|
+
const i = h.value;
|
|
3260
|
+
if (!c || !(i != null && i.driver)) return;
|
|
3261
|
+
const e = t.reduce((n, l) => (r[l] !== void 0 && (n[l] = r[l]), n), {});
|
|
3262
|
+
Object.keys(e).length > 0 && i.driver.setControlOptions(c, e);
|
|
3263
|
+
});
|
|
3264
|
+
}
|
|
3265
|
+
if (o.ctorOnlyProps) {
|
|
3266
|
+
const t = o.ctorOnlyProps;
|
|
3267
|
+
T(() => Z(t.map((i) => r[i])), () => {
|
|
3268
|
+
c && v();
|
|
3269
|
+
});
|
|
3270
|
+
}
|
|
3271
|
+
return T(() => r.visible, (t) => {
|
|
3272
|
+
const i = h.value;
|
|
3273
|
+
!c || !(i != null && i.driver) || (t === !1 ? i.driver.hideControl(c) : i.driver.showControl(c));
|
|
3274
|
+
}), ue(C), () => s.default ? s.default() : null;
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3278
|
+
function H(o) {
|
|
3279
|
+
return w({
|
|
3280
|
+
name: o.displayName || "LayerComponent",
|
|
3281
|
+
// 图层没有 setter 抽象:所有 prop 都参与 layerKey,变化即重建。用 inheritAttrs:false + attrs 收集。
|
|
3282
|
+
inheritAttrs: !1,
|
|
3283
|
+
setup(a, { attrs: r, slots: s }) {
|
|
3284
|
+
const h = F($, null);
|
|
3285
|
+
if (!h) throw new Error(`[vue-bmap] <${o.displayName}> 必须用在 <Map> 内部`);
|
|
3286
|
+
let c = null, p = [];
|
|
3287
|
+
const d = o.addMethod ?? "addLayer", u = o.removeMethod ?? "removeLayer", C = () => {
|
|
3288
|
+
const e = {};
|
|
3289
|
+
for (const [n, l] of Object.entries(r))
|
|
3290
|
+
n.startsWith("on") || l != null && (e[n] = l);
|
|
3291
|
+
return e;
|
|
3292
|
+
}, v = () => {
|
|
3293
|
+
const e = h.value;
|
|
3294
|
+
if (!e || !e.map) return;
|
|
3295
|
+
const n = o.factory(e.driver, C());
|
|
3296
|
+
if (n && (c = n, e.driver[d](e.map, n), o.events && n.raw))
|
|
3297
|
+
for (const l of o.events)
|
|
3298
|
+
p.push(e.driver.addEventListener(n, l.sdk, (f) => {
|
|
3299
|
+
const g = r[`on${l.prop.charAt(0).toUpperCase()}${l.prop.slice(1)}`] ?? r[l.prop];
|
|
3300
|
+
typeof g == "function" && g(f);
|
|
3301
|
+
}));
|
|
3302
|
+
}, t = () => {
|
|
3303
|
+
p.forEach((n) => n()), p = [];
|
|
3304
|
+
const e = h.value;
|
|
3305
|
+
if (c && (e != null && e.map))
|
|
3306
|
+
try {
|
|
3307
|
+
e.driver[u](e.map, c);
|
|
3308
|
+
} catch {
|
|
3309
|
+
}
|
|
3310
|
+
c = null;
|
|
3311
|
+
}, i = K(() => Z(C()));
|
|
3312
|
+
return T([() => {
|
|
3313
|
+
var e;
|
|
3314
|
+
return (e = h.value) == null ? void 0 : e.map;
|
|
3315
|
+
}, i], () => {
|
|
3316
|
+
t(), v();
|
|
3317
|
+
}, { immediate: !0 }), ue(t), () => s.default ? s.default() : null;
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3321
|
+
const Va = w({
|
|
3322
|
+
name: "InfoWindow",
|
|
3323
|
+
props: {
|
|
3324
|
+
content: { type: [String, Object], required: !0 },
|
|
3325
|
+
open: { type: Boolean, default: !0 },
|
|
3326
|
+
position: { type: Object, default: void 0 },
|
|
3327
|
+
width: { type: Number, default: void 0 },
|
|
3328
|
+
height: { type: Number, default: void 0 },
|
|
3329
|
+
maxWidth: { type: Number, default: void 0 },
|
|
3330
|
+
offset: { default: void 0 },
|
|
3331
|
+
title: { type: String, default: void 0 },
|
|
3332
|
+
enableAutoPan: { type: Boolean, default: void 0 },
|
|
3333
|
+
enableCloseOnClick: { type: Boolean, default: void 0 },
|
|
3334
|
+
enableMessage: { type: Boolean, default: void 0 },
|
|
3335
|
+
message: { type: String, default: void 0 },
|
|
3336
|
+
maxContent: { type: String, default: void 0 },
|
|
3337
|
+
enableMaximize: { type: Boolean, default: void 0 },
|
|
3338
|
+
enableSearchTool: { type: Boolean, default: void 0 },
|
|
3339
|
+
onOpen: { type: Function, default: void 0 },
|
|
3340
|
+
onClose: { type: Function, default: void 0 },
|
|
3341
|
+
onClickClose: { type: Function, default: void 0 },
|
|
3342
|
+
onMaximize: { type: Function, default: void 0 },
|
|
3343
|
+
onRestore: { type: Function, default: void 0 },
|
|
3344
|
+
onResize: { type: Function, default: void 0 }
|
|
3345
|
+
},
|
|
3346
|
+
setup(o) {
|
|
3347
|
+
const a = F($, null), r = F(Me, null);
|
|
3348
|
+
if (!a) throw new Error("[vue-bmap] <InfoWindow> 必须用在 <Map> 内部");
|
|
3349
|
+
let s = null, h = [];
|
|
3350
|
+
const c = () => {
|
|
3351
|
+
var i;
|
|
3352
|
+
const t = (r == null ? void 0 : r.handle.value) ?? ((i = a.value) == null ? void 0 : i.map);
|
|
3353
|
+
return (t == null ? void 0 : t.raw) ?? t;
|
|
3354
|
+
}, p = () => {
|
|
3355
|
+
var f;
|
|
3356
|
+
const v = a.value;
|
|
3357
|
+
if (!(v != null && v.driver)) return;
|
|
3358
|
+
const t = {
|
|
3359
|
+
width: o.width,
|
|
3360
|
+
height: o.height,
|
|
3361
|
+
maxWidth: o.maxWidth,
|
|
3362
|
+
offset: o.offset,
|
|
3363
|
+
title: o.title,
|
|
3364
|
+
enableAutoPan: o.enableAutoPan,
|
|
3365
|
+
enableCloseOnClick: o.enableCloseOnClick,
|
|
3366
|
+
enableMessage: o.enableMessage,
|
|
3367
|
+
message: o.message,
|
|
3368
|
+
maxContent: o.maxContent,
|
|
3369
|
+
enableMaximize: o.enableMaximize,
|
|
3370
|
+
enableSearchTool: o.enableSearchTool
|
|
3371
|
+
}, i = {};
|
|
3372
|
+
for (const [g, m] of Object.entries(t)) m != null && (i[g] = m);
|
|
3373
|
+
const e = v.driver.createInfoWindow(o.content, i);
|
|
3374
|
+
if (!e) return;
|
|
3375
|
+
s = e;
|
|
3376
|
+
const n = e.raw, l = [
|
|
3377
|
+
["open", "onOpen"],
|
|
3378
|
+
["close", "onClose"],
|
|
3379
|
+
["clickclose", "onClickClose"],
|
|
3380
|
+
["maximize", "onMaximize"],
|
|
3381
|
+
["restore", "onRestore"],
|
|
3382
|
+
["resize", "onResize"]
|
|
3383
|
+
];
|
|
3384
|
+
for (const [g, m] of l) {
|
|
3385
|
+
const b = (P) => {
|
|
3386
|
+
const O = o[m];
|
|
3387
|
+
typeof O == "function" && O(P);
|
|
3388
|
+
};
|
|
3389
|
+
(f = n == null ? void 0 : n.addEventListener) == null || f.call(n, g, b), h.push({ event: g, fn: b });
|
|
3390
|
+
}
|
|
3391
|
+
u();
|
|
3392
|
+
}, d = () => {
|
|
3393
|
+
var i, e;
|
|
3394
|
+
const v = s == null ? void 0 : s.raw;
|
|
3395
|
+
for (const { event: n, fn: l } of h) (i = v == null ? void 0 : v.removeEventListener) == null || i.call(v, n, l);
|
|
3396
|
+
h = [];
|
|
3397
|
+
const t = c();
|
|
3398
|
+
if (t)
|
|
3399
|
+
try {
|
|
3400
|
+
(e = t.closeInfoWindow) == null || e.call(t);
|
|
3401
|
+
} catch {
|
|
3402
|
+
}
|
|
3403
|
+
s = null;
|
|
3404
|
+
}, u = () => {
|
|
3405
|
+
var e, n;
|
|
3406
|
+
const v = a.value;
|
|
3407
|
+
if (!(v != null && v.map) || !s) return;
|
|
3408
|
+
const t = c(), i = s.raw;
|
|
3409
|
+
if (o.open)
|
|
3410
|
+
try {
|
|
3411
|
+
if (o.position) {
|
|
3412
|
+
const l = de();
|
|
3413
|
+
(e = t == null ? void 0 : t.openInfoWindow) == null || e.call(t, i, new l.Point(o.position.lng, o.position.lat));
|
|
3414
|
+
} else typeof (t == null ? void 0 : t.openInfoWindow) == "function" && t.openInfoWindow(i);
|
|
3415
|
+
} catch (l) {
|
|
3416
|
+
console.warn("[vue-bmap] InfoWindow open failed", l);
|
|
3417
|
+
}
|
|
3418
|
+
else
|
|
3419
|
+
try {
|
|
3420
|
+
(n = t == null ? void 0 : t.closeInfoWindow) == null || n.call(t);
|
|
3421
|
+
} catch {
|
|
3422
|
+
}
|
|
3423
|
+
};
|
|
3424
|
+
return T([() => {
|
|
3425
|
+
var v;
|
|
3426
|
+
return (v = a.value) == null ? void 0 : v.map;
|
|
3427
|
+
}, () => r == null ? void 0 : r.handle.value, () => Z({
|
|
3428
|
+
maxWidth: o.maxWidth,
|
|
3429
|
+
offset: o.offset,
|
|
3430
|
+
enableCloseOnClick: o.enableCloseOnClick,
|
|
3431
|
+
enableMessage: o.enableMessage,
|
|
3432
|
+
message: o.message,
|
|
3433
|
+
enableSearchTool: o.enableSearchTool
|
|
3434
|
+
})], () => {
|
|
3435
|
+
d(), p();
|
|
3436
|
+
}, { immediate: !0 }), T(() => o.content, (v) => {
|
|
3437
|
+
var i;
|
|
3438
|
+
const t = s == null ? void 0 : s.raw;
|
|
3439
|
+
t && v != null && ((i = t.setContent) == null || i.call(t, v));
|
|
3440
|
+
}), T(() => o.title, (v) => {
|
|
3441
|
+
var i;
|
|
3442
|
+
const t = s == null ? void 0 : s.raw;
|
|
3443
|
+
t && v != null && ((i = t.setTitle) == null || i.call(t, v));
|
|
3444
|
+
}), T(() => o.width, (v) => {
|
|
3445
|
+
var i;
|
|
3446
|
+
const t = s == null ? void 0 : s.raw;
|
|
3447
|
+
t && v != null && ((i = t.setWidth) == null || i.call(t, v));
|
|
3448
|
+
}), T(() => o.height, (v) => {
|
|
3449
|
+
var i;
|
|
3450
|
+
const t = s == null ? void 0 : s.raw;
|
|
3451
|
+
t && v != null && ((i = t.setHeight) == null || i.call(t, v));
|
|
3452
|
+
}), T(() => o.maxContent, (v) => {
|
|
3453
|
+
var i;
|
|
3454
|
+
const t = s == null ? void 0 : s.raw;
|
|
3455
|
+
t && v != null && ((i = t.setMaxContent) == null || i.call(t, v));
|
|
3456
|
+
}), T([() => o.open, () => {
|
|
3457
|
+
var v;
|
|
3458
|
+
return (v = o.position) == null ? void 0 : v.lng;
|
|
3459
|
+
}, () => {
|
|
3460
|
+
var v;
|
|
3461
|
+
return (v = o.position) == null ? void 0 : v.lat;
|
|
3462
|
+
}], u), ue(d), () => null;
|
|
3463
|
+
}
|
|
3464
|
+
}), J = [
|
|
3465
|
+
{ sdk: "click", prop: "onClick" },
|
|
3466
|
+
{ sdk: "dblclick", prop: "onDoubleClick" },
|
|
3467
|
+
{ sdk: "rightclick", prop: "onRightClick" },
|
|
3468
|
+
{ sdk: "rightdblclick", prop: "onRightDoubleClick" },
|
|
3469
|
+
{ sdk: "mousedown", prop: "onMouseDown" },
|
|
3470
|
+
{ sdk: "mouseup", prop: "onMouseUp" },
|
|
3471
|
+
{ sdk: "mouseover", prop: "onMouseOver" },
|
|
3472
|
+
{ sdk: "mouseout", prop: "onMouseOut" },
|
|
3473
|
+
{ sdk: "mousemove", prop: "onMouseMove" },
|
|
3474
|
+
{ sdk: "remove", prop: "onRemove" },
|
|
3475
|
+
{ sdk: "lineupdate", prop: "onLineUpdate" },
|
|
3476
|
+
{ sdk: "editstart", prop: "onEditStart" },
|
|
3477
|
+
{ sdk: "editend", prop: "onEditEnd" },
|
|
3478
|
+
{ sdk: "linevertexdragstart", prop: "onLineVertexDragStart" },
|
|
3479
|
+
{ sdk: "linevertexdragging", prop: "onLineVertexDragging" },
|
|
3480
|
+
{ sdk: "linevertexdragend", prop: "onLineVertexDragEnd" },
|
|
3481
|
+
{ sdk: "linevertexdel", prop: "onLineVertexDel" }
|
|
3482
|
+
], Ua = B({
|
|
3483
|
+
displayName: "Marker",
|
|
3484
|
+
factory: (o, a) => o.createMarker(a.position, a),
|
|
3485
|
+
positionProp: "position",
|
|
3486
|
+
optionProps: ["offset", "icon", "enableMassClear", "enableDragging", "rotation", "title", "zIndex", "opacity", "color", "rank", "rotationOrigin"],
|
|
3487
|
+
ctorOnlyProps: ["enableClicking", "raiseOnDrag", "draggingCursor", "shadow", "baseZIndex", "restrictDraggingArea", "enableCollisionDetection", "enableDraggingMap", "anchor"],
|
|
3488
|
+
events: [
|
|
3489
|
+
{ sdk: "click", prop: "onClick" },
|
|
3490
|
+
{ sdk: "dblclick", prop: "onDoubleClick" },
|
|
3491
|
+
{ sdk: "rightclick", prop: "onRightClick" },
|
|
3492
|
+
{ sdk: "dragstart", prop: "onDragStart" },
|
|
3493
|
+
{ sdk: "dragging", prop: "onDragging" },
|
|
3494
|
+
{ sdk: "dragend", prop: "onDragEnd" },
|
|
3495
|
+
{ sdk: "mouseover", prop: "onMouseOver" },
|
|
3496
|
+
{ sdk: "mouseout", prop: "onMouseOut" },
|
|
3497
|
+
{ sdk: "mousedown", prop: "onMouseDown" },
|
|
3498
|
+
{ sdk: "mouseup", prop: "onMouseUp" },
|
|
3499
|
+
{ sdk: "remove", prop: "onRemove" }
|
|
3500
|
+
],
|
|
3501
|
+
supportsChildren: !0,
|
|
3502
|
+
childTargetType: "marker"
|
|
3503
|
+
}), Ya = B({
|
|
3504
|
+
displayName: "Label",
|
|
3505
|
+
factory: (o, a) => o.createLabel(a.content, a),
|
|
3506
|
+
positionProp: "position",
|
|
3507
|
+
optionProps: ["content", "offset", "enableMassClear", "styles", "opacity", "title", "zIndex"],
|
|
3508
|
+
ctorOnlyProps: ["enableClicking", "width", "anchor"],
|
|
3509
|
+
attachToMarkerAsLabel: !0,
|
|
3510
|
+
events: [
|
|
3511
|
+
{ sdk: "click", prop: "onClick" },
|
|
3512
|
+
{ sdk: "dblclick", prop: "onDoubleClick" },
|
|
3513
|
+
{ sdk: "rightclick", prop: "onRightClick" },
|
|
3514
|
+
{ sdk: "mouseover", prop: "onMouseOver" },
|
|
3515
|
+
{ sdk: "mouseout", prop: "onMouseOut" },
|
|
3516
|
+
{ sdk: "mousedown", prop: "onMouseDown" },
|
|
3517
|
+
{ sdk: "mouseup", prop: "onMouseUp" },
|
|
3518
|
+
{ sdk: "remove", prop: "onRemove" }
|
|
3519
|
+
]
|
|
3520
|
+
}), Da = B({
|
|
3521
|
+
displayName: "Polyline",
|
|
3522
|
+
factory: (o, a) => o.createPolyline(a.path, a),
|
|
3523
|
+
pathProp: "path",
|
|
3524
|
+
optionProps: ["strokeColor", "strokeWeight", "strokeOpacity", "strokeStyle", "enableEditing", "enableMassClear", "zIndex"],
|
|
3525
|
+
ctorOnlyProps: ["enableClicking", "strokeLineCap", "strokeLineJoin", "geodesic", "linkRight", "clip", "coordType", "icons", "dashArray", "strokeTexture", "node", "nodeT"],
|
|
3526
|
+
events: J
|
|
3527
|
+
}), Fa = B({
|
|
3528
|
+
displayName: "Polygon",
|
|
3529
|
+
factory: (o, a) => o.createPolygon(a.path, a),
|
|
3530
|
+
pathProp: "path",
|
|
3531
|
+
optionProps: ["strokeColor", "fillColor", "strokeWeight", "strokeOpacity", "fillOpacity", "strokeStyle", "enableEditing", "enableMassClear", "zIndex"],
|
|
3532
|
+
ctorOnlyProps: ["enableClicking", "strokeLineCap", "strokeLineJoin", "linkRight", "coordType", "dashArray", "node", "nodeT"],
|
|
3533
|
+
events: J
|
|
3534
|
+
}), ja = B({
|
|
3535
|
+
displayName: "Circle",
|
|
3536
|
+
factory: (o, a) => o.createCircle(a.center, a.radius, a),
|
|
3537
|
+
positionProp: "center",
|
|
3538
|
+
optionProps: ["radius", "strokeColor", "fillColor", "strokeWeight", "strokeOpacity", "fillOpacity", "strokeStyle", "enableMassClear", "zIndex"],
|
|
3539
|
+
ctorOnlyProps: ["enableEditing", "enableClicking", "coordType", "dashArray", "node", "nodeT"],
|
|
3540
|
+
events: J
|
|
3541
|
+
}), Ja = B({
|
|
3542
|
+
displayName: "Rectangle",
|
|
3543
|
+
factory: (o, a) => o.createRectangle(a.bounds, a),
|
|
3544
|
+
optionProps: ["bounds", "strokeColor", "fillColor", "strokeWeight", "strokeOpacity", "fillOpacity", "strokeStyle", "enableEditing", "enableMassClear", "zIndex"],
|
|
3545
|
+
ctorOnlyProps: ["enableClicking", "linkRight", "coordType", "dashArray", "node", "nodeT"],
|
|
3546
|
+
events: J
|
|
3547
|
+
}), $a = B({
|
|
3548
|
+
displayName: "BezierCurve",
|
|
3549
|
+
factory: (o, a) => o.createBezierCurve(a.path, a.controlPoints, a),
|
|
3550
|
+
pathProp: "path",
|
|
3551
|
+
optionProps: ["controlPoints", "strokeColor", "strokeWeight", "strokeOpacity", "strokeStyle", "enableMassClear", "zIndex"],
|
|
3552
|
+
ctorOnlyProps: ["enableClicking", "enableEditing", "dashArray", "node", "nodeT"],
|
|
3553
|
+
events: J
|
|
3554
|
+
}), qa = B({
|
|
3555
|
+
displayName: "Prism",
|
|
3556
|
+
factory: (o, a) => o.createPrism(a.path, a.altitude, a),
|
|
3557
|
+
pathProp: "path",
|
|
3558
|
+
optionProps: ["altitude", "topFillColor", "topFillOpacity", "sideFillColor", "sideFillOpacity", "enableMassClear", "zIndex"],
|
|
3559
|
+
ctorOnlyProps: ["enableClicking"],
|
|
3560
|
+
events: J
|
|
3561
|
+
}), Xa = B({
|
|
3562
|
+
displayName: "GroundOverlay",
|
|
3563
|
+
factory: (o, a) => o.createGroundOverlay(a.bounds, a),
|
|
3564
|
+
optionProps: ["bounds", "opacity", "url", "imageURL", "displayOnMinLevel", "displayOnMaxLevel", "enableMassClear", "zIndex"],
|
|
3565
|
+
ctorOnlyProps: ["enableClicking", "type", "top", "isReDraw", "drawHook", "stretch"],
|
|
3566
|
+
events: J
|
|
3567
|
+
}), Qa = B({
|
|
3568
|
+
displayName: "GroundPoint",
|
|
3569
|
+
factory: (o, a) => o.createGroundPoint(a.point, a),
|
|
3570
|
+
positionProp: "point",
|
|
3571
|
+
optionProps: ["url", "size", "anchor", "scale", "rotation", "offset", "opacity", "imageURL", "displayOnMinLevel", "displayOnMaxLevel", "enableMassClear", "zIndex"],
|
|
3572
|
+
ctorOnlyProps: ["level", "enableClicking", "type", "top", "isReDraw", "drawHook"],
|
|
3573
|
+
events: J
|
|
3574
|
+
}), wa = B({
|
|
3575
|
+
displayName: "PointCollection",
|
|
3576
|
+
factory: (o, a) => o.createPointCollection(a.points, a),
|
|
3577
|
+
pathProp: "points",
|
|
3578
|
+
optionProps: ["shape", "color", "size", "enableMassClear"],
|
|
3579
|
+
events: [
|
|
3580
|
+
{ sdk: "click", prop: "onClick" },
|
|
3581
|
+
{ sdk: "mouseover", prop: "onMouseOver" },
|
|
3582
|
+
{ sdk: "mouseout", prop: "onMouseOut" }
|
|
3583
|
+
]
|
|
3584
|
+
}), Ka = B({
|
|
3585
|
+
displayName: "Symbol",
|
|
3586
|
+
factory: (o, a) => o.createSymbol(a.path, a),
|
|
3587
|
+
optionProps: ["path", "anchor", "fillColor", "fillOpacity", "scale", "rotation", "strokeColor", "strokeOpacity", "strokeWeight"],
|
|
3588
|
+
skipMount: !0
|
|
3589
|
+
}), er = B({
|
|
3590
|
+
displayName: "Icon",
|
|
3591
|
+
factory: (o, a) => o.createIcon(a.url, a.size, a),
|
|
3592
|
+
optionProps: ["url", "size", "anchor", "imageOffset", "imageSize", "infoWindowAnchor", "printImageUrl", "srcset"],
|
|
3593
|
+
skipMount: !0
|
|
3594
|
+
}), tr = B({
|
|
3595
|
+
displayName: "IconSequence",
|
|
3596
|
+
factory: (o, a) => o.createIconSequence(a.symbol, a.offset, a.repeat, a.fixedRotation),
|
|
3597
|
+
ctorOnlyProps: ["symbol", "offset", "repeat", "fixedRotation"],
|
|
3598
|
+
skipMount: !0
|
|
3599
|
+
}), or = B({
|
|
3600
|
+
displayName: "Hotspot",
|
|
3601
|
+
factory: (o, a) => o.createHotspot(a.position, a),
|
|
3602
|
+
positionProp: "position",
|
|
3603
|
+
optionProps: ["text", "userData"],
|
|
3604
|
+
ctorOnlyProps: ["offsets", "minZoom", "maxZoom"]
|
|
3605
|
+
}), nr = B({
|
|
3606
|
+
displayName: "Marker3D",
|
|
3607
|
+
factory: (o, a) => o.createMarker3D(a.position, a.height, a),
|
|
3608
|
+
positionProp: "position",
|
|
3609
|
+
optionProps: ["height", "fillColor", "fillOpacity"],
|
|
3610
|
+
ctorOnlyProps: ["shape", "size", "enableMassClear"],
|
|
3611
|
+
events: [
|
|
3612
|
+
{ sdk: "click", prop: "onClick" },
|
|
3613
|
+
{ sdk: "dblclick", prop: "onDoubleClick" },
|
|
3614
|
+
{ sdk: "rightclick", prop: "onRightClick" },
|
|
3615
|
+
{ sdk: "mouseover", prop: "onMouseOver" },
|
|
3616
|
+
{ sdk: "mouseout", prop: "onMouseOut" },
|
|
3617
|
+
{ sdk: "mousedown", prop: "onMouseDown" },
|
|
3618
|
+
{ sdk: "mouseup", prop: "onMouseUp" }
|
|
3619
|
+
],
|
|
3620
|
+
supportsChildren: !0
|
|
3621
|
+
}), ir = V({
|
|
3622
|
+
displayName: "NavigationControl",
|
|
3623
|
+
factory: (o, a) => o.createNavigationControl(a),
|
|
3624
|
+
optionProps: ["anchor", "offset"],
|
|
3625
|
+
// type 走重建:BMapGL(4.0/WebGL) 的 NavigationControl 没有 setType(),
|
|
3626
|
+
// 只能通过重建控件让构造参数 type 生效(v3 有 setType,重建同样正确)。
|
|
3627
|
+
ctorOnlyProps: ["type", "showZoomInfo", "enableGeolocation"]
|
|
3628
|
+
}), ar = V({
|
|
3629
|
+
displayName: "NavigationControl3D",
|
|
3630
|
+
factory: (o, a) => o.createNavigationControl3D(a),
|
|
3631
|
+
optionProps: ["anchor", "offset"]
|
|
3632
|
+
}), rr = V({
|
|
3633
|
+
displayName: "ScaleControl",
|
|
3634
|
+
factory: (o, a) => o.createScaleControl(a),
|
|
3635
|
+
optionProps: ["anchor", "offset", "unit"]
|
|
3636
|
+
}), sr = V({
|
|
3637
|
+
displayName: "OverviewMapControl",
|
|
3638
|
+
factory: (o, a) => o.createOverviewMapControl(a),
|
|
3639
|
+
optionProps: ["anchor", "offset", "size"],
|
|
3640
|
+
ctorOnlyProps: ["zoomInterval", "padding", "isOpen"],
|
|
3641
|
+
events: [
|
|
3642
|
+
{ sdk: "viewchanged", prop: "onViewChanged" },
|
|
3643
|
+
{ sdk: "viewchanging", prop: "onViewChanging" },
|
|
3644
|
+
{ sdk: "resize", prop: "onResize" }
|
|
3645
|
+
]
|
|
3646
|
+
}), lr = V({
|
|
3647
|
+
displayName: "MapTypeControl",
|
|
3648
|
+
factory: (o, a) => o.createMapTypeControl(a),
|
|
3649
|
+
optionProps: ["anchor", "offset", "showStreetLayer"],
|
|
3650
|
+
ctorOnlyProps: ["type", "mapTypes", "enableSwitch"]
|
|
3651
|
+
}), cr = V({
|
|
3652
|
+
displayName: "CopyrightControl",
|
|
3653
|
+
factory: (o, a) => o.createCopyrightControl(a),
|
|
3654
|
+
optionProps: ["anchor", "offset", "copyrights"]
|
|
3655
|
+
}), ko = V({
|
|
3656
|
+
displayName: "GeolocationControl",
|
|
3657
|
+
factory: (o, a) => o.createGeolocationControl(a),
|
|
3658
|
+
optionProps: [
|
|
3659
|
+
"anchor",
|
|
3660
|
+
"offset",
|
|
3661
|
+
"enableAutoLocation",
|
|
3662
|
+
"locationIcon",
|
|
3663
|
+
"watchPosition",
|
|
3664
|
+
"useCompass",
|
|
3665
|
+
"autoZoom",
|
|
3666
|
+
"autoViewport",
|
|
3667
|
+
"onLocationStart"
|
|
3668
|
+
],
|
|
3669
|
+
ctorOnlyProps: ["showAddressBar"],
|
|
3670
|
+
events: [
|
|
3671
|
+
{ sdk: "locationSuccess", prop: "onLocationSuccess" },
|
|
3672
|
+
{ sdk: "locationError", prop: "onLocationError" }
|
|
3673
|
+
]
|
|
3674
|
+
}), pr = V({
|
|
3675
|
+
displayName: "PanoramaControl",
|
|
3676
|
+
factory: (o, a) => o.createPanoramaControl(a),
|
|
3677
|
+
optionProps: ["anchor", "offset"]
|
|
3678
|
+
}), dr = V({
|
|
3679
|
+
displayName: "ZoomControl",
|
|
3680
|
+
factory: (o, a) => o.createZoomControl(a),
|
|
3681
|
+
optionProps: ["anchor", "offset"]
|
|
3682
|
+
}), ur = V({
|
|
3683
|
+
displayName: "CityListControl",
|
|
3684
|
+
factory: (o, a) => o.createCityListControl(a),
|
|
3685
|
+
optionProps: ["anchor", "offset"],
|
|
3686
|
+
ctorOnlyProps: ["expand", "trigger", "onChangeBefore", "onChangeAfter", "onChangeSuccess", "canCheckSize"],
|
|
3687
|
+
events: [
|
|
3688
|
+
{ sdk: "onopen", prop: "onOpen" },
|
|
3689
|
+
{ sdk: "onclose", prop: "onClose" }
|
|
3690
|
+
]
|
|
3691
|
+
}), yr = ko, fr = V({
|
|
3692
|
+
displayName: "LogoControl",
|
|
3693
|
+
factory: (o, a) => o.createLogoControl(a),
|
|
3694
|
+
optionProps: ["anchor", "offset"]
|
|
3695
|
+
}), hr = H({ displayName: "TileLayer", factory: (o, a) => o.createTileLayer(a) }), mr = H({ displayName: "NormalLayer", factory: (o, a) => o.createNormalLayer(a) }), gr = H({ displayName: "GeoJSONLayer", factory: (o, a) => o.createGeoJSONLayer(a) }), Mr = H({ displayName: "DistrictLayer", factory: (o, a) => o.createDistrictLayer(a) }), vr = H({ displayName: "CustomLayer", factory: (o, a) => o.createCustomLayer(a) }), Cr = H({ displayName: "CanvasLayer", factory: (o, a) => o.createCanvasLayer(a) }), br = H({ displayName: "TrafficLayer", factory: (o, a) => o.createTrafficLayer(a) }), Or = H({ displayName: "RasterTileLayer", factory: (o, a) => o.createRasterTileLayer(a) }), Pr = H({ displayName: "WMSLayer", factory: (o, a) => o.createWMSLayer(a) }), Lr = H({ displayName: "WMTSLayer", factory: (o, a) => o.createWMTSLayer(a) }), Ar = H({ displayName: "XYZLayer", factory: (o, a) => o.createXYZLayer(a) }), Tr = H({
|
|
3696
|
+
displayName: "MVTLayer",
|
|
3697
|
+
factory: (o, a) => o.createMVTLayer(a),
|
|
3698
|
+
events: [
|
|
3699
|
+
{ sdk: "click", prop: "onclick" },
|
|
3700
|
+
{ sdk: "dblclick", prop: "ondblclick" },
|
|
3701
|
+
{ sdk: "mousemove", prop: "onmousemove" },
|
|
3702
|
+
{ sdk: "mouseout", prop: "onmouseout" }
|
|
3703
|
+
]
|
|
3704
|
+
});
|
|
3705
|
+
function _r() {
|
|
3706
|
+
const o = ye();
|
|
3707
|
+
return K(() => {
|
|
3708
|
+
var a;
|
|
3709
|
+
return ((a = o.value) == null ? void 0 : a.map) ?? null;
|
|
3710
|
+
});
|
|
3711
|
+
}
|
|
3712
|
+
function Ir(o, a) {
|
|
3713
|
+
const r = ye();
|
|
3714
|
+
let s = null;
|
|
3715
|
+
T(() => {
|
|
3716
|
+
var c;
|
|
3717
|
+
return (c = r.value) == null ? void 0 : c.map;
|
|
3718
|
+
}, () => {
|
|
3719
|
+
s == null || s(), s = null;
|
|
3720
|
+
const c = r.value;
|
|
3721
|
+
c != null && c.map && (s = c.driver.addEventListener(c.map, o, (p) => a(p)));
|
|
3722
|
+
}, { immediate: !0 }), se(() => {
|
|
3723
|
+
s == null || s(), s = null;
|
|
3724
|
+
});
|
|
3725
|
+
}
|
|
3726
|
+
function kr(o) {
|
|
3727
|
+
const a = ye();
|
|
3728
|
+
T(() => {
|
|
3729
|
+
var r;
|
|
3730
|
+
return (r = a.value) == null ? void 0 : r.map;
|
|
3731
|
+
}, (r) => {
|
|
3732
|
+
r && o(r);
|
|
3733
|
+
}, { immediate: !0 });
|
|
3734
|
+
}
|
|
3735
|
+
function Sr() {
|
|
3736
|
+
const o = ee();
|
|
3737
|
+
return K(() => o.value.driver);
|
|
3738
|
+
}
|
|
3739
|
+
function Nr() {
|
|
3740
|
+
const o = ye();
|
|
3741
|
+
return K(() => {
|
|
3742
|
+
const a = o.value;
|
|
3743
|
+
return a != null && a.map ? new Bt(a.map, a.driver) : null;
|
|
3744
|
+
});
|
|
3745
|
+
}
|
|
3746
|
+
function Rr() {
|
|
3747
|
+
const o = ee();
|
|
3748
|
+
return K(() => {
|
|
3749
|
+
var a;
|
|
3750
|
+
return ((a = o.value.driver) == null ? void 0 : a.capabilities) ?? /* @__PURE__ */ new Set();
|
|
3751
|
+
});
|
|
3752
|
+
}
|
|
3753
|
+
const So = ["fillColor", "fillOpacity", "scale", "rotation", "strokeColor", "strokeOpacity", "strokeWeight", "anchor"];
|
|
3754
|
+
function Er(o) {
|
|
3755
|
+
const a = ee(), r = Q(null);
|
|
3756
|
+
let s = null;
|
|
3757
|
+
const h = () => So.reduce((c, p) => {
|
|
3758
|
+
const d = o[p];
|
|
3759
|
+
return d != null && (c[p] = d), c;
|
|
3760
|
+
}, {});
|
|
3761
|
+
return T(
|
|
3762
|
+
() => [a.value.driver, Z(o.path)],
|
|
3763
|
+
() => {
|
|
3764
|
+
const c = a.value.driver;
|
|
3765
|
+
c && (s = c.createSymbol(o.path, o), r.value = s);
|
|
3766
|
+
},
|
|
3767
|
+
{ immediate: !0 }
|
|
3768
|
+
), T(() => Z(h()), () => {
|
|
3769
|
+
const c = a.value.driver;
|
|
3770
|
+
c && s && c.setOverlayOptions(s, h());
|
|
3771
|
+
}), se(() => {
|
|
3772
|
+
s = null, r.value = null;
|
|
3773
|
+
}), r;
|
|
3774
|
+
}
|
|
3775
|
+
const No = ["size", "anchor", "imageOffset", "imageSize", "infoWindowAnchor", "printImageUrl", "srcset"];
|
|
3776
|
+
function Br(o) {
|
|
3777
|
+
const a = ee(), r = Q(null);
|
|
3778
|
+
let s = null;
|
|
3779
|
+
const h = () => No.reduce((c, p) => {
|
|
3780
|
+
const d = o[p];
|
|
3781
|
+
return d != null && (c[p] = d), c;
|
|
3782
|
+
}, {});
|
|
3783
|
+
return T(
|
|
3784
|
+
() => [a.value.driver, o.url],
|
|
3785
|
+
() => {
|
|
3786
|
+
const c = a.value.driver;
|
|
3787
|
+
c && (s = c.createIcon(o.url, o.size, o), r.value = s);
|
|
3788
|
+
},
|
|
3789
|
+
{ immediate: !0 }
|
|
3790
|
+
), T(() => Z(h()), () => {
|
|
3791
|
+
const c = a.value.driver;
|
|
3792
|
+
c && s && c.setOverlayOptions(s, h());
|
|
3793
|
+
}), se(() => {
|
|
3794
|
+
s = null, r.value = null;
|
|
3795
|
+
}), r;
|
|
3796
|
+
}
|
|
3797
|
+
const Pe = 1e4;
|
|
3798
|
+
function Ro() {
|
|
3799
|
+
return new Error("[vue-bmap] 服务请求超时:SDK 回调未返回,可能是 AK 未开通该服务、请求被拒或网络异常");
|
|
3800
|
+
}
|
|
3801
|
+
function Eo() {
|
|
3802
|
+
let o = null;
|
|
3803
|
+
const a = () => {
|
|
3804
|
+
o && (clearTimeout(o), o = null);
|
|
3805
|
+
}, r = (s, h = Pe) => {
|
|
3806
|
+
a(), o = setTimeout(() => {
|
|
3807
|
+
o = null, s();
|
|
3808
|
+
}, h);
|
|
3809
|
+
};
|
|
3810
|
+
return se(a), { arm: r, clear: a };
|
|
3811
|
+
}
|
|
3812
|
+
function zr() {
|
|
3813
|
+
const o = ee();
|
|
3814
|
+
let a = null, r = 0;
|
|
3815
|
+
const { arm: s, clear: h } = Eo(), c = ce(void 0), p = ce(!1), d = ce(null), u = ce(!0);
|
|
3816
|
+
T(() => o.value.driver, () => {
|
|
3817
|
+
const g = o.value.driver;
|
|
3818
|
+
if (!g) return;
|
|
3819
|
+
const m = g.createGeocoder();
|
|
3820
|
+
if (m.isNull) {
|
|
3821
|
+
u.value = !1, d.value = new Ae("Geocoder", g.version);
|
|
3822
|
+
return;
|
|
3823
|
+
}
|
|
3824
|
+
a = m.raw, u.value = !0, d.value = null;
|
|
3825
|
+
}, { immediate: !0 }), se(() => {
|
|
3826
|
+
a = null;
|
|
3827
|
+
});
|
|
3828
|
+
const v = (g) => {
|
|
3829
|
+
if (!a) return;
|
|
3830
|
+
const m = r;
|
|
3831
|
+
p.value = !0, d.value = null, s(() => {
|
|
3832
|
+
m === r && (p.value = !1, d.value = Ro());
|
|
3833
|
+
});
|
|
3834
|
+
try {
|
|
3835
|
+
g(a);
|
|
3836
|
+
} catch (b) {
|
|
3837
|
+
h(), p.value = !1, d.value = b;
|
|
3838
|
+
}
|
|
3839
|
+
};
|
|
3840
|
+
return { data: c, loading: p, error: d, supported: u, getPoint: (g, m) => {
|
|
3841
|
+
const b = ++r;
|
|
3842
|
+
v((P) => {
|
|
3843
|
+
var A, k;
|
|
3844
|
+
const O = (N) => {
|
|
3845
|
+
b === r && (h(), c.value = N, p.value = !1, d.value = null);
|
|
3846
|
+
};
|
|
3847
|
+
m !== void 0 ? (A = P.getPoint) == null || A.call(P, g, O, m) : (k = P.getPoint) == null || k.call(P, g, O);
|
|
3848
|
+
});
|
|
3849
|
+
}, getLocation: (g, m) => {
|
|
3850
|
+
const b = ++r;
|
|
3851
|
+
v((P) => {
|
|
3852
|
+
var N, R;
|
|
3853
|
+
const O = de(), A = new O.Point(g.lng, g.lat), k = (_) => {
|
|
3854
|
+
b === r && (h(), c.value = _, p.value = !1, d.value = null);
|
|
3855
|
+
};
|
|
3856
|
+
m !== void 0 ? (N = P.getLocation) == null || N.call(P, A, k, m) : (R = P.getLocation) == null || R.call(P, A, k);
|
|
3857
|
+
});
|
|
3858
|
+
}, getPoints: (g, m) => Promise.all(g.map((b) => new Promise((P) => {
|
|
3859
|
+
var N, R;
|
|
3860
|
+
if (!a) return P(null);
|
|
3861
|
+
let O = !1;
|
|
3862
|
+
const A = setTimeout(() => {
|
|
3863
|
+
O || (O = !0, P(null));
|
|
3864
|
+
}, Pe), k = (_) => {
|
|
3865
|
+
O || (O = !0, clearTimeout(A), P(_ ?? null));
|
|
3866
|
+
};
|
|
3867
|
+
m !== void 0 ? (N = a.getPoint) == null || N.call(a, b, k, m) : (R = a.getPoint) == null || R.call(a, b, k);
|
|
3868
|
+
}))), getLocations: (g, m) => Promise.all(g.map((b) => new Promise((P) => {
|
|
3869
|
+
var _, G;
|
|
3870
|
+
if (!a) return P(null);
|
|
3871
|
+
const O = de(), A = new O.Point(b.lng, b.lat);
|
|
3872
|
+
let k = !1;
|
|
3873
|
+
const N = setTimeout(() => {
|
|
3874
|
+
k || (k = !0, P(null));
|
|
3875
|
+
}, Pe), R = (U) => {
|
|
3876
|
+
k || (k = !0, clearTimeout(N), P(U ?? null));
|
|
3877
|
+
};
|
|
3878
|
+
m !== void 0 ? (_ = a.getLocation) == null || _.call(a, A, R, m) : (G = a.getLocation) == null || G.call(a, A, R);
|
|
3879
|
+
}))), setOptions: (g) => {
|
|
3880
|
+
var m;
|
|
3881
|
+
(m = a == null ? void 0 : a.setOptions) == null || m.call(a, g);
|
|
3882
|
+
}, cancel: () => {
|
|
3883
|
+
r++, h(), p.value = !1;
|
|
3884
|
+
} };
|
|
3885
|
+
}
|
|
3886
|
+
export {
|
|
3887
|
+
Do as BMAP_ANCHOR_BOTTOM_CENTER,
|
|
3888
|
+
Vo as BMAP_ANCHOR_BOTTOM_LEFT,
|
|
3889
|
+
Uo as BMAP_ANCHOR_BOTTOM_RIGHT,
|
|
3890
|
+
Fo as BMAP_ANCHOR_CENTER,
|
|
3891
|
+
bo as BMAP_ANCHOR_LEFT_CENTER,
|
|
3892
|
+
Ba as BMAP_ANCHOR_MIDDLE_LEFT,
|
|
3893
|
+
za as BMAP_ANCHOR_MIDDLE_RIGHT,
|
|
3894
|
+
Oo as BMAP_ANCHOR_RIGHT_CENTER,
|
|
3895
|
+
Yo as BMAP_ANCHOR_TOP_CENTER,
|
|
3896
|
+
Ho as BMAP_ANCHOR_TOP_LEFT,
|
|
3897
|
+
Wo as BMAP_ANCHOR_TOP_RIGHT,
|
|
3898
|
+
an as BMAP_ANIMATION_BOUNCE,
|
|
3899
|
+
nn as BMAP_ANIMATION_DROP,
|
|
3900
|
+
Ma as BMAP_CONTEXT_MENU_ICON_ZOOMIN,
|
|
3901
|
+
va as BMAP_CONTEXT_MENU_ICON_ZOOMOUT,
|
|
3902
|
+
li as BMAP_COORD_BD09,
|
|
3903
|
+
di as BMAP_COORD_EPSG3857,
|
|
3904
|
+
si as BMAP_COORD_GCJ02,
|
|
3905
|
+
ci as BMAP_COORD_GCJ02MERCATOR,
|
|
3906
|
+
ri as BMAP_COORD_MERCATOR,
|
|
3907
|
+
pi as BMAP_COORD_WGS84,
|
|
3908
|
+
vn as BMAP_DRIVING_POLICY_AVOID_CONGESTION,
|
|
3909
|
+
Pn as BMAP_DRIVING_POLICY_AVOID_CONGESTION_PAY,
|
|
3910
|
+
gn as BMAP_DRIVING_POLICY_AVOID_HIGHWAYS,
|
|
3911
|
+
On as BMAP_DRIVING_POLICY_AVOID_HIGHWAYS_CONGESTION,
|
|
3912
|
+
Ln as BMAP_DRIVING_POLICY_AVOID_HIGHWAYS_CONGESTION_PAY,
|
|
3913
|
+
An as BMAP_DRIVING_POLICY_AVOID_HIGHWAYS_PAY,
|
|
3914
|
+
Cn as BMAP_DRIVING_POLICY_AVOID_PAY,
|
|
3915
|
+
hn as BMAP_DRIVING_POLICY_DEFAULT,
|
|
3916
|
+
mn as BMAP_DRIVING_POLICY_DESTANCE,
|
|
3917
|
+
Tn as BMAP_DRIVING_POLICY_DISTANCE_PRIORITY,
|
|
3918
|
+
Mn as BMAP_DRIVING_POLICY_FIRST_HIGHWAYS,
|
|
3919
|
+
bn as BMAP_DRIVING_POLICY_HIGHWAYS_AVOID_CONGESTION,
|
|
3920
|
+
_n as BMAP_DRIVING_POLICY_TIME_PRIORITY,
|
|
3921
|
+
qo as BMAP_EARTH_MAP,
|
|
3922
|
+
qi as BMAP_HIGHLIGHT_ROUTE,
|
|
3923
|
+
$i as BMAP_HIGHLIGHT_STEP,
|
|
3924
|
+
$o as BMAP_HYBRID_MAP,
|
|
3925
|
+
Yn as BMAP_INTERCITY_POLICY_CHEAP_PRICE,
|
|
3926
|
+
Un as BMAP_INTERCITY_POLICY_EARLY_START,
|
|
3927
|
+
Vn as BMAP_INTERCITY_POLICY_LEAST_TIME,
|
|
3928
|
+
_t as BMAP_KEY,
|
|
3929
|
+
$n as BMAP_LANGUAGE_DE,
|
|
3930
|
+
Lo as BMAP_LANGUAGE_EN,
|
|
3931
|
+
Fn as BMAP_LANGUAGE_ES,
|
|
3932
|
+
Jn as BMAP_LANGUAGE_FR,
|
|
3933
|
+
ni as BMAP_LANGUAGE_ID,
|
|
3934
|
+
Kn as BMAP_LANGUAGE_IT,
|
|
3935
|
+
Xn as BMAP_LANGUAGE_JA,
|
|
3936
|
+
Qn as BMAP_LANGUAGE_KO,
|
|
3937
|
+
ti as BMAP_LANGUAGE_MS,
|
|
3938
|
+
jn as BMAP_LANGUAGE_PT,
|
|
3939
|
+
ei as BMAP_LANGUAGE_RU,
|
|
3940
|
+
qn as BMAP_LANGUAGE_TH,
|
|
3941
|
+
wn as BMAP_LANGUAGE_TR,
|
|
3942
|
+
oi as BMAP_LANGUAGE_VI,
|
|
3943
|
+
Po as BMAP_LANGUAGE_ZH,
|
|
3944
|
+
Dn as BMAP_LANGUAGE_ZH_TW,
|
|
3945
|
+
xa as BMAP_LANG_CN,
|
|
3946
|
+
Ga as BMAP_LANG_EN,
|
|
3947
|
+
La as BMAP_LINE_TYPE_AIRPLANE,
|
|
3948
|
+
Ca as BMAP_LINE_TYPE_BUS,
|
|
3949
|
+
Aa as BMAP_LINE_TYPE_COACH,
|
|
3950
|
+
Oa as BMAP_LINE_TYPE_FERRY,
|
|
3951
|
+
ba as BMAP_LINE_TYPE_SUBWAY,
|
|
3952
|
+
Pa as BMAP_LINE_TYPE_TRAIN,
|
|
3953
|
+
tn as BMAP_MAPTYPE_CONTROL_DROPDOWN,
|
|
3954
|
+
en as BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
3955
|
+
on as BMAP_MAPTYPE_CONTROL_MAP,
|
|
3956
|
+
ta as BMAP_MODE_DRIVING,
|
|
3957
|
+
ia as BMAP_MODE_NAVIGATION,
|
|
3958
|
+
oa as BMAP_MODE_TRANSIT,
|
|
3959
|
+
na as BMAP_MODE_WALKING,
|
|
3960
|
+
Xo as BMAP_NAVIGATION_CONTROL_LARGE,
|
|
3961
|
+
wo as BMAP_NAVIGATION_CONTROL_PAN,
|
|
3962
|
+
Qo as BMAP_NAVIGATION_CONTROL_SMALL,
|
|
3963
|
+
Ko as BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
3964
|
+
jo as BMAP_NORMAL_MAP,
|
|
3965
|
+
Ea as BMAP_PANORAMA_INDOOR_SCENE,
|
|
3966
|
+
_a as BMAP_PANORAMA_POI_CATERING,
|
|
3967
|
+
Ta as BMAP_PANORAMA_POI_HOTEL,
|
|
3968
|
+
Sa as BMAP_PANORAMA_POI_INDOOR_SCENE,
|
|
3969
|
+
Ia as BMAP_PANORAMA_POI_MOVIE,
|
|
3970
|
+
Na as BMAP_PANORAMA_POI_NONE,
|
|
3971
|
+
ka as BMAP_PANORAMA_POI_TRANSIT,
|
|
3972
|
+
Ra as BMAP_PANORAMA_STREET_SCENE,
|
|
3973
|
+
ha as BMAP_POINT_DENSITY_HIGH,
|
|
3974
|
+
ga as BMAP_POINT_DENSITY_LOW,
|
|
3975
|
+
ma as BMAP_POINT_DENSITY_MEDIUM,
|
|
3976
|
+
Ii as BMAP_POINT_SHAPE_CIRCLE,
|
|
3977
|
+
xi as BMAP_POINT_SHAPE_LAYER_ARROW,
|
|
3978
|
+
Gi as BMAP_POINT_SHAPE_LAYER_ARROW_TAIL,
|
|
3979
|
+
Ni as BMAP_POINT_SHAPE_LAYER_CIRCLE,
|
|
3980
|
+
zi as BMAP_POINT_SHAPE_LAYER_CROSS,
|
|
3981
|
+
Bi as BMAP_POINT_SHAPE_LAYER_DIAMOND,
|
|
3982
|
+
Ri as BMAP_POINT_SHAPE_LAYER_SQUARE,
|
|
3983
|
+
Zi as BMAP_POINT_SHAPE_LAYER_STAR,
|
|
3984
|
+
Ei as BMAP_POINT_SHAPE_LAYER_TRIANGLE,
|
|
3985
|
+
Hi as BMAP_POINT_SHAPE_LAYER_WATERDROP,
|
|
3986
|
+
Si as BMAP_POINT_SHAPE_RHOMBUS,
|
|
3987
|
+
ki as BMAP_POINT_SHAPE_SQUARE,
|
|
3988
|
+
Ti as BMAP_POINT_SHAPE_STAR,
|
|
3989
|
+
_i as BMAP_POINT_SHAPE_WATERDROP,
|
|
3990
|
+
Di as BMAP_POINT_SIZE_BIG,
|
|
3991
|
+
Fi as BMAP_POINT_SIZE_BIGGER,
|
|
3992
|
+
ji as BMAP_POINT_SIZE_HUGE,
|
|
3993
|
+
Yi as BMAP_POINT_SIZE_NORMAL,
|
|
3994
|
+
Ui as BMAP_POINT_SIZE_SMALL,
|
|
3995
|
+
Vi as BMAP_POINT_SIZE_SMALLER,
|
|
3996
|
+
Wi as BMAP_POINT_SIZE_TINY,
|
|
3997
|
+
wi as BMAP_POI_TYPE_BUSLINE,
|
|
3998
|
+
Qi as BMAP_POI_TYPE_BUSSTOP,
|
|
3999
|
+
Xi as BMAP_POI_TYPE_NORMAL,
|
|
4000
|
+
ea as BMAP_POI_TYPE_SUBLINE,
|
|
4001
|
+
Ki as BMAP_POI_TYPE_SUBSTOP,
|
|
4002
|
+
sa as BMAP_ROUTE_STATUS_ADDRESS,
|
|
4003
|
+
ra as BMAP_ROUTE_STATUS_EMPTY,
|
|
4004
|
+
aa as BMAP_ROUTE_STATUS_NORMAL,
|
|
4005
|
+
ca as BMAP_ROUTE_TYPE_DRIVING,
|
|
4006
|
+
pa as BMAP_ROUTE_TYPE_RIDING,
|
|
4007
|
+
la as BMAP_ROUTE_TYPE_WALKING,
|
|
4008
|
+
Jo as BMAP_SATELLITE_MAP,
|
|
4009
|
+
Ji as BMAP_SHAPE_CIRCLE,
|
|
4010
|
+
Ao as BMAP_SHAPE_RECT,
|
|
4011
|
+
Za as BMAP_SHAPE_RECTANGLE,
|
|
4012
|
+
sn as BMAP_STATUS_CITY_LIST,
|
|
4013
|
+
pn as BMAP_STATUS_INVALID_KEY,
|
|
4014
|
+
dn as BMAP_STATUS_INVALID_REQUEST,
|
|
4015
|
+
un as BMAP_STATUS_PERMISSION_DENIED,
|
|
4016
|
+
yn as BMAP_STATUS_SERVICE_UNAVAILABLE,
|
|
4017
|
+
rn as BMAP_STATUS_SUCCESS,
|
|
4018
|
+
fn as BMAP_STATUS_TIMEOUT,
|
|
4019
|
+
ln as BMAP_STATUS_UNKNOWN_LOCATION,
|
|
4020
|
+
cn as BMAP_STATUS_UNKNOWN_ROUTE,
|
|
4021
|
+
fa as BMAP_TRAFFICE_STATUS_JAM,
|
|
4022
|
+
da as BMAP_TRAFFICE_STATUS_NONE,
|
|
4023
|
+
ua as BMAP_TRAFFICE_STATUS_NORMAL,
|
|
4024
|
+
ya as BMAP_TRAFFICE_STATUS_SLOW,
|
|
4025
|
+
Wn as BMAP_TRANSIT_PLAN_TYPE_LINE,
|
|
4026
|
+
Hn as BMAP_TRANSIT_PLAN_TYPE_ROUTE,
|
|
4027
|
+
Nn as BMAP_TRANSIT_POLICY_AVOID_SUBWAYS,
|
|
4028
|
+
En as BMAP_TRANSIT_POLICY_FIRST_SUBWAYS,
|
|
4029
|
+
Rn as BMAP_TRANSIT_POLICY_LEAST_TIME,
|
|
4030
|
+
kn as BMAP_TRANSIT_POLICY_LEAST_TRANSFER,
|
|
4031
|
+
Sn as BMAP_TRANSIT_POLICY_LEAST_WALKING,
|
|
4032
|
+
In as BMAP_TRANSIT_POLICY_RECOMMEND,
|
|
4033
|
+
zn as BMAP_TRANSIT_TYPE_CROSS_CITY,
|
|
4034
|
+
Bn as BMAP_TRANSIT_TYPE_IN_CITY,
|
|
4035
|
+
Gn as BMAP_TRANSIT_TYPE_POLICY_AIRPLANE,
|
|
4036
|
+
Zn as BMAP_TRANSIT_TYPE_POLICY_COACH,
|
|
4037
|
+
xn as BMAP_TRANSIT_TYPE_POLICY_TRAIN,
|
|
4038
|
+
ai as BMAP_UNIT_IMPERIAL,
|
|
4039
|
+
ii as BMAP_UNIT_METRIC,
|
|
4040
|
+
Zo as BMapProvider,
|
|
4041
|
+
mi as BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,
|
|
4042
|
+
Mi as BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,
|
|
4043
|
+
Oi as BMap_Symbol_SHAPE_CAMERA,
|
|
4044
|
+
ui as BMap_Symbol_SHAPE_CIRCLE,
|
|
4045
|
+
Ai as BMap_Symbol_SHAPE_CLOCK,
|
|
4046
|
+
gi as BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,
|
|
4047
|
+
vi as BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,
|
|
4048
|
+
bi as BMap_Symbol_SHAPE_PLANE,
|
|
4049
|
+
Ci as BMap_Symbol_SHAPE_POINT,
|
|
4050
|
+
yi as BMap_Symbol_SHAPE_RECTANGLE,
|
|
4051
|
+
fi as BMap_Symbol_SHAPE_RHOMBUS,
|
|
4052
|
+
Li as BMap_Symbol_SHAPE_SMILE,
|
|
4053
|
+
hi as BMap_Symbol_SHAPE_STAR,
|
|
4054
|
+
Pi as BMap_Symbol_SHAPE_WARNING,
|
|
4055
|
+
$a as BezierCurve,
|
|
4056
|
+
Cr as CanvasLayer,
|
|
4057
|
+
ja as Circle,
|
|
4058
|
+
ur as CityListControl,
|
|
4059
|
+
cr as CopyrightControl,
|
|
4060
|
+
vr as CustomLayer,
|
|
4061
|
+
Mr as DistrictLayer,
|
|
4062
|
+
gr as GeoJSONLayer,
|
|
4063
|
+
ko as GeolocationControl,
|
|
4064
|
+
Xa as GroundOverlay,
|
|
4065
|
+
Qa as GroundPoint,
|
|
4066
|
+
or as Hotspot,
|
|
4067
|
+
er as Icon,
|
|
4068
|
+
tr as IconSequence,
|
|
4069
|
+
Va as InfoWindow,
|
|
4070
|
+
Ya as Label,
|
|
4071
|
+
yr as LocationControl,
|
|
4072
|
+
fr as LogoControl,
|
|
4073
|
+
$ as MAP_KEY,
|
|
4074
|
+
Tr as MVTLayer,
|
|
4075
|
+
Wa as Map,
|
|
4076
|
+
Bt as MapRefImpl,
|
|
4077
|
+
lr as MapTypeControl,
|
|
4078
|
+
Ua as Marker,
|
|
4079
|
+
nr as Marker3D,
|
|
4080
|
+
ir as NavigationControl,
|
|
4081
|
+
ar as NavigationControl3D,
|
|
4082
|
+
mr as NormalLayer,
|
|
4083
|
+
Me as OVERLAY_TARGET_KEY,
|
|
4084
|
+
sr as OverviewMapControl,
|
|
4085
|
+
pr as PanoramaControl,
|
|
4086
|
+
wa as PointCollection,
|
|
4087
|
+
Fa as Polygon,
|
|
4088
|
+
Da as Polyline,
|
|
4089
|
+
qa as Prism,
|
|
4090
|
+
Or as RasterTileLayer,
|
|
4091
|
+
Ja as Rectangle,
|
|
4092
|
+
rr as ScaleControl,
|
|
4093
|
+
Ka as Symbol,
|
|
4094
|
+
hr as TileLayer,
|
|
4095
|
+
br as TrafficLayer,
|
|
4096
|
+
Ae as UnsupportedCapabilityError,
|
|
4097
|
+
Pr as WMSLayer,
|
|
4098
|
+
Lr as WMTSLayer,
|
|
4099
|
+
Ar as XYZLayer,
|
|
4100
|
+
dr as ZoomControl,
|
|
4101
|
+
V as createControlComponent,
|
|
4102
|
+
yo as createDriver,
|
|
4103
|
+
H as createLayerComponent,
|
|
4104
|
+
B as createOverlayComponent,
|
|
4105
|
+
Ha as getSdkConstant,
|
|
4106
|
+
Go as tryOp,
|
|
4107
|
+
ee as useBMapContext,
|
|
4108
|
+
Rr as useCapabilities,
|
|
4109
|
+
Sr as useDriver,
|
|
4110
|
+
zr as useGeocoder,
|
|
4111
|
+
Br as useIcon,
|
|
4112
|
+
_r as useMap,
|
|
4113
|
+
ye as useMapContext,
|
|
4114
|
+
xo as useMapContextOptional,
|
|
4115
|
+
Ir as useMapEvent,
|
|
4116
|
+
kr as useMapReady,
|
|
4117
|
+
Nr as useMapRef,
|
|
4118
|
+
Eo as useServiceTimeout,
|
|
4119
|
+
Er as useSymbol
|
|
4120
|
+
};
|
|
4121
|
+
//# sourceMappingURL=index.js.map
|