←Examples

Multiple tileLayer @0.0.7^

Regarding Support for multiple layers #1 tileLayer supplied as array of tielayer. This is introducing a breaking change and affects versions <0.0.6.

<script>
  import Map from "@anoram/leaflet-svelte";
  let options = {
    center: [13, 80],
    zoom: 15,
    mapID: "map",
    markers: [
      {
        lat: 13,
        lng: 80,
      },
    ],
    tilelayers: [
      {
        url: "//{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
        maxZoom: 36,
        subdomains: ["mt0", "mt1", "mt2", "mt3"],
        attribution: "yyy",
        minZoom: 5,
        opacity: 0.5,
      },
      {
        url: "//{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}",
        maxZoom: 36,
        subdomains: ["mt0", "mt1", "mt2", "mt3"],
        attribution: "zzz",
        minZoom: 5,
        opacity: 0.2,
      },
    ],
  };
  
</script>

<style>
  .map {
    height: 600px;
    width: auto;
  }

</style>


<div class="map">
  <Map {options} />
</div>

Note

This change has effect on themes example and is updated.