<script>
    
  // leaaflet map
    import * as L from 'leaflet';
    import '../../node_modules/leaflet/dist/leaflet.css'; // It might be better to use postcss.
    import { onMount } from 'svelte';
  
      let div = null;
      onMount(() => {
          let map = L.map(div, {
              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());
      });
  
  </script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<main>
<div bind:this={div} id="map"></div>
</main>

<style>
    :root {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
  
    main {
      text-align: center;
      padding: 1em;
      margin: 0 auto;
    }
  
    img {
      height: 16rem;
      width: 16rem;
    }
  
    h1 {
      color: #ff3e00;
      text-transform: uppercase;
      font-size: 4rem;
      font-weight: 100;
      line-height: 1.1;
      margin: 2rem auto;
      max-width: 14rem;
    }
  
    p {
      max-width: 14rem;
      margin: 1rem auto;
      line-height: 1.35;
    }
  
    @media (min-width: 480px) {
      h1 {
        max-width: none;
      }
  
      p {
        max-width: none;
      }
    }
  
  /* leaflet css*/
  #map { height: 800px; width: 1400px;  }
   
  
  </style>