@spuermomonga/vue3-bmapgl 0.0.6 → 0.0.8
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/dist/index.js +153 -118
- package/dist/index.prod.js +1 -1
- package/es/_mixins/use-config.mjs +16 -16
- package/es/_mixins/use-config.mjs.map +1 -1
- package/es/layer/xyz/index.d.ts +1 -1
- package/es/layer/xyz/src/xyz-props.d.ts +52 -6
- package/es/layer/xyz/src/xyz-props.mjs +48 -3
- package/es/layer/xyz/src/xyz-props.mjs.map +1 -1
- package/es/layer/xyz/src/xyz.d.ts +103 -7
- package/es/layer/xyz/src/xyz.mjs +78 -44
- package/es/layer/xyz/src/xyz.mjs.map +1 -1
- package/es/map/src/map-props.d.ts +15 -59
- package/es/map/src/map-props.mjs +15 -59
- package/es/map/src/map-props.mjs.map +1 -1
- package/es/map/src/map.d.ts +30 -125
- package/lib/_mixins/use-config.js +16 -16
- package/lib/_mixins/use-config.js.map +1 -1
- package/lib/layer/xyz/index.d.ts +1 -1
- package/lib/layer/xyz/src/xyz-props.d.ts +52 -6
- package/lib/layer/xyz/src/xyz-props.js +48 -3
- package/lib/layer/xyz/src/xyz-props.js.map +1 -1
- package/lib/layer/xyz/src/xyz.d.ts +103 -7
- package/lib/layer/xyz/src/xyz.js +77 -43
- package/lib/layer/xyz/src/xyz.js.map +1 -1
- package/lib/map/src/map-props.d.ts +15 -59
- package/lib/map/src/map-props.js +15 -59
- package/lib/map/src/map-props.js.map +1 -1
- package/lib/map/src/map.d.ts +30 -125
- package/package.json +2 -2
- package/es/node_modules/.pnpm/@rollup_plugin-typescript@1_b93953ac7ab797e62adf5212a782f0d9/node_modules/tslib/tslib.es6.mjs +0 -36
- package/es/node_modules/.pnpm/@rollup_plugin-typescript@1_b93953ac7ab797e62adf5212a782f0d9/node_modules/tslib/tslib.es6.mjs.map +0 -1
- package/lib/node_modules/.pnpm/@rollup_plugin-typescript@1_b93953ac7ab797e62adf5212a782f0d9/node_modules/tslib/tslib.es6.js +0 -38
- package/lib/node_modules/.pnpm/@rollup_plugin-typescript@1_b93953ac7ab797e62adf5212a782f0d9/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -8,24 +8,24 @@ function useConfig(props = {}) {
|
|
|
8
8
|
return {
|
|
9
9
|
mergedStatusRef: BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedStatusRef,
|
|
10
10
|
mergedMapSetRef: vue.computed(() => {
|
|
11
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
12
12
|
const { zoom, center, heading, minZoom, maxZoom, enableScrollWheelZoom, enableDragging, tilt, enableTilt, mapType, enableAutoResize, enableTiltGestures, enableRotate, enableRotateGestures, displayOptions } = props;
|
|
13
13
|
return {
|
|
14
|
-
zoom: zoom !== null && zoom !== void 0 ? zoom : (_a = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _a === void 0 ? void 0 : _a.zoom,
|
|
15
|
-
center: center !== null && center !== void 0 ? center : (
|
|
16
|
-
heading: heading !== null && heading !== void 0 ? heading : (
|
|
17
|
-
minZoom: minZoom !== null && minZoom !== void 0 ? minZoom : (
|
|
18
|
-
maxZoom: maxZoom !== null && maxZoom !== void 0 ? maxZoom : (
|
|
19
|
-
enableScrollWheelZoom: enableScrollWheelZoom !== null && enableScrollWheelZoom !== void 0 ? enableScrollWheelZoom : (
|
|
20
|
-
enableDragging: enableDragging !== null && enableDragging !== void 0 ? enableDragging : (
|
|
21
|
-
tilt: tilt !== null && tilt !== void 0 ? tilt : (
|
|
22
|
-
enableTilt: enableTilt !== null && enableTilt !== void 0 ? enableTilt : (
|
|
23
|
-
mapType: mapType !== null && mapType !== void 0 ? mapType : (
|
|
24
|
-
enableAutoResize: enableAutoResize !== null && enableAutoResize !== void 0 ? enableAutoResize : (
|
|
25
|
-
enableTiltGestures: enableTiltGestures !== null && enableTiltGestures !== void 0 ? enableTiltGestures : (
|
|
26
|
-
enableRotate: enableRotate !== null && enableRotate !== void 0 ? enableRotate : (
|
|
27
|
-
enableRotateGestures: enableRotateGestures !== null && enableRotateGestures !== void 0 ? enableRotateGestures : (
|
|
28
|
-
displayOptions: displayOptions !== null && displayOptions !== void 0 ? displayOptions : (
|
|
14
|
+
zoom: (_b = zoom !== null && zoom !== void 0 ? zoom : (_a = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _a === void 0 ? void 0 : _a.zoom) !== null && _b !== void 0 ? _b : 14,
|
|
15
|
+
center: (_d = center !== null && center !== void 0 ? center : (_c = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _c === void 0 ? void 0 : _c.center) !== null && _d !== void 0 ? _d : [116.403901, 39.915185],
|
|
16
|
+
heading: (_f = heading !== null && heading !== void 0 ? heading : (_e = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _e === void 0 ? void 0 : _e.heading) !== null && _f !== void 0 ? _f : 0,
|
|
17
|
+
minZoom: (_h = minZoom !== null && minZoom !== void 0 ? minZoom : (_g = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _g === void 0 ? void 0 : _g.minZoom) !== null && _h !== void 0 ? _h : 0,
|
|
18
|
+
maxZoom: (_k = maxZoom !== null && maxZoom !== void 0 ? maxZoom : (_j = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _j === void 0 ? void 0 : _j.maxZoom) !== null && _k !== void 0 ? _k : 21,
|
|
19
|
+
enableScrollWheelZoom: (_m = enableScrollWheelZoom !== null && enableScrollWheelZoom !== void 0 ? enableScrollWheelZoom : (_l = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _l === void 0 ? void 0 : _l.enableScrollWheelZoom) !== null && _m !== void 0 ? _m : false,
|
|
20
|
+
enableDragging: (_p = enableDragging !== null && enableDragging !== void 0 ? enableDragging : (_o = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _o === void 0 ? void 0 : _o.enableDragging) !== null && _p !== void 0 ? _p : true,
|
|
21
|
+
tilt: (_r = tilt !== null && tilt !== void 0 ? tilt : (_q = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _q === void 0 ? void 0 : _q.tilt) !== null && _r !== void 0 ? _r : 0,
|
|
22
|
+
enableTilt: (_t = enableTilt !== null && enableTilt !== void 0 ? enableTilt : (_s = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _s === void 0 ? void 0 : _s.enableTilt) !== null && _t !== void 0 ? _t : false,
|
|
23
|
+
mapType: (_v = mapType !== null && mapType !== void 0 ? mapType : (_u = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _u === void 0 ? void 0 : _u.mapType) !== null && _v !== void 0 ? _v : "BMAP_NORMAL_MAP",
|
|
24
|
+
enableAutoResize: (_x = enableAutoResize !== null && enableAutoResize !== void 0 ? enableAutoResize : (_w = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _w === void 0 ? void 0 : _w.enableAutoResize) !== null && _x !== void 0 ? _x : true,
|
|
25
|
+
enableTiltGestures: (_z = enableTiltGestures !== null && enableTiltGestures !== void 0 ? enableTiltGestures : (_y = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _y === void 0 ? void 0 : _y.enableTiltGestures) !== null && _z !== void 0 ? _z : false,
|
|
26
|
+
enableRotate: (_1 = enableRotate !== null && enableRotate !== void 0 ? enableRotate : (_0 = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _0 === void 0 ? void 0 : _0.enableRotate) !== null && _1 !== void 0 ? _1 : false,
|
|
27
|
+
enableRotateGestures: (_3 = enableRotateGestures !== null && enableRotateGestures !== void 0 ? enableRotateGestures : (_2 = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _2 === void 0 ? void 0 : _2.enableRotateGestures) !== null && _3 !== void 0 ? _3 : false,
|
|
28
|
+
displayOptions: displayOptions !== null && displayOptions !== void 0 ? displayOptions : (_4 = BConfigProvider === null || BConfigProvider === void 0 ? void 0 : BConfigProvider.mergedMapSetRef.value) === null || _4 === void 0 ? void 0 : _4.displayOptions
|
|
29
29
|
};
|
|
30
30
|
})
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-config.js","sources":["../../src/_mixins/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/_mixins/use-config.ts"],"sourcesContent":["import type { Ref } from 'vue'\r\nimport type { MapConfig } from '../config-provider/src/config-provider-props'\r\nimport type { LoadStatus } from '../config-provider/src/internal-interface'\r\nimport { computed, inject } from 'vue'\r\nimport { configProviderInjectionKey } from '../config-provider'\r\n\r\ntype UseConfigProps = Readonly<{\r\n bordered?: boolean\r\n [key: string]: unknown\r\n}>\r\n\r\nexport default function useConfig(props: UseConfigProps = {}): {\r\n mergedStatusRef: Ref<LoadStatus> | undefined\r\n mergedMapSetRef: Ref<MapConfig>\r\n} {\r\n const BConfigProvider = inject(configProviderInjectionKey, null)\r\n return {\r\n mergedStatusRef: BConfigProvider?.mergedStatusRef,\r\n mergedMapSetRef: computed(() => {\r\n const { zoom, center, heading, minZoom, maxZoom, enableScrollWheelZoom, enableDragging, tilt, enableTilt, mapType, enableAutoResize, enableTiltGestures, enableRotate, enableRotateGestures, displayOptions } = props\r\n return {\r\n zoom: zoom ?? BConfigProvider?.mergedMapSetRef.value?.zoom,\r\n center: center ?? BConfigProvider?.mergedMapSetRef.value?.center,\r\n heading: heading ?? BConfigProvider?.mergedMapSetRef.value?.heading,\r\n minZoom: minZoom ?? BConfigProvider?.mergedMapSetRef.value?.minZoom,\r\n maxZoom: maxZoom ?? BConfigProvider?.mergedMapSetRef.value?.maxZoom,\r\n enableScrollWheelZoom: enableScrollWheelZoom ?? BConfigProvider?.mergedMapSetRef.value?.enableScrollWheelZoom,\r\n enableDragging: enableDragging ?? BConfigProvider?.mergedMapSetRef.value?.enableDragging,\r\n tilt: tilt ?? BConfigProvider?.mergedMapSetRef.value?.tilt,\r\n enableTilt: enableTilt ?? BConfigProvider?.mergedMapSetRef.value?.enableTilt,\r\n mapType: mapType ?? BConfigProvider?.mergedMapSetRef.value?.mapType,\r\n enableAutoResize: enableAutoResize ?? BConfigProvider?.mergedMapSetRef.value?.enableAutoResize,\r\n enableTiltGestures: enableTiltGestures ?? BConfigProvider?.mergedMapSetRef.value?.enableTiltGestures,\r\n enableRotate: enableRotate ?? BConfigProvider?.mergedMapSetRef.value?.enableRotate,\r\n enableRotateGestures: enableRotateGestures ?? BConfigProvider?.mergedMapSetRef.value?.enableRotateGestures,\r\n displayOptions: displayOptions ?? BConfigProvider?.mergedMapSetRef.value?.displayOptions,\r\n } as MapConfig\r\n }),\r\n }\r\n}\r\n"],"names":["inject","configProviderInjectionKey","computed"],"mappings":";;;;;AAWA,SAAwB,SAAA,CAAU,KAAA,GAAwB,EAAA,EAAE;AAI1D,EAAA,MAAM,eAAA,GAAkBA,UAAA,CAAOC,oCAAA,EAA4B,IAAI,CAAA;AAC/D,EAAA,OAAO;AAAA,IACL,iBAAiB,eAAA,KAAe,IAAA,IAAf,eAAA,KAAe,MAAA,GAAA,SAAf,eAAA,CAAiB,eAAA;AAAA,IAClC,eAAA,EAAiBC,aAAS,MAAK;;AAC7B,MAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,OAAA,EAAS,OAAA,EAAS,SAAS,qBAAA,EAAuB,cAAA,EAAgB,IAAA,EAAM,UAAA,EAAY,SAAS,gBAAA,EAAkB,kBAAA,EAAoB,YAAA,EAAc,oBAAA,EAAsB,gBAAc,GAAK,KAAA;AAChN,MAAA,OAAO;AAAA,QACL,MAAM,IAAA,KAAI,IAAA,IAAJ,
|
|
1
|
+
{"version":3,"file":"use-config.js","sources":["../../src/_mixins/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/_mixins/use-config.ts"],"sourcesContent":["import type { Ref } from 'vue'\r\nimport type { MapConfig } from '../config-provider/src/config-provider-props'\r\nimport type { LoadStatus } from '../config-provider/src/internal-interface'\r\nimport { computed, inject } from 'vue'\r\nimport { configProviderInjectionKey } from '../config-provider'\r\n\r\ntype UseConfigProps = Readonly<{\r\n bordered?: boolean\r\n [key: string]: unknown\r\n}>\r\n\r\nexport default function useConfig(props: UseConfigProps = {}): {\r\n mergedStatusRef: Ref<LoadStatus> | undefined\r\n mergedMapSetRef: Ref<MapConfig>\r\n} {\r\n const BConfigProvider = inject(configProviderInjectionKey, null)\r\n return {\r\n mergedStatusRef: BConfigProvider?.mergedStatusRef,\r\n mergedMapSetRef: computed(() => {\r\n const { zoom, center, heading, minZoom, maxZoom, enableScrollWheelZoom, enableDragging, tilt, enableTilt, mapType, enableAutoResize, enableTiltGestures, enableRotate, enableRotateGestures, displayOptions } = props\r\n return {\r\n zoom: zoom ?? BConfigProvider?.mergedMapSetRef.value?.zoom ?? 14,\r\n center: center ?? BConfigProvider?.mergedMapSetRef.value?.center ?? [116.403901, 39.915185],\r\n heading: heading ?? BConfigProvider?.mergedMapSetRef.value?.heading ?? 0,\r\n minZoom: minZoom ?? BConfigProvider?.mergedMapSetRef.value?.minZoom ?? 0,\r\n maxZoom: maxZoom ?? BConfigProvider?.mergedMapSetRef.value?.maxZoom ?? 21,\r\n enableScrollWheelZoom: enableScrollWheelZoom ?? BConfigProvider?.mergedMapSetRef.value?.enableScrollWheelZoom ?? false,\r\n enableDragging: enableDragging ?? BConfigProvider?.mergedMapSetRef.value?.enableDragging ?? true,\r\n tilt: tilt ?? BConfigProvider?.mergedMapSetRef.value?.tilt ?? 0,\r\n enableTilt: enableTilt ?? BConfigProvider?.mergedMapSetRef.value?.enableTilt ?? false,\r\n mapType: mapType ?? BConfigProvider?.mergedMapSetRef.value?.mapType ?? 'BMAP_NORMAL_MAP',\r\n enableAutoResize: enableAutoResize ?? BConfigProvider?.mergedMapSetRef.value?.enableAutoResize ?? true,\r\n enableTiltGestures: enableTiltGestures ?? BConfigProvider?.mergedMapSetRef.value?.enableTiltGestures ?? false,\r\n enableRotate: enableRotate ?? BConfigProvider?.mergedMapSetRef.value?.enableRotate ?? false,\r\n enableRotateGestures: enableRotateGestures ?? BConfigProvider?.mergedMapSetRef.value?.enableRotateGestures ?? false,\r\n displayOptions: displayOptions ?? BConfigProvider?.mergedMapSetRef.value?.displayOptions,\r\n } as MapConfig\r\n }),\r\n }\r\n}\r\n"],"names":["inject","configProviderInjectionKey","computed"],"mappings":";;;;;AAWA,SAAwB,SAAA,CAAU,KAAA,GAAwB,EAAA,EAAE;AAI1D,EAAA,MAAM,eAAA,GAAkBA,UAAA,CAAOC,oCAAA,EAA4B,IAAI,CAAA;AAC/D,EAAA,OAAO;AAAA,IACL,iBAAiB,eAAA,KAAe,IAAA,IAAf,eAAA,KAAe,MAAA,GAAA,SAAf,eAAA,CAAiB,eAAA;AAAA,IAClC,eAAA,EAAiBC,aAAS,MAAK;;AAC7B,MAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,OAAA,EAAS,OAAA,EAAS,SAAS,qBAAA,EAAuB,cAAA,EAAgB,IAAA,EAAM,UAAA,EAAY,SAAS,gBAAA,EAAkB,kBAAA,EAAoB,YAAA,EAAc,oBAAA,EAAsB,gBAAc,GAAK,KAAA;AAChN,MAAA,OAAO;AAAA,QACL,IAAA,EAAA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CAAE,kBAAA,MAAkB,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,KAAA;AAAA,QACxG,YAAA,EAAA,MAAc,YAAA,KAAY,IAAA,IAAZ,YAAA,KAAY,SAAZ,YAAA,GAAA,CAAgB,EAAA,GAAA,eAAA,aAAA,eAAA,KAAe,MAAA,GAAA,SAAf,eAAA,CAAiB,eAAA,CAAgB,KAAA,MAAK,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,YAAA,MAAY,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,KAAA;AAAA,QACtF,oBAAA,EAAA,MAAsB,oBAAA,KAAoB,IAAA,IAApB,oBAAA,KAAoB,SAApB,oBAAA,GAAA,CAAwB,EAAA,GAAA,eAAA,aAAA,eAAA,KAAe,MAAA,GAAA,SAAf,eAAA,CAAiB,eAAA,CAAgB,KAAA,MAAK,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,oBAAA,MAAoB,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,KAAA;AAAA,QAC9G,gBAAgB,cAAA,KAAc,IAAA,IAAd,mBAAc,MAAA,GAAd,cAAA,GAAA,CAAkB,KAAA,eAAA,KAAe,IAAA,IAAf,sCAAA,gBAAiB,eAAA,CAAgB,KAAA,0CAAO;AAAA;IAE9E,CAAC;AAAA;AAEL;;;;"}
|
package/lib/layer/xyz/index.d.ts
CHANGED
|
@@ -1,16 +1,62 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { ExtractPublicPropTypes } from '../../../_utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type TemplateFn = (x: number, y: number, z: number) => number;
|
|
4
|
+
type BTemplateFn = (x: number, y: number, z: number) => string;
|
|
5
|
+
type GetTile = (info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void;
|
|
6
6
|
export declare const xyzLayerProps: {
|
|
7
7
|
readonly visible: {
|
|
8
8
|
readonly type: BooleanConstructor;
|
|
9
9
|
readonly default: true;
|
|
10
10
|
};
|
|
11
|
-
readonly
|
|
12
|
-
readonly type: PropType<
|
|
13
|
-
|
|
11
|
+
readonly getTile: {
|
|
12
|
+
readonly type: PropType<GetTile>;
|
|
13
|
+
};
|
|
14
|
+
readonly useThumbData: {
|
|
15
|
+
readonly type: BooleanConstructor;
|
|
16
|
+
readonly default: false;
|
|
17
|
+
};
|
|
18
|
+
readonly xTemplate: {
|
|
19
|
+
readonly type: PropType<TemplateFn>;
|
|
20
|
+
};
|
|
21
|
+
readonly yTemplate: {
|
|
22
|
+
readonly type: PropType<TemplateFn>;
|
|
23
|
+
};
|
|
24
|
+
readonly zTemplate: {
|
|
25
|
+
readonly type: PropType<TemplateFn>;
|
|
26
|
+
};
|
|
27
|
+
readonly bTemplate: {
|
|
28
|
+
readonly type: PropType<BTemplateFn>;
|
|
29
|
+
};
|
|
30
|
+
readonly minZoom: {
|
|
31
|
+
readonly type: NumberConstructor;
|
|
32
|
+
readonly default: 3;
|
|
33
|
+
};
|
|
34
|
+
readonly maxZoom: {
|
|
35
|
+
readonly type: NumberConstructor;
|
|
36
|
+
readonly default: 23;
|
|
37
|
+
};
|
|
38
|
+
readonly extent: {
|
|
39
|
+
readonly type: PropType<number[]>;
|
|
40
|
+
};
|
|
41
|
+
readonly extentCRSIsWGS84: {
|
|
42
|
+
readonly type: BooleanConstructor;
|
|
43
|
+
readonly default: false;
|
|
44
|
+
};
|
|
45
|
+
readonly boundary: {
|
|
46
|
+
readonly type: PropType<string[]>;
|
|
47
|
+
};
|
|
48
|
+
readonly zIndex: {
|
|
49
|
+
readonly type: NumberConstructor;
|
|
50
|
+
readonly default: 1;
|
|
51
|
+
};
|
|
52
|
+
readonly zIndexTop: {
|
|
53
|
+
readonly type: BooleanConstructor;
|
|
54
|
+
readonly default: false;
|
|
55
|
+
};
|
|
56
|
+
readonly tms: {
|
|
57
|
+
readonly type: BooleanConstructor;
|
|
58
|
+
readonly default: false;
|
|
14
59
|
};
|
|
15
60
|
};
|
|
16
61
|
export type XyzLayerProps = ExtractPublicPropTypes<typeof xyzLayerProps>;
|
|
62
|
+
export {};
|
|
@@ -5,9 +5,54 @@ const xyzLayerProps = {
|
|
|
5
5
|
type: Boolean,
|
|
6
6
|
default: true
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
type:
|
|
10
|
-
|
|
8
|
+
getTile: {
|
|
9
|
+
type: Function
|
|
10
|
+
},
|
|
11
|
+
useThumbData: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false
|
|
14
|
+
},
|
|
15
|
+
xTemplate: {
|
|
16
|
+
type: Function
|
|
17
|
+
},
|
|
18
|
+
yTemplate: {
|
|
19
|
+
type: Function
|
|
20
|
+
},
|
|
21
|
+
zTemplate: {
|
|
22
|
+
type: Function
|
|
23
|
+
},
|
|
24
|
+
bTemplate: {
|
|
25
|
+
type: Function
|
|
26
|
+
},
|
|
27
|
+
minZoom: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 3
|
|
30
|
+
},
|
|
31
|
+
maxZoom: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 23
|
|
34
|
+
},
|
|
35
|
+
extent: {
|
|
36
|
+
type: Array
|
|
37
|
+
},
|
|
38
|
+
extentCRSIsWGS84: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
boundary: {
|
|
43
|
+
type: Array
|
|
44
|
+
},
|
|
45
|
+
zIndex: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 1
|
|
48
|
+
},
|
|
49
|
+
zIndexTop: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
tms: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
11
56
|
}
|
|
12
57
|
};
|
|
13
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xyz-props.js","sources":["../../../../src/layer/xyz/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/xyz/src/xyz-props.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { ExtractPublicPropTypes } from '../../../_utils'\r\n\r\
|
|
1
|
+
{"version":3,"file":"xyz-props.js","sources":["../../../../src/layer/xyz/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/xyz/src/xyz-props.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { ExtractPublicPropTypes } from '../../../_utils'\r\n\r\ntype TemplateFn = (x: number, y: number, z: number) => number\r\ntype BTemplateFn = (x: number, y: number, z: number) => string\r\ntype GetTile = (info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void\r\n\r\nexport const xyzLayerProps = {\r\n visible: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n getTile: {\r\n type: Function as PropType<GetTile>,\r\n },\r\n useThumbData: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n xTemplate: {\r\n type: Function as PropType<TemplateFn>,\r\n },\r\n yTemplate: {\r\n type: Function as PropType<TemplateFn>,\r\n },\r\n zTemplate: {\r\n type: Function as PropType<TemplateFn>,\r\n },\r\n bTemplate: {\r\n type: Function as PropType<BTemplateFn>,\r\n },\r\n minZoom: {\r\n type: Number,\r\n default: 3,\r\n },\r\n maxZoom: {\r\n type: Number,\r\n default: 23,\r\n },\r\n extent: {\r\n type: Array as PropType<number[]>,\r\n },\r\n extentCRSIsWGS84: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n boundary: {\r\n type: Array as PropType<string[]>,\r\n },\r\n zIndex: {\r\n type: Number,\r\n default: 1,\r\n },\r\n zIndexTop: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n tms: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n} as const\r\n\r\nexport type XyzLayerProps = ExtractPublicPropTypes<typeof xyzLayerProps>\r\n"],"names":[],"mappings":";;AAOO,MAAM,aAAA,GAAgB;AAAA,EAC3B,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,OAAA,EAAS;AAAA,IACP,IAAA,EAAM;AAAA,GACP;AAAA,EACD,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACP;AAAA,EACD,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACP;AAAA,EACD,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACP;AAAA,EACD,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACP;AAAA,EACD,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACP;AAAA,EACD,gBAAA,EAAkB;AAAA,IAChB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,GACP;AAAA,EACD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,GAAA,EAAK;AAAA,IACH,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA;;;;;"}
|
|
@@ -3,21 +3,117 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
3
3
|
readonly type: BooleanConstructor;
|
|
4
4
|
readonly default: true;
|
|
5
5
|
};
|
|
6
|
-
readonly
|
|
7
|
-
readonly type: import("vue").PropType<
|
|
8
|
-
|
|
6
|
+
readonly getTile: {
|
|
7
|
+
readonly type: import("vue").PropType<(info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
8
|
+
};
|
|
9
|
+
readonly useThumbData: {
|
|
10
|
+
readonly type: BooleanConstructor;
|
|
11
|
+
readonly default: false;
|
|
12
|
+
};
|
|
13
|
+
readonly xTemplate: {
|
|
14
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => number>;
|
|
15
|
+
};
|
|
16
|
+
readonly yTemplate: {
|
|
17
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => number>;
|
|
18
|
+
};
|
|
19
|
+
readonly zTemplate: {
|
|
20
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => number>;
|
|
21
|
+
};
|
|
22
|
+
readonly bTemplate: {
|
|
23
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => string>;
|
|
24
|
+
};
|
|
25
|
+
readonly minZoom: {
|
|
26
|
+
readonly type: NumberConstructor;
|
|
27
|
+
readonly default: 3;
|
|
28
|
+
};
|
|
29
|
+
readonly maxZoom: {
|
|
30
|
+
readonly type: NumberConstructor;
|
|
31
|
+
readonly default: 23;
|
|
32
|
+
};
|
|
33
|
+
readonly extent: {
|
|
34
|
+
readonly type: import("vue").PropType<number[]>;
|
|
35
|
+
};
|
|
36
|
+
readonly extentCRSIsWGS84: {
|
|
37
|
+
readonly type: BooleanConstructor;
|
|
38
|
+
readonly default: false;
|
|
39
|
+
};
|
|
40
|
+
readonly boundary: {
|
|
41
|
+
readonly type: import("vue").PropType<string[]>;
|
|
42
|
+
};
|
|
43
|
+
readonly zIndex: {
|
|
44
|
+
readonly type: NumberConstructor;
|
|
45
|
+
readonly default: 1;
|
|
46
|
+
};
|
|
47
|
+
readonly zIndexTop: {
|
|
48
|
+
readonly type: BooleanConstructor;
|
|
49
|
+
readonly default: false;
|
|
50
|
+
};
|
|
51
|
+
readonly tms: {
|
|
52
|
+
readonly type: BooleanConstructor;
|
|
53
|
+
readonly default: false;
|
|
9
54
|
};
|
|
10
55
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
56
|
readonly visible: {
|
|
12
57
|
readonly type: BooleanConstructor;
|
|
13
58
|
readonly default: true;
|
|
14
59
|
};
|
|
15
|
-
readonly
|
|
16
|
-
readonly type: import("vue").PropType<
|
|
17
|
-
|
|
60
|
+
readonly getTile: {
|
|
61
|
+
readonly type: import("vue").PropType<(info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
62
|
+
};
|
|
63
|
+
readonly useThumbData: {
|
|
64
|
+
readonly type: BooleanConstructor;
|
|
65
|
+
readonly default: false;
|
|
66
|
+
};
|
|
67
|
+
readonly xTemplate: {
|
|
68
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => number>;
|
|
69
|
+
};
|
|
70
|
+
readonly yTemplate: {
|
|
71
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => number>;
|
|
72
|
+
};
|
|
73
|
+
readonly zTemplate: {
|
|
74
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => number>;
|
|
75
|
+
};
|
|
76
|
+
readonly bTemplate: {
|
|
77
|
+
readonly type: import("vue").PropType<(x: number, y: number, z: number) => string>;
|
|
78
|
+
};
|
|
79
|
+
readonly minZoom: {
|
|
80
|
+
readonly type: NumberConstructor;
|
|
81
|
+
readonly default: 3;
|
|
82
|
+
};
|
|
83
|
+
readonly maxZoom: {
|
|
84
|
+
readonly type: NumberConstructor;
|
|
85
|
+
readonly default: 23;
|
|
86
|
+
};
|
|
87
|
+
readonly extent: {
|
|
88
|
+
readonly type: import("vue").PropType<number[]>;
|
|
89
|
+
};
|
|
90
|
+
readonly extentCRSIsWGS84: {
|
|
91
|
+
readonly type: BooleanConstructor;
|
|
92
|
+
readonly default: false;
|
|
93
|
+
};
|
|
94
|
+
readonly boundary: {
|
|
95
|
+
readonly type: import("vue").PropType<string[]>;
|
|
96
|
+
};
|
|
97
|
+
readonly zIndex: {
|
|
98
|
+
readonly type: NumberConstructor;
|
|
99
|
+
readonly default: 1;
|
|
100
|
+
};
|
|
101
|
+
readonly zIndexTop: {
|
|
102
|
+
readonly type: BooleanConstructor;
|
|
103
|
+
readonly default: false;
|
|
104
|
+
};
|
|
105
|
+
readonly tms: {
|
|
106
|
+
readonly type: BooleanConstructor;
|
|
107
|
+
readonly default: false;
|
|
18
108
|
};
|
|
19
109
|
}>> & Readonly<{}>, {
|
|
110
|
+
readonly minZoom: number;
|
|
111
|
+
readonly maxZoom: number;
|
|
20
112
|
readonly visible: boolean;
|
|
21
|
-
readonly
|
|
113
|
+
readonly useThumbData: boolean;
|
|
114
|
+
readonly extentCRSIsWGS84: boolean;
|
|
115
|
+
readonly zIndex: number;
|
|
116
|
+
readonly zIndexTop: boolean;
|
|
117
|
+
readonly tms: boolean;
|
|
22
118
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
119
|
export default _default;
|
package/lib/layer/xyz/src/xyz.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
var tslib_es6 = require('../../../node_modules/.pnpm/@rollup_plugin-typescript@1_b93953ac7ab797e62adf5212a782f0d9/node_modules/tslib/tslib.es6.js');
|
|
5
4
|
var xyzProps = require('./xyz-props.js');
|
|
6
5
|
var useMapInstance = require('../../../_mixins/use-map-instance.js');
|
|
7
6
|
|
|
@@ -11,53 +10,88 @@ var xyz = /* @__PURE__ */ vue.defineComponent({
|
|
|
11
10
|
setup(props) {
|
|
12
11
|
const mapInstance = useMapInstance();
|
|
13
12
|
let layer = null;
|
|
14
|
-
const
|
|
13
|
+
const setZIndex = (zIndex) => {
|
|
14
|
+
layer === null || layer === void 0 ? void 0 : layer.setZIndex(zIndex);
|
|
15
|
+
};
|
|
16
|
+
const setBoundary = (boundary) => {
|
|
17
|
+
boundary && !boundary.length ? layer === null || layer === void 0 ? void 0 : layer.addBoundary(boundary) : layer === null || layer === void 0 ? void 0 : layer.clearBoundary();
|
|
18
|
+
};
|
|
19
|
+
const setZIndexTop = (zIndexTop) => {
|
|
20
|
+
zIndexTop && (layer === null || layer === void 0 ? void 0 : layer.setZIndexTop());
|
|
21
|
+
};
|
|
22
|
+
const initLayerOptions = () => {
|
|
15
23
|
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const key = this.getTileKey(tileInfo);
|
|
22
|
-
const handleImageLoad = (image) => {
|
|
23
|
-
image.tileInfo = tileInfo;
|
|
24
|
-
callback && callback(image, key);
|
|
25
|
-
};
|
|
26
|
-
const handleError = () => callback && callback(null, key);
|
|
27
|
-
getTile(tileInfo, (img) => {
|
|
28
|
-
if (typeof img === "string" || img instanceof HTMLCanvasElement) {
|
|
29
|
-
const image = new Image();
|
|
30
|
-
image.crossOrigin = "anonymous";
|
|
31
|
-
image.onload = () => handleImageLoad(image);
|
|
32
|
-
image.onerror = handleError;
|
|
33
|
-
image.src = typeof img === "string" ? img : img.toDataURL();
|
|
34
|
-
} else if (img instanceof HTMLImageElement) {
|
|
35
|
-
handleImageLoad(img);
|
|
36
|
-
} else {
|
|
37
|
-
handleError();
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
} else {
|
|
42
|
-
mapInstance().addTileLayer(layer2);
|
|
43
|
-
}
|
|
24
|
+
zIndex,
|
|
25
|
+
zIndexTop
|
|
26
|
+
} = props;
|
|
27
|
+
setZIndex(zIndex);
|
|
28
|
+
setZIndexTop(zIndexTop);
|
|
44
29
|
};
|
|
45
|
-
const
|
|
46
|
-
|
|
30
|
+
const startWatchProps = () => {
|
|
31
|
+
vue.watch(() => props.zIndex, setZIndex);
|
|
32
|
+
vue.watch(() => props.boundary, setBoundary);
|
|
47
33
|
};
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
const init = () => {
|
|
35
|
+
const {
|
|
36
|
+
visible,
|
|
37
|
+
getTile,
|
|
38
|
+
xTemplate,
|
|
39
|
+
yTemplate,
|
|
40
|
+
zTemplate,
|
|
41
|
+
bTemplate,
|
|
42
|
+
minZoom,
|
|
43
|
+
maxZoom,
|
|
44
|
+
extent,
|
|
45
|
+
extentCRSIsWGS84,
|
|
46
|
+
boundary,
|
|
47
|
+
useThumbData,
|
|
48
|
+
tms
|
|
49
|
+
} = props;
|
|
50
|
+
layer = new BMapGL.XYZLayer({
|
|
51
|
+
xTemplate,
|
|
52
|
+
yTemplate,
|
|
53
|
+
zTemplate,
|
|
54
|
+
bTemplate,
|
|
55
|
+
minZoom,
|
|
56
|
+
maxZoom,
|
|
57
|
+
extent,
|
|
58
|
+
extentCRSIsWGS84,
|
|
59
|
+
boundary,
|
|
60
|
+
useThumbData,
|
|
61
|
+
tms
|
|
62
|
+
});
|
|
63
|
+
initLayerOptions();
|
|
64
|
+
if (visible) {
|
|
65
|
+
if (getTile) {
|
|
66
|
+
mapInstance().addTileLayer(layer);
|
|
67
|
+
layer.loadRasterTileData = function(tileInfo, callback) {
|
|
68
|
+
const key = this.getTileKey(tileInfo);
|
|
69
|
+
const handleImageLoad = (image) => {
|
|
70
|
+
image.tileInfo = tileInfo;
|
|
71
|
+
callback && callback(image, key);
|
|
72
|
+
};
|
|
73
|
+
const handleError = () => callback && callback(null, key);
|
|
74
|
+
getTile(tileInfo, (img) => {
|
|
75
|
+
if (typeof img === "string" || img instanceof HTMLCanvasElement) {
|
|
76
|
+
const image = new Image();
|
|
77
|
+
image.crossOrigin = "anonymous";
|
|
78
|
+
image.onload = () => handleImageLoad(image);
|
|
79
|
+
image.onerror = handleError;
|
|
80
|
+
image.src = typeof img === "string" ? img : img.toDataURL();
|
|
81
|
+
} else if (img instanceof HTMLImageElement) {
|
|
82
|
+
handleImageLoad(img);
|
|
83
|
+
} else {
|
|
84
|
+
handleError();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
} else {
|
|
89
|
+
mapInstance().addTileLayer(layer);
|
|
90
|
+
}
|
|
51
91
|
}
|
|
52
|
-
|
|
53
|
-
getTile
|
|
54
|
-
} = _a, retProps = tslib_es6.__rest(_a, ["getTile"]);
|
|
55
|
-
layer = new BMapGL.XYZLayer(retProps);
|
|
56
|
-
addTileLayer(layer);
|
|
92
|
+
startWatchProps();
|
|
57
93
|
};
|
|
58
|
-
|
|
59
|
-
vue.watch(() => props.visible, (n) => layer && (n ? addTileLayer(layer) : removeTileLayer(layer)));
|
|
60
|
-
vue.watch(() => props.options, () => createLayer());
|
|
94
|
+
init();
|
|
61
95
|
vue.onUnmounted(() => {
|
|
62
96
|
if (layer) {
|
|
63
97
|
mapInstance().removeTileLayer(layer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xyz.js","sources":["../../../../src/layer/xyz/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/xyz/src/xyz.tsx"],"sourcesContent":["import { defineComponent, onUnmounted, watch } from 'vue'\r\nimport { useMapInstance } from '../../../_mixins'\r\nimport { xyzLayerProps } from './xyz-props'\r\n\r\nexport default defineComponent({\r\n name: 'XyzLayer',\r\n props: xyzLayerProps,\r\n setup(props) {\r\n const mapInstance = useMapInstance()\r\n\r\n let layer: BMapGL.XYZLayer | null = null\r\n\r\n const
|
|
1
|
+
{"version":3,"file":"xyz.js","sources":["../../../../src/layer/xyz/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/xyz/src/xyz.tsx"],"sourcesContent":["import { defineComponent, onUnmounted, watch } from 'vue'\r\nimport { useMapInstance } from '../../../_mixins'\r\nimport { xyzLayerProps } from './xyz-props'\r\n\r\nexport default defineComponent({\r\n name: 'XyzLayer',\r\n props: xyzLayerProps,\r\n setup(props) {\r\n const mapInstance = useMapInstance()\r\n\r\n let layer: BMapGL.XYZLayer | null = null\r\n\r\n const setZIndex = (zIndex: number) => {\r\n layer?.setZIndex(zIndex)\r\n }\r\n\r\n const setBoundary = (boundary?: string[]) => {\r\n boundary && !boundary.length ? layer?.addBoundary(boundary) : layer?.clearBoundary()\r\n }\r\n\r\n const setZIndexTop = (zIndexTop?: boolean) => {\r\n zIndexTop && layer?.setZIndexTop()\r\n }\r\n\r\n const initLayerOptions = () => {\r\n const { zIndex, zIndexTop } = props\r\n setZIndex(zIndex)\r\n setZIndexTop(zIndexTop)\r\n }\r\n\r\n const startWatchProps = () => {\r\n watch(() => props.zIndex, setZIndex)\r\n watch(() => props.boundary, setBoundary)\r\n }\r\n\r\n const init = () => {\r\n const { visible, getTile, xTemplate, yTemplate, zTemplate, bTemplate, minZoom, maxZoom, extent, extentCRSIsWGS84, boundary, useThumbData, tms } = props\r\n layer = new BMapGL.XYZLayer({\r\n xTemplate,\r\n yTemplate,\r\n zTemplate,\r\n bTemplate,\r\n minZoom,\r\n maxZoom,\r\n extent: extent as any,\r\n extentCRSIsWGS84,\r\n boundary,\r\n useThumbData,\r\n tms,\r\n })\r\n initLayerOptions()\r\n if (visible) {\r\n if (getTile) {\r\n mapInstance().addTileLayer(layer)\r\n ;(layer as any).loadRasterTileData = function (tileInfo: any, callback: any) {\r\n const key = this.getTileKey(tileInfo)\r\n\r\n const handleImageLoad = (image: HTMLImageElement) => {\r\n (image as any).tileInfo = tileInfo\r\n callback && callback(image, key)\r\n }\r\n\r\n const handleError = () => callback && callback(null, key)\r\n\r\n getTile(tileInfo, (img) => {\r\n if (typeof img === 'string' || img instanceof HTMLCanvasElement) {\r\n const image = new Image()\r\n image.crossOrigin = 'anonymous'\r\n\r\n image.onload = () => handleImageLoad(image)\r\n image.onerror = handleError\r\n\r\n image.src = typeof img === 'string' ? img : img.toDataURL()\r\n } else if (img instanceof HTMLImageElement) {\r\n handleImageLoad(img)\r\n } else {\r\n handleError()\r\n }\r\n })\r\n }\r\n } else {\r\n mapInstance().addTileLayer(layer)\r\n }\r\n }\r\n startWatchProps()\r\n }\r\n\r\n init()\r\n\r\n // const addTileLayer = (layer: BMapGL.XYZLayer) => {\r\n // const { getTile } = props.options\r\n // if (getTile) {\r\n // mapInstance().addTileLayer(layer)\r\n // ;(layer as any).loadRasterTileData = function (tileInfo: any, callback: any) {\r\n // const key = this.getTileKey(tileInfo)\r\n\r\n // const handleImageLoad = (image: HTMLImageElement) => {\r\n // (image as any).tileInfo = tileInfo\r\n // callback && callback(image, key)\r\n // }\r\n\r\n // const handleError = () => callback && callback(null, key)\r\n\r\n // getTile(tileInfo, (img) => {\r\n // if (typeof img === 'string' || img instanceof HTMLCanvasElement) {\r\n // const image = new Image()\r\n // image.crossOrigin = 'anonymous'\r\n\r\n // image.onload = () => handleImageLoad(image)\r\n // image.onerror = handleError\r\n\r\n // image.src = typeof img === 'string' ? img : img.toDataURL()\r\n // } else if (img instanceof HTMLImageElement) {\r\n // handleImageLoad(img)\r\n // } else {\r\n // handleError()\r\n // }\r\n // })\r\n // }\r\n // } else {\r\n // mapInstance().addTileLayer(layer)\r\n // }\r\n // }\r\n\r\n // const removeTileLayer = (layer: BMapGL.XYZLayer) => {\r\n // mapInstance().removeTileLayer(layer)\r\n // }\r\n\r\n // const createLayer = () => {\r\n // if (layer) {\r\n // removeTileLayer(layer)\r\n // }\r\n // const { getTile, ...retProps } = props\r\n // layer = new BMapGL.XYZLayer(retProps)\r\n // addTileLayer(layer)\r\n // }\r\n\r\n // props.visible && createLayer()\r\n\r\n // watch(() => props.visible, n => layer && (n ? addTileLayer(layer) : removeTileLayer(layer)))\r\n // watch(() => props.options, () => createLayer())\r\n\r\n onUnmounted(() => {\r\n if (layer) {\r\n mapInstance().removeTileLayer(layer)\r\n }\r\n })\r\n\r\n return () => <></>\r\n },\r\n})\r\n"],"names":["name","props","xyzLayerProps","setup","mapInstance","useMapInstance","layer","setZIndex","zIndex","setBoundary","boundary","length","addBoundary","clearBoundary","setZIndexTop","zIndexTop","initLayerOptions","startWatchProps","watch","init","visible","getTile","xTemplate","yTemplate","zTemplate","bTemplate","minZoom","maxZoom","extent","extentCRSIsWGS84","useThumbData","tms","BMapGL","XYZLayer","addTileLayer","loadRasterTileData","tileInfo","callback","key","getTileKey","handleImageLoad","image","handleError","img","HTMLCanvasElement","Image","crossOrigin","onload","onerror","src","toDataURL","HTMLImageElement","onUnmounted","removeTileLayer","_createVNode","_Fragment"],"mappings":";;;;;;AAIA,8CAA+B;AAAA,EAC7BA,IAAAA,EAAM,UAAA;AAAA,EACNC,KAAAA,EAAOC,sBAAAA;AAAAA,EACPC,MAAMF,KAAAA,EAAK;AACT,IAAA,MAAMG,cAAcC,cAAAA,EAAc;AAElC,IAAA,IAAIC,KAAAA,GAAgC,IAAA;AAEpC,IAAA,MAAMC,YAAaC,CAAAA,MAAAA,KAAkB;AACnCF,MAAAA,KAAAA,KAAK,QAALA,KAAAA,KAAK,MAAA,GAAA,MAAA,GAALA,KAAAA,CAAOC,UAAUC,MAAM,CAAA;AAAA,IACzB,CAAA;AAEA,IAAA,MAAMC,cAAeC,CAAAA,QAAAA,KAAuB;AAC1CA,MAAAA,QAAAA,IAAY,CAACA,QAAAA,CAASC,MAAAA,GAASL,UAAK,IAAA,IAALA,KAAAA,KAAK,SAAA,MAAA,GAALA,KAAAA,CAAOM,WAAAA,CAAYF,QAAQ,IAAIJ,KAAAA,KAAK,IAAA,IAALA,UAAK,MAAA,GAAA,MAAA,GAALA,MAAOO,aAAAA;IACvE,CAAA;AAEA,IAAA,MAAMC,eAAgBC,CAAAA,SAAAA,KAAuB;AAC3CA,MAAAA,SAAAA,KAAaT,UAAK,IAAA,IAALA,KAAAA,KAAK,MAAA,GAAA,MAAA,GAALA,MAAOQ,YAAAA,EAAY,CAAA;AAAA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AAA,eAAAA,CAAY,MAAK;AACf,MAAA,IAAI9C,KAAAA,EAAO;AACTF,QAAAA,WAAAA,GAAciD,gBAAgB/C,KAAK,CAAA;AAAA,MACrC;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAO,MAAAgD,eAAAA,CAAAC,YAAAA,EAAA,IAAA,EAAA,IAAA,CAAA;AAAA,EACT;AACD,CAAA,CAAA;;;;"}
|
|
@@ -2,67 +2,23 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
3
3
|
import type { onInitd } from './interface';
|
|
4
4
|
export declare const mapProps: {
|
|
5
|
-
readonly maxZoom:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly
|
|
10
|
-
readonly type: NumberConstructor;
|
|
11
|
-
readonly default: 0;
|
|
12
|
-
};
|
|
13
|
-
readonly heading: {
|
|
14
|
-
readonly type: NumberConstructor;
|
|
15
|
-
readonly default: 0;
|
|
16
|
-
};
|
|
17
|
-
readonly center: {
|
|
18
|
-
readonly type: PropType<BMapGL.Point | string | [number, number]>;
|
|
19
|
-
readonly default: readonly [116.403901, 39.915185];
|
|
20
|
-
};
|
|
21
|
-
readonly zoom: {
|
|
22
|
-
readonly type: NumberConstructor;
|
|
23
|
-
readonly default: 14;
|
|
24
|
-
};
|
|
5
|
+
readonly maxZoom: NumberConstructor;
|
|
6
|
+
readonly minZoom: NumberConstructor;
|
|
7
|
+
readonly heading: NumberConstructor;
|
|
8
|
+
readonly center: PropType<BMapGL.Point | string | [number, number]>;
|
|
9
|
+
readonly zoom: NumberConstructor;
|
|
25
10
|
readonly class: StringConstructor;
|
|
26
11
|
readonly contentClass: StringConstructor;
|
|
27
|
-
readonly enableScrollWheelZoom:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
readonly default: 0;
|
|
38
|
-
};
|
|
39
|
-
readonly enableTilt: {
|
|
40
|
-
readonly type: BooleanConstructor;
|
|
41
|
-
readonly default: false;
|
|
42
|
-
};
|
|
43
|
-
readonly mapType: {
|
|
44
|
-
readonly type: PropType<BMapGL.MapTypeId>;
|
|
45
|
-
readonly default: "BMAP_NORMAL_MAP";
|
|
46
|
-
};
|
|
47
|
-
readonly enableAutoResize: {
|
|
48
|
-
readonly type: BooleanConstructor;
|
|
49
|
-
readonly default: true;
|
|
50
|
-
};
|
|
51
|
-
readonly enableTiltGestures: {
|
|
52
|
-
readonly type: BooleanConstructor;
|
|
53
|
-
readonly default: false;
|
|
54
|
-
};
|
|
55
|
-
readonly enableRotate: {
|
|
56
|
-
readonly type: BooleanConstructor;
|
|
57
|
-
readonly default: false;
|
|
58
|
-
};
|
|
59
|
-
readonly enableRotateGestures: {
|
|
60
|
-
readonly type: BooleanConstructor;
|
|
61
|
-
readonly default: false;
|
|
62
|
-
};
|
|
63
|
-
readonly displayOptions: {
|
|
64
|
-
readonly type: PropType<BMapGL.displayOptions>;
|
|
65
|
-
};
|
|
12
|
+
readonly enableScrollWheelZoom: BooleanConstructor;
|
|
13
|
+
readonly enableDragging: BooleanConstructor;
|
|
14
|
+
readonly tilt: NumberConstructor;
|
|
15
|
+
readonly enableTilt: BooleanConstructor;
|
|
16
|
+
readonly mapType: PropType<BMapGL.MapTypeId>;
|
|
17
|
+
readonly enableAutoResize: BooleanConstructor;
|
|
18
|
+
readonly enableTiltGestures: BooleanConstructor;
|
|
19
|
+
readonly enableRotate: BooleanConstructor;
|
|
20
|
+
readonly enableRotateGestures: BooleanConstructor;
|
|
21
|
+
readonly displayOptions: PropType<BMapGL.displayOptions>;
|
|
66
22
|
readonly onInitd: PropType<onInitd>;
|
|
67
23
|
};
|
|
68
24
|
export type MapProps = ExtractPublicPropTypes<typeof mapProps>;
|