mirror of
https://github.com/aljazceru/nostr-watch.git
synced 2025-12-17 05:24:19 +01:00
add leaflet and component
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@2alheure/vue-safe-mail": "1.0.3",
|
||||
"@vue-leaflet/vue-leaflet": "0.6.1",
|
||||
"core-js": "^3.8.3",
|
||||
"country-code-emoji": "2.3.0",
|
||||
"cross-fetch": "3.1.5",
|
||||
|
||||
39
src/components/LeafletComponent.vue
Normal file
39
src/components/LeafletComponent.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<l-map ref="map" v-model:zoom="zoom" :center="[47.41322, -1.219482]">
|
||||
<l-tile-layer
|
||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
layer-type="base"
|
||||
name="OpenStreetMap"
|
||||
></l-tile-layer>
|
||||
|
||||
<l-marker v-for="([relay, result]) in Object.entries(results)" :lat-lng="result.geo.latlng" draggable>
|
||||
<l-popup>
|
||||
{{ result.uri }}
|
||||
</l-popup>
|
||||
</l-marker>
|
||||
</l-map>
|
||||
</template>
|
||||
<script>
|
||||
import "leaflet/dist/leaflet.css"
|
||||
import { LMap, LTileLayer, LMarker } from "@vue-leaflet/vue-leaflet";
|
||||
export default {
|
||||
components: {
|
||||
LMap,
|
||||
LTileLayer,
|
||||
LMarker,
|
||||
LPopup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
markers: {
|
||||
type: Object,
|
||||
default(){
|
||||
return {}
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
Reference in New Issue
Block a user