UNPKG

vue-tianditu2

Version:
3 lines (2 loc) 1.41 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("vue"),i=require("../../utils/converter.js");function a({props:t,instance:o}){m.watch(()=>({center:t.center,zoom:t.zoom}),e=>{!e.center||!e.zoom||o.panTo(i.toLngLat(e.center),e.zoom)}),m.watch(()=>t.drag,e=>e?o.enableDrag():o.disableDrag(),{immediate:!0}),m.watch(()=>t.scrollWheelZoom,e=>e?o.enableScrollWheelZoom():o.disableScrollWheelZoom(),{immediate:!0}),m.watch(()=>t.doubleClickZoom,e=>e?o.enableDoubleClickZoom():o.disableDoubleClickZoom(),{immediate:!0}),m.watch(()=>t.keyboard,e=>e?o.enableKeyboard():o.disableKeyboard(),{immediate:!0}),m.watch(()=>t.inertia,e=>e?o.enableInertia():o.disableInertia(),{immediate:!0}),m.watch(()=>t.continuousZoom,e=>e?o.enableContinuousZoom():o.disableContinuousZoom(),{immediate:!0}),m.watch(()=>t.pinchToZoom,e=>e?o.enablePinchToZoom():o.disablePinchToZoom(),{immediate:!0}),m.watch(()=>t.autoResize,e=>e?o.enableAutoResize():o.disableAutoResize(),{immediate:!0}),m.watch(()=>t.minZoom,e=>e&&o.setMinZoom(e)),m.watch(()=>t.maxZoom,e=>e&&o.setMaxZoom(e),{immediate:!0}),m.watch(()=>t.maxBounds,e=>e&&o.setMaxBounds(i.toBounds(e)),{immediate:!0}),m.watch(()=>t.viewport,e=>e&&o.setViewport(e==null?void 0:e.map(u=>i.toLngLat(u))),{immediate:!0}),m.watch(()=>t.mapStyle,e=>e?o.setStyle(e):o.removeStyle(),{immediate:!0})}exports.useWatch=a; //# sourceMappingURL=watch.js.map