@spuermomonga/vue3-bmapgl 0.0.8 → 0.0.9
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 +35 -9
- package/dist/index.prod.js +1 -1
- package/es/layer/tile/src/tile-props.mjs +2 -0
- package/es/layer/tile/src/tile-props.mjs.map +1 -0
- package/es/layer/tile/src/tile.mjs +2 -2
- package/es/layer/tile/src/tile.mjs.map +1 -1
- package/es/layer/xyz/src/xyz-props.d.ts +7 -1
- package/es/layer/xyz/src/xyz-props.mjs.map +1 -1
- package/es/layer/xyz/src/xyz.d.ts +2 -2
- package/es/layer/xyz/src/xyz.mjs +6 -1
- package/es/layer/xyz/src/xyz.mjs.map +1 -1
- package/es/map/src/map-props.d.ts +28 -7
- package/es/map/src/map-props.mjs +28 -7
- package/es/map/src/map-props.mjs.map +1 -1
- package/es/map/src/map.d.ts +56 -14
- package/lib/layer/tile/src/tile-props.js +3 -0
- package/lib/layer/tile/src/tile-props.js.map +1 -0
- package/lib/layer/tile/src/tile.js +1 -1
- package/lib/layer/tile/src/tile.js.map +1 -1
- package/lib/layer/xyz/src/xyz-props.d.ts +7 -1
- package/lib/layer/xyz/src/xyz-props.js.map +1 -1
- package/lib/layer/xyz/src/xyz.d.ts +2 -2
- package/lib/layer/xyz/src/xyz.js +6 -1
- package/lib/layer/xyz/src/xyz.js.map +1 -1
- package/lib/map/src/map-props.d.ts +28 -7
- package/lib/map/src/map-props.js +28 -7
- package/lib/map/src/map-props.js.map +1 -1
- package/lib/map/src/map.d.ts +56 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
var tile = /* @__PURE__ */ vue.defineComponent({
|
|
118
118
|
name: "TileLayer",
|
|
119
119
|
setup() {
|
|
120
|
-
return () => vue.createVNode(
|
|
120
|
+
return () => vue.createVNode(vue.Fragment, null, null);
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
|
|
@@ -158,15 +158,36 @@
|
|
|
158
158
|
zoom: Number,
|
|
159
159
|
class: String,
|
|
160
160
|
contentClass: String,
|
|
161
|
-
enableScrollWheelZoom:
|
|
162
|
-
|
|
161
|
+
enableScrollWheelZoom: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: void 0
|
|
164
|
+
},
|
|
165
|
+
enableDragging: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: void 0
|
|
168
|
+
},
|
|
163
169
|
tilt: Number,
|
|
164
|
-
enableTilt:
|
|
170
|
+
enableTilt: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: void 0
|
|
173
|
+
},
|
|
165
174
|
mapType: String,
|
|
166
|
-
enableAutoResize:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
175
|
+
enableAutoResize: {
|
|
176
|
+
type: Boolean,
|
|
177
|
+
default: void 0
|
|
178
|
+
},
|
|
179
|
+
enableTiltGestures: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: void 0
|
|
182
|
+
},
|
|
183
|
+
enableRotate: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: void 0
|
|
186
|
+
},
|
|
187
|
+
enableRotateGestures: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: void 0
|
|
190
|
+
},
|
|
170
191
|
displayOptions: Object,
|
|
171
192
|
onInitd: Function
|
|
172
193
|
};
|
|
@@ -461,7 +482,12 @@
|
|
|
461
482
|
callback && callback(image, key);
|
|
462
483
|
};
|
|
463
484
|
const handleError = () => callback && callback(null, key);
|
|
464
|
-
|
|
485
|
+
const box = BMapGL.XYZProjection.getTileRangeExtent([tileInfo.zoom, tileInfo.col, tileInfo.row]);
|
|
486
|
+
getTile({
|
|
487
|
+
x: tileInfo.col,
|
|
488
|
+
y: tileInfo.row,
|
|
489
|
+
z: tileInfo.zoom
|
|
490
|
+
}, box, (img) => {
|
|
465
491
|
if (typeof img === "string" || img instanceof HTMLCanvasElement) {
|
|
466
492
|
const image = new Image();
|
|
467
493
|
image.crossOrigin = "anonymous";
|
package/dist/index.prod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Vue3Bmapgl={},e.vue)}(this,function(e,t){"use strict";let a=!1;function o(e){return e.some(e=>!t.isVNode(e)||e.type!==Comment&&!(e.type===t.Fragment&&!o(e.children)))?e:null}function n(e,t){return t(e&&o(e())||null)}const l={ak:String,apiUrl:String,plugins:Array,mapConfig:Object},r=Symbol("b-config-provider");var i=t.defineComponent({name:"ConfigProvider",props:l,setup(e,{slots:o}){const n=t.ref("notload"),l=e.apiUrl?"_initBMap_":`_initBMap_${e.ak}`,i=e.apiUrl?`${e.apiUrl.replace(/&$/,"")}&callback=${l}`:`//api.map.baidu.com/api?type=webgl&v=1.0&ak=${e.ak}&callback=${l}`;n.value="pending",function(e){const{key:t,src:o,addCalToWindow:n=!0,timeout:l=1e4}=e;return a&&window.BMapGL?Promise.resolve():new Promise((e,r)=>{const i=document.createElement("script");i.src=o,i.type="text/javascript",i.defer=!0;const s=()=>{i.onload=null,i.onerror=null,document.body.contains(i)&&document.body.removeChild(i)},
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Vue3Bmapgl={},e.vue)}(this,function(e,t){"use strict";let a=!1;function o(e){return e.some(e=>!t.isVNode(e)||e.type!==Comment&&!(e.type===t.Fragment&&!o(e.children)))?e:null}function n(e,t){return t(e&&o(e())||null)}const l={ak:String,apiUrl:String,plugins:Array,mapConfig:Object},r=Symbol("b-config-provider");var i=t.defineComponent({name:"ConfigProvider",props:l,setup(e,{slots:o}){const n=t.ref("notload"),l=e.apiUrl?"_initBMap_":`_initBMap_${e.ak}`,i=e.apiUrl?`${e.apiUrl.replace(/&$/,"")}&callback=${l}`:`//api.map.baidu.com/api?type=webgl&v=1.0&ak=${e.ak}&callback=${l}`;n.value="pending",function(e){const{key:t,src:o,addCalToWindow:n=!0,timeout:l=1e4}=e;return a&&window.BMapGL?Promise.resolve():new Promise((e,r)=>{const i=document.createElement("script");i.src=o,i.type="text/javascript",i.defer=!0;const s=()=>{i.onload=null,i.onerror=null,document.body.contains(i)&&document.body.removeChild(i)},d=setTimeout(()=>{s(),r(new Error(`Script load timeout: ${o}`))},l),p=()=>{clearTimeout(d),a=!0,s(),e()};n?window[t]=p:i.onload=p,i.onerror=()=>{clearTimeout(d),s(),r(new Error(`Failed to load script: ${o}`))},document.body.appendChild(i)})}({key:l,src:i}).then(()=>{n.value="loaded"}).catch(()=>{n.value="failed"});const s=t.computed(()=>{const{mapConfig:t}=e;return t??{}});return t.provide(r,{mergedStatusRef:n,mergedMapSetRef:s}),()=>t.renderSlot(o,"default")}}),s=t.defineComponent({name:"TileLayer",setup:()=>()=>t.createVNode(t.Fragment,null,null)});const d=Symbol("b-map"),p={maxZoom:Number,minZoom:Number,heading:Number,center:Object,zoom:Number,class:String,contentClass:String,enableScrollWheelZoom:{type:Boolean,default:void 0},enableDragging:{type:Boolean,default:void 0},tilt:Number,enableTilt:{type:Boolean,default:void 0},mapType:String,enableAutoResize:{type:Boolean,default:void 0},enableTiltGestures:{type:Boolean,default:void 0},enableRotate:{type:Boolean,default:void 0},enableRotateGestures:{type:Boolean,default:void 0},displayOptions:Object,onInitd:Function};var m="map-module_b-map__29r3m",u="map-module_b-map-content__sMaJG",c="map-module_b-map-loading__qc4a8",f="map-module_b-map-failed__-w-tX";!function(e,t){void 0===t&&(t={});var a=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===a&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".map-module_b-map-content__sMaJG,.map-module_b-map__29r3m{height:100%;overflow:hidden;position:relative;width:100%}.map-module_b-map-failed__-w-tX,.map-module_b-map-loading__qc4a8{color:#999;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}");var y=t.defineComponent({name:"Map",props:p,slots:Object,setup(e,{slots:a}){const{mergedMapSetRef:o,mergedStatusRef:l}=function(e={}){const a=t.inject(r,null);return{mergedStatusRef:a?.mergedStatusRef,mergedMapSetRef:t.computed(()=>{const{zoom:t,center:o,heading:n,minZoom:l,maxZoom:r,enableScrollWheelZoom:i,enableDragging:s,tilt:d,enableTilt:p,mapType:m,enableAutoResize:u,enableTiltGestures:c,enableRotate:f,enableRotateGestures:y,displayOptions:g}=e;return{zoom:t??a?.mergedMapSetRef.value?.zoom??14,center:o??a?.mergedMapSetRef.value?.center??[116.403901,39.915185],heading:n??a?.mergedMapSetRef.value?.heading??0,minZoom:l??a?.mergedMapSetRef.value?.minZoom??0,maxZoom:r??a?.mergedMapSetRef.value?.maxZoom??21,enableScrollWheelZoom:i??a?.mergedMapSetRef.value?.enableScrollWheelZoom??!1,enableDragging:s??a?.mergedMapSetRef.value?.enableDragging??!0,tilt:d??a?.mergedMapSetRef.value?.tilt??0,enableTilt:p??a?.mergedMapSetRef.value?.enableTilt??!1,mapType:m??a?.mergedMapSetRef.value?.mapType??"BMAP_NORMAL_MAP",enableAutoResize:u??a?.mergedMapSetRef.value?.enableAutoResize??!0,enableTiltGestures:c??a?.mergedMapSetRef.value?.enableTiltGestures??!1,enableRotate:f??a?.mergedMapSetRef.value?.enableRotate??!1,enableRotateGestures:y??a?.mergedMapSetRef.value?.enableRotateGestures??!1,displayOptions:g??a?.mergedMapSetRef.value?.displayOptions}})}}(e),i=t.ref();let s=null;const p=t.ref(!1);t.provide(d,{mapInstance:()=>s});const y=e=>{"string"==typeof e?s?.centerAndZoom(e,o.value.zoom):Array.isArray(e)?s?.centerAndZoom(new BMapGL.Point(e[0],e[1]),o.value.zoom):s?.centerAndZoom(e,o.value.zoom)},g=e=>{e?s.enableScrollWheelZoom():s.disableScrollWheelZoom()},b=e=>{s?.setDisplayOptions(e||{})},v=e=>{s?.setTilt(e??0)},T=e=>{s?.setHeading(e??0)},h=e=>{e?s.enableDragging():s.disableDragging()},S=e=>{void 0!==window[e]&&s.setMapType(window[e])},R=()=>{const{maxZoom:a,minZoom:n,enableTilt:l,mapType:r,enableAutoResize:d,enableTiltGestures:m,enableRotate:u,enableRotateGestures:c,displayOptions:f}=o.value;s=new BMapGL.Map(i.value,{maxZoom:a,minZoom:n,enableTilt:l,mapType:window[r],enableAutoResize:d,enableTiltGestures:m,enableRotate:u,enableRotateGestures:c,displayOptions:f});const{onInitd:R}=e;(()=>{const{center:e,heading:t,enableScrollWheelZoom:a,tilt:n,enableDragging:l}=o.value;T(t),y(e),g(a),v(n),h(l)})(),t.watch(()=>o.value.center,y,{deep:!0}),t.watch(()=>o.value.enableScrollWheelZoom,g),t.watch(()=>o.value.displayOptions,b),t.watch(()=>o.value.tilt,v),t.watch(()=>o.value.heading,T),t.watch(()=>o.value.enableDragging,h),t.watch(()=>o.value.mapType,S),R?.({map:s}),p.value=!0};return t.onMounted(()=>{t.watchEffect(()=>{"loaded"!==l?.value||p.value||t.nextTick(R)})}),t.onUnmounted(()=>{if(s)try{s?.destroy()}catch(e){console.error(`[Vue3 BMapGL]: ${e.message}`)}}),()=>t.createVNode("div",{class:[[m],e.class]},[t.createVNode("div",{ref:i,class:[u,e.contentClass]},["pending"===l?.value&&n(a.loading,()=>t.createVNode("div",{class:[c]},[t.createTextVNode("map loading...")])),"failed"===l?.value&&n(a.failed,()=>t.createVNode("div",{class:[f]},[t.createTextVNode("map failed")]))]),p.value&&a.default?.()])}});function g(){return t.inject(d,null).mapInstance}const b={visible:{type:Boolean,default:!0},getTile:{type:Function},useThumbData:{type:Boolean,default:!1},xTemplate:{type:Function},yTemplate:{type:Function},zTemplate:{type:Function},bTemplate:{type:Function},minZoom:{type:Number,default:3},maxZoom:{type:Number,default:23},extent:{type:Array},extentCRSIsWGS84:{type:Boolean,default:!1},boundary:{type:Array},zIndex:{type:Number,default:1},zIndexTop:{type:Boolean,default:!1},tms:{type:Boolean,default:!1}};var v=t.defineComponent({name:"XyzLayer",props:b,setup(e){const a=g();let o=null;const n=e=>{o?.setZIndex(e)},l=e=>{e&&!e.length?o?.addBoundary(e):o?.clearBoundary()},r=()=>{const{zIndex:t,zIndexTop:a}=e;n(t),(e=>{e&&o?.setZIndexTop()})(a)};return(()=>{const{visible:i,getTile:s,xTemplate:d,yTemplate:p,zTemplate:m,bTemplate:u,minZoom:c,maxZoom:f,extent:y,extentCRSIsWGS84:g,boundary:b,useThumbData:v,tms:T}=e;o=new BMapGL.XYZLayer({xTemplate:d,yTemplate:p,zTemplate:m,bTemplate:u,minZoom:c,maxZoom:f,extent:y,extentCRSIsWGS84:g,boundary:b,useThumbData:v,tms:T}),r(),i&&(s?(a().addTileLayer(o),o.loadRasterTileData=function(e,t){const a=this.getTileKey(e),o=o=>{o.tileInfo=e,t&&t(o,a)},n=()=>t&&t(null,a),l=BMapGL.XYZProjection.getTileRangeExtent([e.zoom,e.col,e.row]);s({x:e.col,y:e.row,z:e.zoom},l,e=>{if("string"==typeof e||e instanceof HTMLCanvasElement){const t=new Image;t.crossOrigin="anonymous",t.onload=()=>o(t),t.onerror=n,t.src="string"==typeof e?e:e.toDataURL()}else e instanceof HTMLImageElement?o(e):n()})}):a().addTileLayer(o)),t.watch(()=>e.zIndex,n),t.watch(()=>e.boundary,l)})(),t.onUnmounted(()=>{o&&a().removeTileLayer(o)}),()=>t.createVNode(t.Fragment,null,null)}});const T={visible:{type:Boolean,default:!0},points:{type:Array},strokeColor:{type:String,default:"#000"},fillColor:{type:String,default:"#fff"},strokeWeight:{type:Number,default:2},strokeOpacity:{type:Number,default:1},fillOpacity:{type:Number,default:.3},strokeStyle:{type:String,default:"solid"},enableMassClear:{type:Boolean,default:!0},enableEditing:{type:Boolean,default:!1},isBoundary:{type:Boolean},enableClicking:{type:Boolean,default:!0}};var h=t.defineComponent({name:"Polygon",props:T,setup:e=>{const a=g();let o=null;const n=e=>{o&&o.setStrokeColor(e)};return(()=>{const{points:l,visible:r,strokeColor:i,fillColor:s,strokeWeight:d,strokeOpacity:p,fillOpacity:m,strokeStyle:u,enableMassClear:c,enableEditing:f,enableClicking:y}=e;l&&l.length&&(o=new BMapGL.Polygon(function(e){if(!e||0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>new BMapGL.Point(e,t)):e}(l),{strokeColor:i,fillColor:s,strokeWeight:d,strokeOpacity:p,fillOpacity:m,strokeStyle:u,enableMassClear:c,enableEditing:f,enableClicking:y}),r&&a().addOverlay(o),t.watch(()=>e.strokeColor,n),t.watch(()=>e.visible,e=>{a()[e?"addOverlay":"removeOverlay"](o)}))})(),t.onUnmounted(()=>{o&&a().removeOverlay(o)}),()=>t.createVNode(t.Fragment,null,null)}}),S=t.defineComponent({name:"Sector",setup:()=>()=>t.createVNode(t.Fragment,null,null)});e.BConfigProvider=i,e.BMap=y,e.BPolygon=h,e.BSector=S,e.BTileLayer=s,e.BXyzLayer=v,e.configProviderInjectionKey=r,e.configProviderProps=l,e.create=function({componentPrefix:e="B",components:t=[]}={}){const a=[];function o(t,a,o){t.component(e+a)||t.component(e+a,o)}return{componentPrefix:e,install:function(e){a.includes(e)||(a.push(e),t.forEach(t=>{const{name:a,alias:n}=t;o(e,a,t),n&&n.forEach(a=>{o(e,a,t)})}))}}},e.mapInjectionKey=d,e.mapProps=p,e.polygonProps=T,e.xyzLayerProps=b});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-props.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent, createVNode,
|
|
1
|
+
import { defineComponent, createVNode, Fragment } from 'vue';
|
|
2
2
|
|
|
3
3
|
var tile = /* @__PURE__ */ defineComponent({
|
|
4
4
|
name: "TileLayer",
|
|
5
5
|
setup() {
|
|
6
|
-
return () => createVNode(
|
|
6
|
+
return () => createVNode(Fragment, null, null);
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile.mjs","sources":["../../../../src/layer/tile/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/tile/src/tile.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\r\n\r\nexport default defineComponent({\r\n name: 'TileLayer',\r\n setup() {\r\n return () =>
|
|
1
|
+
{"version":3,"file":"tile.mjs","sources":["../../../../src/layer/tile/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/tile/src/tile.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\r\n\r\nexport default defineComponent({\r\n name: 'TileLayer',\r\n setup() {\r\n return () => <></>\r\n },\r\n})\r\n"],"names":["name","setup","_createVNode","_Fragment"],"mappings":";;AAEA,2CAA+B;AAAA,EAC7BA,IAAAA,EAAM,WAAA;AAAA,EACNC,KAAAA,GAAK;AACH,IAAA,OAAO,MAAAC,WAAAA,CAAAC,QAAAA,EAAA,IAAA,EAAA,IAAA,CAAA;AAAA,EACT;AACD,CAAA,CAAA;;;;"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { ExtractPublicPropTypes } from '../../../_utils';
|
|
3
|
+
export interface Box {
|
|
4
|
+
minX: number;
|
|
5
|
+
minY: number;
|
|
6
|
+
maxX: number;
|
|
7
|
+
maxY: number;
|
|
8
|
+
}
|
|
3
9
|
type TemplateFn = (x: number, y: number, z: number) => number;
|
|
4
10
|
type BTemplateFn = (x: number, y: number, z: number) => string;
|
|
5
|
-
type GetTile = (info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void;
|
|
11
|
+
type GetTile = (info: any, box: Box, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void;
|
|
6
12
|
export declare const xyzLayerProps: {
|
|
7
13
|
readonly visible: {
|
|
8
14
|
readonly type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xyz-props.mjs","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":"
|
|
1
|
+
{"version":3,"file":"xyz-props.mjs","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\nexport interface Box {\r\n minX: number\r\n minY: number\r\n maxX: number\r\n maxY: number\r\n}\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, box: Box, 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":"AAcO,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;;;;;"}
|
|
@@ -4,7 +4,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4
4
|
readonly default: true;
|
|
5
5
|
};
|
|
6
6
|
readonly getTile: {
|
|
7
|
-
readonly type: import("vue").PropType<(info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
7
|
+
readonly type: import("vue").PropType<(info: any, box: import("./xyz-props").Box, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
8
8
|
};
|
|
9
9
|
readonly useThumbData: {
|
|
10
10
|
readonly type: BooleanConstructor;
|
|
@@ -58,7 +58,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
58
58
|
readonly default: true;
|
|
59
59
|
};
|
|
60
60
|
readonly getTile: {
|
|
61
|
-
readonly type: import("vue").PropType<(info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
61
|
+
readonly type: import("vue").PropType<(info: any, box: import("./xyz-props").Box, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
62
62
|
};
|
|
63
63
|
readonly useThumbData: {
|
|
64
64
|
readonly type: BooleanConstructor;
|
package/es/layer/xyz/src/xyz.mjs
CHANGED
|
@@ -69,7 +69,12 @@ var xyz = /* @__PURE__ */ defineComponent({
|
|
|
69
69
|
callback && callback(image, key);
|
|
70
70
|
};
|
|
71
71
|
const handleError = () => callback && callback(null, key);
|
|
72
|
-
|
|
72
|
+
const box = BMapGL.XYZProjection.getTileRangeExtent([tileInfo.zoom, tileInfo.col, tileInfo.row]);
|
|
73
|
+
getTile({
|
|
74
|
+
x: tileInfo.col,
|
|
75
|
+
y: tileInfo.row,
|
|
76
|
+
z: tileInfo.zoom
|
|
77
|
+
}, box, (img) => {
|
|
73
78
|
if (typeof img === "string" || img instanceof HTMLCanvasElement) {
|
|
74
79
|
const image = new Image();
|
|
75
80
|
image.crossOrigin = "anonymous";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xyz.mjs","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,0CAA+B;AAAA,EAC7BA,IAAAA,EAAM,UAAA;AAAA,EACNC,KAAAA,EAAOC,aAAAA;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,IAClC,CAAA;AAEA,IAAA,MAAME,mBAAmBA,MAAK;AAC5B,MAAA,MAAM;AAAA,QAAER,MAAAA;AAAAA,Q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A,GAAM,IAAA,CAAKC,UAAAA,CAAWH,QAAQ,CAAA;AAEpC,YAAA,MAAMI,kBAAmBC,CAAAA,KAAAA,KAA2B;AACjDA,cAAAA,KAAAA,CAAcL,QAAAA,GAAWA,QAAAA;AAC1BC,cAAAA,QAAAA,IAAYA,QAAAA,CAASI,OAAOH,GAAG,CAAA;AAAA,YACjC,CAAA;AAEA,YAAA,MAAMI,WAAAA,GAAcA,MAAML,QAAAA,IAAYA,QAAAA,CAAS,MAAMC,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"xyz.mjs","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 const box = (BMapGL as any).XYZProjection.getTileRangeExtent([tileInfo.zoom, tileInfo.col, tileInfo.row])\r\n\r\n getTile({ x: tileInfo.col, y: tileInfo.row, z: tileInfo.zoom }, box, (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","box","XYZProjection","getTileRangeExtent","zoom","col","row","x","y","z","img","HTMLCanvasElement","Image","crossOrigin","onload","onerror","src","toDataURL","HTMLImageElement","onUnmounted","removeTileLayer","_createVNode","_Fragment"],"mappings":";;;;AAIA,0CAA+B;AAAA,EAC7BA,IAAAA,EAAM,UAAA;AAAA,EACNC,KAAAA,EAAOC,aAAAA;AAAAA,EACPC,MAAMF,KAAAA,EAAK;AACT,IAAA,MAAMG,cAAcC,cAAAA,EAAc;AAElC,I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
@@ -9,15 +9,36 @@ export declare const mapProps: {
|
|
|
9
9
|
readonly zoom: NumberConstructor;
|
|
10
10
|
readonly class: StringConstructor;
|
|
11
11
|
readonly contentClass: StringConstructor;
|
|
12
|
-
readonly enableScrollWheelZoom:
|
|
13
|
-
|
|
12
|
+
readonly enableScrollWheelZoom: {
|
|
13
|
+
readonly type: BooleanConstructor;
|
|
14
|
+
readonly default: undefined;
|
|
15
|
+
};
|
|
16
|
+
readonly enableDragging: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: undefined;
|
|
19
|
+
};
|
|
14
20
|
readonly tilt: NumberConstructor;
|
|
15
|
-
readonly enableTilt:
|
|
21
|
+
readonly enableTilt: {
|
|
22
|
+
readonly type: BooleanConstructor;
|
|
23
|
+
readonly default: undefined;
|
|
24
|
+
};
|
|
16
25
|
readonly mapType: PropType<BMapGL.MapTypeId>;
|
|
17
|
-
readonly enableAutoResize:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
readonly enableAutoResize: {
|
|
27
|
+
readonly type: BooleanConstructor;
|
|
28
|
+
readonly default: undefined;
|
|
29
|
+
};
|
|
30
|
+
readonly enableTiltGestures: {
|
|
31
|
+
readonly type: BooleanConstructor;
|
|
32
|
+
readonly default: undefined;
|
|
33
|
+
};
|
|
34
|
+
readonly enableRotate: {
|
|
35
|
+
readonly type: BooleanConstructor;
|
|
36
|
+
readonly default: undefined;
|
|
37
|
+
};
|
|
38
|
+
readonly enableRotateGestures: {
|
|
39
|
+
readonly type: BooleanConstructor;
|
|
40
|
+
readonly default: undefined;
|
|
41
|
+
};
|
|
21
42
|
readonly displayOptions: PropType<BMapGL.displayOptions>;
|
|
22
43
|
readonly onInitd: PropType<onInitd>;
|
|
23
44
|
};
|
package/es/map/src/map-props.mjs
CHANGED
|
@@ -6,15 +6,36 @@ const mapProps = {
|
|
|
6
6
|
zoom: Number,
|
|
7
7
|
class: String,
|
|
8
8
|
contentClass: String,
|
|
9
|
-
enableScrollWheelZoom:
|
|
10
|
-
|
|
9
|
+
enableScrollWheelZoom: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: void 0
|
|
12
|
+
},
|
|
13
|
+
enableDragging: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: void 0
|
|
16
|
+
},
|
|
11
17
|
tilt: Number,
|
|
12
|
-
enableTilt:
|
|
18
|
+
enableTilt: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
13
22
|
mapType: String,
|
|
14
|
-
enableAutoResize:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
enableAutoResize: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
enableTiltGestures: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
enableRotate: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
enableRotateGestures: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
18
39
|
displayOptions: Object,
|
|
19
40
|
onInitd: Function
|
|
20
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-props.mjs","sources":["../../../src/map/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/map/src/map-props.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { ExtractPublicPropTypes } from '../../_utils'\r\nimport type { onInitd } from './interface'\r\n\r\nexport const mapProps = {\r\n maxZoom: Number,\r\n minZoom: Number,\r\n heading: Number,\r\n center: Object as PropType<BMapGL.Point | string | [number, number]>,\r\n zoom: Number,\r\n class: String,\r\n contentClass: String,\r\n enableScrollWheelZoom: Boolean,\r\n enableDragging: Boolean,\r\n tilt: Number,\r\n enableTilt: Boolean,\r\n mapType: String as PropType<BMapGL.MapTypeId>,\r\n enableAutoResize: Boolean,\r\n enableTiltGestures: Boolean,\r\n enableRotate: Boolean,\r\n enableRotateGestures: Boolean,\r\n displayOptions: Object as PropType<BMapGL.displayOptions>,\r\n onInitd: Function as PropType<onInitd>,\r\n} as const\r\n\r\nexport type MapProps = ExtractPublicPropTypes<typeof mapProps>\r\n"],"names":[],"mappings":"AAIO,MAAM,QAAA,GAAW;AAAA,EACtB,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,MAAA,EAAQ,MAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,YAAA,EAAc,MAAA;AAAA,EACd,qBAAA,EAAuB,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"map-props.mjs","sources":["../../../src/map/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/map/src/map-props.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { ExtractPublicPropTypes } from '../../_utils'\r\nimport type { onInitd } from './interface'\r\n\r\nexport const mapProps = {\r\n maxZoom: Number,\r\n minZoom: Number,\r\n heading: Number,\r\n center: Object as PropType<BMapGL.Point | string | [number, number]>,\r\n zoom: Number,\r\n class: String,\r\n contentClass: String,\r\n enableScrollWheelZoom: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableDragging: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n tilt: Number,\r\n enableTilt: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n mapType: String as PropType<BMapGL.MapTypeId>,\r\n enableAutoResize: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableTiltGestures: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableRotate: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableRotateGestures: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n displayOptions: Object as PropType<BMapGL.displayOptions>,\r\n onInitd: Function as PropType<onInitd>,\r\n} as const\r\n\r\nexport type MapProps = ExtractPublicPropTypes<typeof mapProps>\r\n"],"names":[],"mappings":"AAIO,MAAM,QAAA,GAAW;AAAA,EACtB,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,MAAA,EAAQ,MAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,YAAA,EAAc,MAAA;AAAA,EACd,qBAAA,EAAuB;AAAA,IACrB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,IAAA,EAAM,MAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,OAAA,EAAS,MAAA;AAAA,EACT,gBAAA,EAAkB;AAAA,IAChB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,kBAAA,EAAoB;AAAA,IAClB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,oBAAA,EAAsB;AAAA,IACpB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,cAAA,EAAgB,MAAA;AAAA,EAChB,OAAA,EAAS;;;;;"}
|
package/es/map/src/map.d.ts
CHANGED
|
@@ -12,15 +12,36 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
12
12
|
readonly zoom: NumberConstructor;
|
|
13
13
|
readonly class: StringConstructor;
|
|
14
14
|
readonly contentClass: StringConstructor;
|
|
15
|
-
readonly enableScrollWheelZoom:
|
|
16
|
-
|
|
15
|
+
readonly enableScrollWheelZoom: {
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly default: undefined;
|
|
18
|
+
};
|
|
19
|
+
readonly enableDragging: {
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly default: undefined;
|
|
22
|
+
};
|
|
17
23
|
readonly tilt: NumberConstructor;
|
|
18
|
-
readonly enableTilt:
|
|
24
|
+
readonly enableTilt: {
|
|
25
|
+
readonly type: BooleanConstructor;
|
|
26
|
+
readonly default: undefined;
|
|
27
|
+
};
|
|
19
28
|
readonly mapType: import("vue").PropType<BMapGL.MapTypeId>;
|
|
20
|
-
readonly enableAutoResize:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
readonly enableAutoResize: {
|
|
30
|
+
readonly type: BooleanConstructor;
|
|
31
|
+
readonly default: undefined;
|
|
32
|
+
};
|
|
33
|
+
readonly enableTiltGestures: {
|
|
34
|
+
readonly type: BooleanConstructor;
|
|
35
|
+
readonly default: undefined;
|
|
36
|
+
};
|
|
37
|
+
readonly enableRotate: {
|
|
38
|
+
readonly type: BooleanConstructor;
|
|
39
|
+
readonly default: undefined;
|
|
40
|
+
};
|
|
41
|
+
readonly enableRotateGestures: {
|
|
42
|
+
readonly type: BooleanConstructor;
|
|
43
|
+
readonly default: undefined;
|
|
44
|
+
};
|
|
24
45
|
readonly displayOptions: import("vue").PropType<BMapGL.displayOptions>;
|
|
25
46
|
readonly onInitd: import("vue").PropType<import("./interface").onInitd>;
|
|
26
47
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -31,15 +52,36 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
31
52
|
readonly zoom: NumberConstructor;
|
|
32
53
|
readonly class: StringConstructor;
|
|
33
54
|
readonly contentClass: StringConstructor;
|
|
34
|
-
readonly enableScrollWheelZoom:
|
|
35
|
-
|
|
55
|
+
readonly enableScrollWheelZoom: {
|
|
56
|
+
readonly type: BooleanConstructor;
|
|
57
|
+
readonly default: undefined;
|
|
58
|
+
};
|
|
59
|
+
readonly enableDragging: {
|
|
60
|
+
readonly type: BooleanConstructor;
|
|
61
|
+
readonly default: undefined;
|
|
62
|
+
};
|
|
36
63
|
readonly tilt: NumberConstructor;
|
|
37
|
-
readonly enableTilt:
|
|
64
|
+
readonly enableTilt: {
|
|
65
|
+
readonly type: BooleanConstructor;
|
|
66
|
+
readonly default: undefined;
|
|
67
|
+
};
|
|
38
68
|
readonly mapType: import("vue").PropType<BMapGL.MapTypeId>;
|
|
39
|
-
readonly enableAutoResize:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
readonly enableAutoResize: {
|
|
70
|
+
readonly type: BooleanConstructor;
|
|
71
|
+
readonly default: undefined;
|
|
72
|
+
};
|
|
73
|
+
readonly enableTiltGestures: {
|
|
74
|
+
readonly type: BooleanConstructor;
|
|
75
|
+
readonly default: undefined;
|
|
76
|
+
};
|
|
77
|
+
readonly enableRotate: {
|
|
78
|
+
readonly type: BooleanConstructor;
|
|
79
|
+
readonly default: undefined;
|
|
80
|
+
};
|
|
81
|
+
readonly enableRotateGestures: {
|
|
82
|
+
readonly type: BooleanConstructor;
|
|
83
|
+
readonly default: undefined;
|
|
84
|
+
};
|
|
43
85
|
readonly displayOptions: import("vue").PropType<BMapGL.displayOptions>;
|
|
44
86
|
readonly onInitd: import("vue").PropType<import("./interface").onInitd>;
|
|
45
87
|
}>> & Readonly<{}>, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-props.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile.js","sources":["../../../../src/layer/tile/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/tile/src/tile.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\r\n\r\nexport default defineComponent({\r\n name: 'TileLayer',\r\n setup() {\r\n return () =>
|
|
1
|
+
{"version":3,"file":"tile.js","sources":["../../../../src/layer/tile/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/layer/tile/src/tile.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\r\n\r\nexport default defineComponent({\r\n name: 'TileLayer',\r\n setup() {\r\n return () => <></>\r\n },\r\n})\r\n"],"names":["name","setup","_createVNode","_Fragment"],"mappings":";;;;AAEA,+CAA+B;AAAA,EAC7BA,IAAAA,EAAM,WAAA;AAAA,EACNC,KAAAA,GAAK;AACH,IAAA,OAAO,MAAAC,eAAAA,CAAAC,YAAAA,EAAA,IAAA,EAAA,IAAA,CAAA;AAAA,EACT;AACD,CAAA,CAAA;;;;"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { ExtractPublicPropTypes } from '../../../_utils';
|
|
3
|
+
export interface Box {
|
|
4
|
+
minX: number;
|
|
5
|
+
minY: number;
|
|
6
|
+
maxX: number;
|
|
7
|
+
maxY: number;
|
|
8
|
+
}
|
|
3
9
|
type TemplateFn = (x: number, y: number, z: number) => number;
|
|
4
10
|
type BTemplateFn = (x: number, y: number, z: number) => string;
|
|
5
|
-
type GetTile = (info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void;
|
|
11
|
+
type GetTile = (info: any, box: Box, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void;
|
|
6
12
|
export declare const xyzLayerProps: {
|
|
7
13
|
readonly visible: {
|
|
8
14
|
readonly type: BooleanConstructor;
|
|
@@ -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\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":";;
|
|
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\nexport interface Box {\r\n minX: number\r\n minY: number\r\n maxX: number\r\n maxY: number\r\n}\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, box: Box, 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":";;AAcO,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;;;;;"}
|
|
@@ -4,7 +4,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4
4
|
readonly default: true;
|
|
5
5
|
};
|
|
6
6
|
readonly getTile: {
|
|
7
|
-
readonly type: import("vue").PropType<(info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
7
|
+
readonly type: import("vue").PropType<(info: any, box: import("./xyz-props").Box, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
8
8
|
};
|
|
9
9
|
readonly useThumbData: {
|
|
10
10
|
readonly type: BooleanConstructor;
|
|
@@ -58,7 +58,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
58
58
|
readonly default: true;
|
|
59
59
|
};
|
|
60
60
|
readonly getTile: {
|
|
61
|
-
readonly type: import("vue").PropType<(info: any, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
61
|
+
readonly type: import("vue").PropType<(info: any, box: import("./xyz-props").Box, cb: (image: string | HTMLImageElement | HTMLCanvasElement) => void) => void>;
|
|
62
62
|
};
|
|
63
63
|
readonly useThumbData: {
|
|
64
64
|
readonly type: BooleanConstructor;
|
package/lib/layer/xyz/src/xyz.js
CHANGED
|
@@ -71,7 +71,12 @@ var xyz = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
71
|
callback && callback(image, key);
|
|
72
72
|
};
|
|
73
73
|
const handleError = () => callback && callback(null, key);
|
|
74
|
-
|
|
74
|
+
const box = BMapGL.XYZProjection.getTileRangeExtent([tileInfo.zoom, tileInfo.col, tileInfo.row]);
|
|
75
|
+
getTile({
|
|
76
|
+
x: tileInfo.col,
|
|
77
|
+
y: tileInfo.row,
|
|
78
|
+
z: tileInfo.zoom
|
|
79
|
+
}, box, (img) => {
|
|
75
80
|
if (typeof img === "string" || img instanceof HTMLCanvasElement) {
|
|
76
81
|
const image = new Image();
|
|
77
82
|
image.crossOrigin = "anonymous";
|
|
@@ -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 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,IAClC,CAAA;AAEA,IAAA,MAAME,mBAAmBA,MAAK;AAC5B,MAAA,MAAM;AAAA,QAAER,MAAAA;AAAAA,QAAQO;AAAAA,OAAS,GAAKd,KAAAA;AAC9BM,MAAAA,SAAAA,CAAUC,MAAM,CAAA;AAChBM,MAAAA,YAAAA,CAAaC,SAAS,CAAA;AAAA,IACxB,CAAA;AAEA,IAAA,MAAME,kBAAkBA,MAAK;AAC3BC,MAAAA,SAAAA,CAAM,MAAMjB,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G,CAAA;AAAA,YACjC,CAAA;AAEA,YAAA,MAAMI,WAAAA,GAAcA,MAAML,QAAAA,IAAYA,QAAAA,CAAS,MAAMC,GAAG,CAAA;
|
|
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 const box = (BMapGL as any).XYZProjection.getTileRangeExtent([tileInfo.zoom, tileInfo.col, tileInfo.row])\r\n\r\n getTile({ x: tileInfo.col, y: tileInfo.row, z: tileInfo.zoom }, box, (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","box","XYZProjection","getTileRangeExtent","zoom","col","row","x","y","z","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;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;AAC3E,cAAA,IAAI,OAAOA,GAAAA,KAAQ,QAAA,IAAYA,GAAAA,YAAeC,iBAAAA,EAAmB;AAC/D,gBAAA,MAAMZ,KAAAA,GAAQ,IAAIa,KAAAA;AAClBb,gBAAAA,KAAAA,CAAMc,WAAAA,GAAc,WAAA;AAEpBd,gBAAAA,KAAAA,CAAMe,MAAAA,GAAS,MAAMhB,eAAAA,CAAgBC,KAAK,CAAA;AAC1CA,gBAAAA,KAAAA,CAAMgB,OAAAA,GAAUf,WAAAA;AAEhBD,gBAAAA,KAAAA,CAAMiB,MAAM,OAAON,GAAAA,KAAQ,QAAA,GAAWA,GAAAA,GAAMA,IAAIO,SAAAA;cAClD,CAAA,MAAA,IAAWP,eAAeQ,gBAAAA,EAAkB;AAC1CpB,gBAAAA,eAAAA,CAAgBY,GAAG,CAAA;AAAA,cACrB,CAAA,MAAO;AACLV,gBAAAA,WAAAA;cACF;AAAA,YACF,CAAC,CAAA;AAAA,UACH,CAAA;AAAA,QACF,CAAA,MAAO;AACLtC,UAAAA,WAAAA,GAAc8B,aAAa5B,KAAK,CAAA;AAAA,QAClC;AAAA,MACF;AACAW,MAAAA,eAAAA;IACF,CAAA;AAEAE,IAAAA,IAAAA;AAuDA0C,IAAAA,eAAAA,CAAY,MAAK;AACf,MAAA,IAAIvD,KAAAA,EAAO;AACTF,QAAAA,WAAAA,GAAc0D,gBAAgBxD,KAAK,CAAA;AAAA,MACrC;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAO,MAAAyD,eAAAA,CAAAC,YAAAA,EAAA,IAAA,EAAA,IAAA,CAAA;AAAA,EACT;AACD,CAAA,CAAA;;;;"}
|
|
@@ -9,15 +9,36 @@ export declare const mapProps: {
|
|
|
9
9
|
readonly zoom: NumberConstructor;
|
|
10
10
|
readonly class: StringConstructor;
|
|
11
11
|
readonly contentClass: StringConstructor;
|
|
12
|
-
readonly enableScrollWheelZoom:
|
|
13
|
-
|
|
12
|
+
readonly enableScrollWheelZoom: {
|
|
13
|
+
readonly type: BooleanConstructor;
|
|
14
|
+
readonly default: undefined;
|
|
15
|
+
};
|
|
16
|
+
readonly enableDragging: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: undefined;
|
|
19
|
+
};
|
|
14
20
|
readonly tilt: NumberConstructor;
|
|
15
|
-
readonly enableTilt:
|
|
21
|
+
readonly enableTilt: {
|
|
22
|
+
readonly type: BooleanConstructor;
|
|
23
|
+
readonly default: undefined;
|
|
24
|
+
};
|
|
16
25
|
readonly mapType: PropType<BMapGL.MapTypeId>;
|
|
17
|
-
readonly enableAutoResize:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
readonly enableAutoResize: {
|
|
27
|
+
readonly type: BooleanConstructor;
|
|
28
|
+
readonly default: undefined;
|
|
29
|
+
};
|
|
30
|
+
readonly enableTiltGestures: {
|
|
31
|
+
readonly type: BooleanConstructor;
|
|
32
|
+
readonly default: undefined;
|
|
33
|
+
};
|
|
34
|
+
readonly enableRotate: {
|
|
35
|
+
readonly type: BooleanConstructor;
|
|
36
|
+
readonly default: undefined;
|
|
37
|
+
};
|
|
38
|
+
readonly enableRotateGestures: {
|
|
39
|
+
readonly type: BooleanConstructor;
|
|
40
|
+
readonly default: undefined;
|
|
41
|
+
};
|
|
21
42
|
readonly displayOptions: PropType<BMapGL.displayOptions>;
|
|
22
43
|
readonly onInitd: PropType<onInitd>;
|
|
23
44
|
};
|
package/lib/map/src/map-props.js
CHANGED
|
@@ -8,15 +8,36 @@ const mapProps = {
|
|
|
8
8
|
zoom: Number,
|
|
9
9
|
class: String,
|
|
10
10
|
contentClass: String,
|
|
11
|
-
enableScrollWheelZoom:
|
|
12
|
-
|
|
11
|
+
enableScrollWheelZoom: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
enableDragging: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
13
19
|
tilt: Number,
|
|
14
|
-
enableTilt:
|
|
20
|
+
enableTilt: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
15
24
|
mapType: String,
|
|
16
|
-
enableAutoResize:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
enableAutoResize: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: void 0
|
|
28
|
+
},
|
|
29
|
+
enableTiltGestures: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
enableRotate: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
enableRotateGestures: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
20
41
|
displayOptions: Object,
|
|
21
42
|
onInitd: Function
|
|
22
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-props.js","sources":["../../../src/map/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/map/src/map-props.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { ExtractPublicPropTypes } from '../../_utils'\r\nimport type { onInitd } from './interface'\r\n\r\nexport const mapProps = {\r\n maxZoom: Number,\r\n minZoom: Number,\r\n heading: Number,\r\n center: Object as PropType<BMapGL.Point | string | [number, number]>,\r\n zoom: Number,\r\n class: String,\r\n contentClass: String,\r\n enableScrollWheelZoom: Boolean,\r\n enableDragging: Boolean,\r\n tilt: Number,\r\n enableTilt: Boolean,\r\n mapType: String as PropType<BMapGL.MapTypeId>,\r\n enableAutoResize: Boolean,\r\n enableTiltGestures: Boolean,\r\n enableRotate: Boolean,\r\n enableRotateGestures: Boolean,\r\n displayOptions: Object as PropType<BMapGL.displayOptions>,\r\n onInitd: Function as PropType<onInitd>,\r\n} as const\r\n\r\nexport type MapProps = ExtractPublicPropTypes<typeof mapProps>\r\n"],"names":[],"mappings":";;AAIO,MAAM,QAAA,GAAW;AAAA,EACtB,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,MAAA,EAAQ,MAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,YAAA,EAAc,MAAA;AAAA,EACd,qBAAA,EAAuB,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"map-props.js","sources":["../../../src/map/src/file:/D:/workspaces/personal-project/vue3-bmapgl/packages/vue3-bmapgl/src/map/src/map-props.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { ExtractPublicPropTypes } from '../../_utils'\r\nimport type { onInitd } from './interface'\r\n\r\nexport const mapProps = {\r\n maxZoom: Number,\r\n minZoom: Number,\r\n heading: Number,\r\n center: Object as PropType<BMapGL.Point | string | [number, number]>,\r\n zoom: Number,\r\n class: String,\r\n contentClass: String,\r\n enableScrollWheelZoom: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableDragging: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n tilt: Number,\r\n enableTilt: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n mapType: String as PropType<BMapGL.MapTypeId>,\r\n enableAutoResize: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableTiltGestures: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableRotate: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n enableRotateGestures: {\r\n type: Boolean,\r\n default: undefined,\r\n },\r\n displayOptions: Object as PropType<BMapGL.displayOptions>,\r\n onInitd: Function as PropType<onInitd>,\r\n} as const\r\n\r\nexport type MapProps = ExtractPublicPropTypes<typeof mapProps>\r\n"],"names":[],"mappings":";;AAIO,MAAM,QAAA,GAAW;AAAA,EACtB,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,MAAA;AAAA,EACT,MAAA,EAAQ,MAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,MAAA;AAAA,EACP,YAAA,EAAc,MAAA;AAAA,EACd,qBAAA,EAAuB;AAAA,IACrB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,IAAA,EAAM,MAAA;AAAA,EACN,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,OAAA,EAAS,MAAA;AAAA,EACT,gBAAA,EAAkB;AAAA,IAChB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,kBAAA,EAAoB;AAAA,IAClB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,oBAAA,EAAsB;AAAA,IACpB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV;AAAA,EACD,cAAA,EAAgB,MAAA;AAAA,EAChB,OAAA,EAAS;;;;;"}
|
package/lib/map/src/map.d.ts
CHANGED
|
@@ -12,15 +12,36 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
12
12
|
readonly zoom: NumberConstructor;
|
|
13
13
|
readonly class: StringConstructor;
|
|
14
14
|
readonly contentClass: StringConstructor;
|
|
15
|
-
readonly enableScrollWheelZoom:
|
|
16
|
-
|
|
15
|
+
readonly enableScrollWheelZoom: {
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly default: undefined;
|
|
18
|
+
};
|
|
19
|
+
readonly enableDragging: {
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly default: undefined;
|
|
22
|
+
};
|
|
17
23
|
readonly tilt: NumberConstructor;
|
|
18
|
-
readonly enableTilt:
|
|
24
|
+
readonly enableTilt: {
|
|
25
|
+
readonly type: BooleanConstructor;
|
|
26
|
+
readonly default: undefined;
|
|
27
|
+
};
|
|
19
28
|
readonly mapType: import("vue").PropType<BMapGL.MapTypeId>;
|
|
20
|
-
readonly enableAutoResize:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
readonly enableAutoResize: {
|
|
30
|
+
readonly type: BooleanConstructor;
|
|
31
|
+
readonly default: undefined;
|
|
32
|
+
};
|
|
33
|
+
readonly enableTiltGestures: {
|
|
34
|
+
readonly type: BooleanConstructor;
|
|
35
|
+
readonly default: undefined;
|
|
36
|
+
};
|
|
37
|
+
readonly enableRotate: {
|
|
38
|
+
readonly type: BooleanConstructor;
|
|
39
|
+
readonly default: undefined;
|
|
40
|
+
};
|
|
41
|
+
readonly enableRotateGestures: {
|
|
42
|
+
readonly type: BooleanConstructor;
|
|
43
|
+
readonly default: undefined;
|
|
44
|
+
};
|
|
24
45
|
readonly displayOptions: import("vue").PropType<BMapGL.displayOptions>;
|
|
25
46
|
readonly onInitd: import("vue").PropType<import("./interface").onInitd>;
|
|
26
47
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -31,15 +52,36 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
31
52
|
readonly zoom: NumberConstructor;
|
|
32
53
|
readonly class: StringConstructor;
|
|
33
54
|
readonly contentClass: StringConstructor;
|
|
34
|
-
readonly enableScrollWheelZoom:
|
|
35
|
-
|
|
55
|
+
readonly enableScrollWheelZoom: {
|
|
56
|
+
readonly type: BooleanConstructor;
|
|
57
|
+
readonly default: undefined;
|
|
58
|
+
};
|
|
59
|
+
readonly enableDragging: {
|
|
60
|
+
readonly type: BooleanConstructor;
|
|
61
|
+
readonly default: undefined;
|
|
62
|
+
};
|
|
36
63
|
readonly tilt: NumberConstructor;
|
|
37
|
-
readonly enableTilt:
|
|
64
|
+
readonly enableTilt: {
|
|
65
|
+
readonly type: BooleanConstructor;
|
|
66
|
+
readonly default: undefined;
|
|
67
|
+
};
|
|
38
68
|
readonly mapType: import("vue").PropType<BMapGL.MapTypeId>;
|
|
39
|
-
readonly enableAutoResize:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
readonly enableAutoResize: {
|
|
70
|
+
readonly type: BooleanConstructor;
|
|
71
|
+
readonly default: undefined;
|
|
72
|
+
};
|
|
73
|
+
readonly enableTiltGestures: {
|
|
74
|
+
readonly type: BooleanConstructor;
|
|
75
|
+
readonly default: undefined;
|
|
76
|
+
};
|
|
77
|
+
readonly enableRotate: {
|
|
78
|
+
readonly type: BooleanConstructor;
|
|
79
|
+
readonly default: undefined;
|
|
80
|
+
};
|
|
81
|
+
readonly enableRotateGestures: {
|
|
82
|
+
readonly type: BooleanConstructor;
|
|
83
|
+
readonly default: undefined;
|
|
84
|
+
};
|
|
43
85
|
readonly displayOptions: import("vue").PropType<BMapGL.displayOptions>;
|
|
44
86
|
readonly onInitd: import("vue").PropType<import("./interface").onInitd>;
|
|
45
87
|
}>> & Readonly<{}>, {
|