Loading src/components/LMap.vue +16 −0 Original line number Diff line number Diff line Loading @@ -182,8 +182,12 @@ export default { markerZoomAnimation: props.markerZoomAnimation, }; const getAttributionControl = () => blueprint.leafletRef.attributionControl; const addLayer = provideLeafletWrapper("addLayer"); const removeLayer = provideLeafletWrapper("removeLayer"); const addAttribution = provideLeafletWrapper("addAttribution"); const removeAttribution = provideLeafletWrapper("removeAttribution"); const registerControl = provideLeafletWrapper("registerControl"); const registerLayerControl = provideLeafletWrapper("registerLayerControl"); provide(GLOBAL_LEAFLET_OPT, props.useGlobalLeaflet); Loading Loading @@ -368,10 +372,22 @@ export default { }); } }, addAttribution(attribution) { const control = getAttributionControl(); control && control.addAttribution(attribution); }, removeAttribution(attribution) { const control = getAttributionControl(); control && control.removeAttribution(attribution); }, }; updateLeafletWrapper(addLayer, methods.addLayer); updateLeafletWrapper(removeLayer, methods.removeLayer); updateLeafletWrapper(addAttribution, methods.addAttribution); updateLeafletWrapper(removeAttribution, methods.removeAttribution); updateLeafletWrapper(registerControl, methods.registerControl); updateLeafletWrapper(registerLayerControl, methods.registerLayerControl); Loading src/functions/layer.js +4 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ export const props = { export const setup = (props, leafletRef, context) => { const addLayer = inject("addLayer"); const removeLayer = inject("removeLayer"); const addAttribution = inject("addAttribution"); const removeAttribution = inject("removeAttribution"); const { options: componentOptions, methods: componentMethods, Loading @@ -50,8 +52,8 @@ export const setup = (props, leafletRef, context) => { const methods = { ...componentMethods, setAttribution(val, old) { const attributionControl = this.$parent.leafletObject.attributionControl; attributionControl.removeAttribution(old).addAttribution(val); removeAttribution(old); addAttribution(val); }, setName() { removeThisLayer(); Loading Loading
src/components/LMap.vue +16 −0 Original line number Diff line number Diff line Loading @@ -182,8 +182,12 @@ export default { markerZoomAnimation: props.markerZoomAnimation, }; const getAttributionControl = () => blueprint.leafletRef.attributionControl; const addLayer = provideLeafletWrapper("addLayer"); const removeLayer = provideLeafletWrapper("removeLayer"); const addAttribution = provideLeafletWrapper("addAttribution"); const removeAttribution = provideLeafletWrapper("removeAttribution"); const registerControl = provideLeafletWrapper("registerControl"); const registerLayerControl = provideLeafletWrapper("registerLayerControl"); provide(GLOBAL_LEAFLET_OPT, props.useGlobalLeaflet); Loading Loading @@ -368,10 +372,22 @@ export default { }); } }, addAttribution(attribution) { const control = getAttributionControl(); control && control.addAttribution(attribution); }, removeAttribution(attribution) { const control = getAttributionControl(); control && control.removeAttribution(attribution); }, }; updateLeafletWrapper(addLayer, methods.addLayer); updateLeafletWrapper(removeLayer, methods.removeLayer); updateLeafletWrapper(addAttribution, methods.addAttribution); updateLeafletWrapper(removeAttribution, methods.removeAttribution); updateLeafletWrapper(registerControl, methods.registerControl); updateLeafletWrapper(registerLayerControl, methods.registerLayerControl); Loading
src/functions/layer.js +4 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ export const props = { export const setup = (props, leafletRef, context) => { const addLayer = inject("addLayer"); const removeLayer = inject("removeLayer"); const addAttribution = inject("addAttribution"); const removeAttribution = inject("removeAttribution"); const { options: componentOptions, methods: componentMethods, Loading @@ -50,8 +52,8 @@ export const setup = (props, leafletRef, context) => { const methods = { ...componentMethods, setAttribution(val, old) { const attributionControl = this.$parent.leafletObject.attributionControl; attributionControl.removeAttribution(old).addAttribution(val); removeAttribution(old); addAttribution(val); }, setName() { removeThisLayer(); Loading