Map.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="map-container">
  3. <l-map
  4. ref="map"
  5. :zoom="15"
  6. :center="location"
  7. :options="{scrollWheelZoom: false}"
  8. >
  9. <l-tile-layer
  10. url="https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"
  11. layer-type="base"
  12. name="OpenStreetMap"
  13. attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>'
  14. />
  15. <l-marker
  16. :icon="icon"
  17. :lat-lng="location"
  18. >
  19. <l-popup>
  20. <v-row>
  21. <v-col cols="4" class="d-flex align-center">
  22. <v-img src="/images/Opentalent_Griffe.png"/>
  23. </v-col>
  24. <v-col cols="8">
  25. <div>
  26. OPENTALENT
  27. </div>
  28. <div>
  29. 217, rue Raoul Follereau
  30. </div>
  31. <div>
  32. 74300 - Cluses
  33. </div>
  34. </v-col>
  35. </v-row>
  36. </l-popup>
  37. </l-marker>
  38. </l-map>
  39. </div>
  40. </template>
  41. <script setup lang="ts">
  42. import 'leaflet/dist/leaflet.css'
  43. import { LMap, LTileLayer, LMarker, LIcon } from '@vue-leaflet/vue-leaflet'
  44. import L from 'leaflet';
  45. const location = [46.075245, 6.570162]
  46. const icon = L.icon({
  47. iconUrl: '/images/Opentalent_Griffe.png',
  48. iconSize: [60, 60],
  49. iconAnchor: [22, 94],
  50. popupAnchor: [5, -100],
  51. })
  52. </script>
  53. <style scoped lang="scss">
  54. .map-container {
  55. height: 500px;
  56. width: 100%;
  57. margin-left: auto;
  58. margin-right: auto;
  59. }
  60. </style>