Go back to blogs

Making ISS 🛰️ tracker using Leaflet and Svelte V2

sveltejavascriptshowdev

Oct 10 '20

A few months ago I made an ISS tracker and it had too many lines of code although easy it wasn't beginner-friendly so a month ago I started to work on making a user-friendly svelte wrapper for leafletjs which reduces the complexity drastically! check out the demo here

Quick start guide

Install via npm i npm i @anoram/leaflet-svelte.

<script>
import Map from '@anoram/leaflet-svelte'
let options={
  center: [13,80],
  markers: [
    {
      lat: 13,
      lng: 80
    }
  ],
  mapID: "map"
}
</script>
<style>
  .map {
    height: 600px;
    width: auto;
  }
</style>
<div class="map">
  <Map {options} />
</div>
Enter fullscreen mode Exit fullscreen mode

Svelte REPL: https://svelte.dev/repl/a6a5c969aaf544018e5a4a9d7ea9e031?version=3.29.0

An updated version of ISS Tracker https://iss.anoram.com/

Repo here https://github.com/peopledrivemecrazy/svelte-iss

Enjoy!

Comments