diff options
| author | Max Bringemo <maxbr167@student.liu.se> | 2020-11-02 15:54:52 +0100 |
|---|---|---|
| committer | Max Bringemo <maxbr167@student.liu.se> | 2020-11-02 15:54:52 +0100 |
| commit | 5a25e55b0fd59a032c4c85af452bd433427c3890 (patch) | |
| tree | 84252877002e3eec3f58f92d614c225557a21156 /templates | |
| parent | 58f04e8c6d768fc8b912ec1af44442eebac03595 (diff) | |
| download | tdde25-5a25e55b0fd59a032c4c85af452bd433427c3890.tar.gz | |
finished introductory phase
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/index.js b/templates/index.js index b47ab72..b7b3b58 100644 --- a/templates/index.js +++ b/templates/index.js @@ -44,3 +44,20 @@ function handleMapClick ({latlng}){ } map.on('click', handleMapClick) + + +function showMarker(){ + var marker = L.marker([58.3984, 15.5733]).addTo(map) +} + +showMarker() + +async function showMarkers() { + res = await fetch('/show-area'); + res = await res.json(); + for (let key in res) { + var marker = L.marker(res[key]).addTo(map) + } +} + +showMarkers() |
