cygnal/src/components/ReportMarker.vue

38 lines
861 B
Vue
Raw Normal View History

<template>
<v-lmarker :lat-lng="marker.latLng" :icon="icon" @click="onClick"></v-lmarker>
</template>
<script>
import L from 'leaflet';
2018-08-20 12:03:55 +02:00
import { LMarker } from 'vue2-leaflet';
import { REPORT_TYPES } from '@/constants';
export default {
2018-08-20 12:03:55 +02:00
components: {
'v-lmarker': LMarker,
},
props: {
marker: Object,
},
computed: {
icon() {
2018-07-12 17:48:26 +02:00
if (this.$store.state.reportDetails.id === this.marker.id) {
return L.icon(REPORT_TYPES[this.marker.type].markerLarge);
}
return L.icon(REPORT_TYPES[this.marker.type].marker);
},
},
data() {
return {
showCard: false,
};
},
methods: {
onClick() {
2018-07-12 17:48:26 +02:00
this.$store.dispatch('showReportDetails', { id: this.marker.id, userAsked: true });
},
},
};
</script>