PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { tools } from '@tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { PropType, defineComponent, onMounted, ref, toRaw, computed, toRef, watch, shallowRef } from 'vue'
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, onMounted, ref, toRaw, computed, toRef, watch, shallowRef } from 'vue'
|
||||
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
// @ts-ignore
|
||||
@@ -12,7 +13,7 @@ import 'leaflet.markercluster'
|
||||
|
||||
import { useUserStore } from '@src/store/UserStore'
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ICoordGPS } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
@@ -23,7 +24,7 @@ export default defineComponent({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
arrcord: {
|
||||
arrcordprop: {
|
||||
type: Array as PropType<any[]>,
|
||||
required: false,
|
||||
default: () => { return [] }
|
||||
@@ -51,7 +52,7 @@ export default defineComponent({
|
||||
|
||||
const currentMarkerPositionGPS = shallowRef<L.Marker | null>(null)
|
||||
|
||||
const centerCoordinates = ref<{ lat: number; lng: number }>({ lat: 0, lng: 0 }); //
|
||||
const centerCoordinates = ref<{ lat: number; lng: number }>({ lat: 0, lng: 0 }); //
|
||||
|
||||
const arrMarkers = ref(<any>[])
|
||||
|
||||
@@ -107,7 +108,7 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
|
||||
const arrcord = toRef(props, 'arrcord')
|
||||
const arrcord = toRef(props, 'arrcordprop')
|
||||
|
||||
const precZoomLevel = ref(0)
|
||||
|
||||
@@ -166,7 +167,7 @@ export default defineComponent({
|
||||
};
|
||||
}
|
||||
|
||||
watch(arrcord, () => {
|
||||
watch(arrcord.value, () => {
|
||||
updateMap()
|
||||
})
|
||||
|
||||
@@ -193,7 +194,7 @@ export default defineComponent({
|
||||
const myarrSectors = myrec.sector
|
||||
if (!myarrSectors) return 'mdi-map-marker-outline'
|
||||
|
||||
let sectId = myarrSectors[0]._id
|
||||
const sectId = myarrSectors[0]._id
|
||||
return globalStore.getIconBySector(sectId)
|
||||
}
|
||||
|
||||
@@ -320,7 +321,7 @@ export default defineComponent({
|
||||
<img src="images/icon.png" class="marker-icon" alt="" />
|
||||
|
||||
<div class="marker-circle"></div>
|
||||
|
||||
|
||||
<div class="marker-mini-icon ${getIconName(rec)}"></div>
|
||||
</div>`;
|
||||
|
||||
@@ -336,7 +337,7 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
let each_marker = new L.marker(
|
||||
const each_marker = new L.marker(
|
||||
[rec.coordinate_gps.coordinates[1], rec.coordinate_gps.coordinates[0]],
|
||||
{
|
||||
icon: markerIcon
|
||||
@@ -344,8 +345,8 @@ export default defineComponent({
|
||||
}
|
||||
)
|
||||
.bindPopup(() => {
|
||||
let container = L.DomUtil.create('div');
|
||||
let strHTML = `<span class="fake-link">${rec.descr}</span>`
|
||||
const container = L.DomUtil.create('div');
|
||||
const strHTML = `<span class="fake-link">${rec.descr}</span>`
|
||||
|
||||
if (debug.value) {
|
||||
// strHTML += `<br> Lat: ${rec.coordinate_gps.coordinates[1]} <br> Lng: ${rec.coordinate_gps.coordinates[0]}`;
|
||||
@@ -353,7 +354,7 @@ export default defineComponent({
|
||||
|
||||
container.innerHTML = strHTML
|
||||
|
||||
let fakeLink: any = container.querySelector('.fake-link');
|
||||
const fakeLink: any = container.querySelector('.fake-link');
|
||||
L.DomEvent.on(fakeLink, 'click', (e) => {
|
||||
L.DomEvent.stopPropagation(e);
|
||||
ApriScheda(rec._id);
|
||||
@@ -566,7 +567,7 @@ export default defineComponent({
|
||||
if (markerShowed.value) {
|
||||
//console.log('openPopup markerShowed', markerShowed.value)
|
||||
if (markerShowed.value.closePopup) {
|
||||
markerShowed.value.openPopup(); // Mostra il popup
|
||||
markerShowed.value.openPopup(); // Mostra il popup
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user