Loading src/components/LControlLayers.vue +5 −5 Original line number Diff line number Diff line Loading @@ -7,22 +7,22 @@ export default { name: "LControlLayers", props, setup(props) { const mapRef = ref({}); const leafletRef = ref({}); const registerLayerControl = inject("registerLayerControl"); const { options, methods } = controlSetup(props, mapRef); const { options, methods } = controlSetup(props, leafletRef); onMounted(async () => { const { control, setOptions } = await import( "leaflet/dist/leaflet-src.esm" ); mapRef.value = control.layers(null, null, options); propsBinder(methods, mapRef.value, props, setOptions); leafletRef.value = control.layers(null, null, options); propsBinder(methods, leafletRef.value, props, setOptions); registerLayerControl({ ...props, ...methods, mapObject: mapRef.value, mapObject: leafletRef.value, }); }); }, Loading src/components/LMarker.vue +7 −7 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ export default { name: "LMarker", props, setup(props, context) { const mapRef = ref({}); const leafletRef = ref({}); const ready = ref(false); const schematics = reactive({ Loading @@ -20,7 +20,7 @@ export default { const addMapLayer = inject("addMapLayer"); const { options, methods } = markerSetup( props, mapRef, leafletRef, context, schematics ); Loading @@ -31,14 +31,14 @@ export default { ); schematics.latLng = latLng; mapRef.value = marker(props.latLng, options); leafletRef.value = marker(props.latLng, options); const listeners = remapEvents(context.attrs); DomEvent.on(mapRef.value, listeners); DomEvent.on(leafletRef.value, listeners); mapRef.value.on("move", debounce(methods.latLngSync, 100)); propsBinder(methods, mapRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: mapRef.value }); leafletRef.value.on("move", debounce(methods.latLngSync, 100)); propsBinder(methods, leafletRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: leafletRef.value }); ready.value = true; }); return { ready }; Loading src/components/LTileLayer.vue +6 −6 Original line number Diff line number Diff line Loading @@ -6,22 +6,22 @@ import { props, setup as tileLayerSetup } from "../functions/tileLayer"; export default { props, setup(props, context) { const mapRef = ref({}); const leafletRef = ref({}); const addMapLayer = inject("addMapLayer"); const { options, methods } = tileLayerSetup(props, mapRef); const { options, methods } = tileLayerSetup(props, leafletRef); onMounted(async () => { const { tileLayer, DomEvent, setOptions } = await import( "leaflet/dist/leaflet-src.esm" ); mapRef.value = tileLayer(props.url, options); leafletRef.value = tileLayer(props.url, options); const listeners = remapEvents(context.attrs); DomEvent.on(mapRef.value, listeners); DomEvent.on(leafletRef.value, listeners); propsBinder(methods, mapRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: mapRef.value }); propsBinder(methods, leafletRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: leafletRef.value }); }); }, render() { Loading src/components/LTooltip.vue +12 −7 Original line number Diff line number Diff line Loading @@ -10,24 +10,29 @@ export default { name: "LTooltip", props, setup(props, context) { const mapRef = ref({}); const leafletRef = ref({}); const root = ref(null); const lMethods = inject("leafLetMethods"); const { options, methods } = tooltipSetup(props, mapRef, context, lMethods); const { options, methods } = tooltipSetup( props, leafletRef, context, lMethods ); onMounted(async () => { const { tooltip, DomEvent, setOptions } = await import( "leaflet/dist/leaflet-src.esm" ); mapRef.value = tooltip(options); leafletRef.value = tooltip(options); propsBinder(methods, mapRef.value, props, setOptions); propsBinder(methods, leafletRef.value, props, setOptions); const listeners = remapEvents(context.attrs); DomEvent.on(mapRef.value, listeners); mapRef.value.setContent(props.content || root.value); lMethods.bindTooltip({ mapObject: mapRef.value }); DomEvent.on(leafletRef.value, listeners); leafletRef.value.setContent(props.content || root.value); lMethods.bindTooltip({ mapObject: leafletRef.value }); }); return { root }; }, Loading src/functions/control.js +3 −3 Original line number Diff line number Diff line Loading @@ -6,10 +6,10 @@ export const props = { default: "topright", }, }; export const setup = (mapRef) => { export const setup = (leafletRef) => { onUnmounted(() => { if (mapRef.value) { mapRef.value.remove(); if (leafletRef.value) { leafletRef.value.remove(); } }); }; Loading
src/components/LControlLayers.vue +5 −5 Original line number Diff line number Diff line Loading @@ -7,22 +7,22 @@ export default { name: "LControlLayers", props, setup(props) { const mapRef = ref({}); const leafletRef = ref({}); const registerLayerControl = inject("registerLayerControl"); const { options, methods } = controlSetup(props, mapRef); const { options, methods } = controlSetup(props, leafletRef); onMounted(async () => { const { control, setOptions } = await import( "leaflet/dist/leaflet-src.esm" ); mapRef.value = control.layers(null, null, options); propsBinder(methods, mapRef.value, props, setOptions); leafletRef.value = control.layers(null, null, options); propsBinder(methods, leafletRef.value, props, setOptions); registerLayerControl({ ...props, ...methods, mapObject: mapRef.value, mapObject: leafletRef.value, }); }); }, Loading
src/components/LMarker.vue +7 −7 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ export default { name: "LMarker", props, setup(props, context) { const mapRef = ref({}); const leafletRef = ref({}); const ready = ref(false); const schematics = reactive({ Loading @@ -20,7 +20,7 @@ export default { const addMapLayer = inject("addMapLayer"); const { options, methods } = markerSetup( props, mapRef, leafletRef, context, schematics ); Loading @@ -31,14 +31,14 @@ export default { ); schematics.latLng = latLng; mapRef.value = marker(props.latLng, options); leafletRef.value = marker(props.latLng, options); const listeners = remapEvents(context.attrs); DomEvent.on(mapRef.value, listeners); DomEvent.on(leafletRef.value, listeners); mapRef.value.on("move", debounce(methods.latLngSync, 100)); propsBinder(methods, mapRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: mapRef.value }); leafletRef.value.on("move", debounce(methods.latLngSync, 100)); propsBinder(methods, leafletRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: leafletRef.value }); ready.value = true; }); return { ready }; Loading
src/components/LTileLayer.vue +6 −6 Original line number Diff line number Diff line Loading @@ -6,22 +6,22 @@ import { props, setup as tileLayerSetup } from "../functions/tileLayer"; export default { props, setup(props, context) { const mapRef = ref({}); const leafletRef = ref({}); const addMapLayer = inject("addMapLayer"); const { options, methods } = tileLayerSetup(props, mapRef); const { options, methods } = tileLayerSetup(props, leafletRef); onMounted(async () => { const { tileLayer, DomEvent, setOptions } = await import( "leaflet/dist/leaflet-src.esm" ); mapRef.value = tileLayer(props.url, options); leafletRef.value = tileLayer(props.url, options); const listeners = remapEvents(context.attrs); DomEvent.on(mapRef.value, listeners); DomEvent.on(leafletRef.value, listeners); propsBinder(methods, mapRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: mapRef.value }); propsBinder(methods, leafletRef.value, props, setOptions); addMapLayer({ ...props, ...methods, mapObject: leafletRef.value }); }); }, render() { Loading
src/components/LTooltip.vue +12 −7 Original line number Diff line number Diff line Loading @@ -10,24 +10,29 @@ export default { name: "LTooltip", props, setup(props, context) { const mapRef = ref({}); const leafletRef = ref({}); const root = ref(null); const lMethods = inject("leafLetMethods"); const { options, methods } = tooltipSetup(props, mapRef, context, lMethods); const { options, methods } = tooltipSetup( props, leafletRef, context, lMethods ); onMounted(async () => { const { tooltip, DomEvent, setOptions } = await import( "leaflet/dist/leaflet-src.esm" ); mapRef.value = tooltip(options); leafletRef.value = tooltip(options); propsBinder(methods, mapRef.value, props, setOptions); propsBinder(methods, leafletRef.value, props, setOptions); const listeners = remapEvents(context.attrs); DomEvent.on(mapRef.value, listeners); mapRef.value.setContent(props.content || root.value); lMethods.bindTooltip({ mapObject: mapRef.value }); DomEvent.on(leafletRef.value, listeners); leafletRef.value.setContent(props.content || root.value); lMethods.bindTooltip({ mapObject: leafletRef.value }); }); return { root }; }, Loading
src/functions/control.js +3 −3 Original line number Diff line number Diff line Loading @@ -6,10 +6,10 @@ export const props = { default: "topright", }, }; export const setup = (mapRef) => { export const setup = (leafletRef) => { onUnmounted(() => { if (mapRef.value) { mapRef.value.remove(); if (leafletRef.value) { leafletRef.value.remove(); } }); };