Co-authored-by: Madison Grubb <madison@elastiflow.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -214,10 +214,6 @@
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
|
||||
const props = defineProps({
|
||||
feeds: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
devices: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
@@ -382,8 +378,7 @@ function updateMarkers() {
|
||||
if (m) m.remove()
|
||||
})
|
||||
|
||||
const feedSources = [...(props.feeds || []), ...(props.devices || [])]
|
||||
const validSources = feedSources.filter(f => typeof f?.lat === 'number' && typeof f?.lng === 'number')
|
||||
const validSources = (props.devices || []).filter(f => typeof f?.lat === 'number' && typeof f?.lng === 'number')
|
||||
markersRef.value = validSources.map(item =>
|
||||
L.marker([item.lat, item.lng]).addTo(ctx.map).on('click', () => emit('select', item)),
|
||||
)
|
||||
@@ -622,7 +617,7 @@ onBeforeUnmount(() => {
|
||||
destroyMap()
|
||||
})
|
||||
|
||||
watch(() => [props.feeds, props.devices], () => updateMarkers(), { deep: true })
|
||||
watch(() => props.devices, () => updateMarkers(), { deep: true })
|
||||
watch([() => props.pois, () => props.canEditPois], () => updatePoiMarkers(), { deep: true })
|
||||
watch(() => props.liveSessions, () => updateLiveMarkers(), { deep: true })
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user