From ae7ce20788a0812ef2ab2bdcac9ac3ebc63a19d2 Mon Sep 17 00:00:00 2001 From: Andy Emond Date: Thu, 4 May 2023 22:52:27 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Ajoute=20une=20icone=20repr=C3=A9sentant=20?= =?UTF-8?q?le=20service=20sur=20la=20carte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MapView.vue | 17 ++++++++++++++--- src/components/TypeFilter.vue | 15 +-------------- src/models/amenity_type.ts | 13 +++++++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/components/MapView.vue b/src/components/MapView.vue index 5f4c6db..ff3b8a8 100644 --- a/src/components/MapView.vue +++ b/src/components/MapView.vue @@ -51,11 +51,11 @@ import 'leaflet/dist/leaflet.css'; import { defineComponent, PropType, ref, watch } from 'vue'; import { LMap, LTileLayer, LGeoJson, LLayerGroup, LControlAttribution, LControl } from '@vue-leaflet/vue-leaflet'; -import L from 'leaflet'; +import L, { icon } from 'leaflet'; import { useMapStore } from '../stores/map'; import { Feature } from 'geojson'; import { AreaProperties } from '../models/area_properties'; -import { AmenityType } from '../models/amenity_type'; +import { AmenityType, amenityIconClasses } from '../models/amenity_type'; import { useI18n } from 'vue-i18n'; const areaStyle: L.PathOptions = { @@ -147,7 +147,11 @@ export default defineComponent({ const marker = L.marker({ lng: distances.pt.coordinates[0], lat: distances.pt.coordinates[1] - }).bindPopup('' + i18n.t('correction') + ''); + }, + {icon: L.divIcon({ + html: '
', + iconSize: [20, 20], + })}).bindPopup('' + i18n.t('correction') + ''); markers.value.leafletObject.addLayer(marker); } } @@ -264,4 +268,11 @@ path.leaflet-interactive:focus { text-decoration: none; } +.mapicon { + text-align: center; + line-height: 20px; + display: block; + font-size: 1.3em; +} + \ No newline at end of file diff --git a/src/components/TypeFilter.vue b/src/components/TypeFilter.vue index 742d256..2c0287b 100644 --- a/src/components/TypeFilter.vue +++ b/src/components/TypeFilter.vue @@ -37,7 +37,7 @@ \ No newline at end of file