From 2c36df3d6b951fec4caa6a1a0ffb13d10815faa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20W=C3=B6lpert?= Date: Fri, 1 Jul 2022 12:17:55 +0200 Subject: [PATCH] added first path and coordinates --- src/components/Map.svelte | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/Map.svelte b/src/components/Map.svelte index 3dd82fa..4122553 100644 --- a/src/components/Map.svelte +++ b/src/components/Map.svelte @@ -8,11 +8,22 @@ let div = null; onMount(() => { let map = L.map(div, { - center: [17.385044, 78.486671], - zoom: 10 + center: [49.41607523, 8.67220049], + zoom: 44 + }); - + var latlngs = [ + [49.41607523, 8.67220049], + [49.416224, 8.67174849], + [49.41601524,8.67263096], + [49.41615261,8.67304132], + [49.41592224,8.67258877] + ]; + L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); + //var marker = L.marker([49.41607523,8.67220049]).addTo(map); + var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map); + map.fitBounds(polyline.getBounds()); });