add map pointer
This commit is contained in:
parent
8acbc3b43e
commit
797c5f869f
1 changed files with 5 additions and 2 deletions
|
@ -5,8 +5,8 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{{ .Query }} - Ocásek</title>
|
<title>{{ .Query }} - Ocásek</title>
|
||||||
<link rel="stylesheet" href="/static/css/style.css">
|
<link rel="stylesheet" href="/static/css/style.css">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.7.1/dist/leaflet.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.7.1/dist/leaflet.css" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.css" />
|
||||||
<style>
|
<style>
|
||||||
body, html {
|
body, html {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -52,6 +52,9 @@
|
||||||
var latitude = {{ .Latitude }};
|
var latitude = {{ .Latitude }};
|
||||||
var longitude = {{ .Longitude }};
|
var longitude = {{ .Longitude }};
|
||||||
|
|
||||||
|
L.marker([latitude, longitude]).addTo(map)
|
||||||
|
.bindPopup('{{ .Query }}')
|
||||||
|
|
||||||
function updateMap(latitude, longitude) {
|
function updateMap(latitude, longitude) {
|
||||||
map.setView([latitude, longitude], 13); // Set view to new coordinates
|
map.setView([latitude, longitude], 13); // Set view to new coordinates
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue