gfw-api/true-color-tiles

View on GitHub
index.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
    <title>Quick Start - Leaflet</title>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <link href="docs/images/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" rel="stylesheet">
    <script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-hash/0.2.1/leaflet-hash.min.js"></script>
</head>
<body>
    <div id="mapid" style="width: 800px; height: 600px;"></div>
    <script>

       var mymap = L.map('mapid').setView([15, -60], 4);
         var hash = new L.Hash(mymap);

           // comment to restart the build
       L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
       maxZoom: 19,
    }).addTo(mymap);

       var loss = L.tileLayer('http://localhost:9000/v1/true-color-tiles/loss/{z}/{x}/{y}?thresh=75&startYear=2010&endYear=2016', {
           maxZoom:19
       })

       var glad = L.tileLayer('http://localhost:9000/v1/true-color-tiles/glad/{z}/{x}/{y}', {
           maxZoom:19
       }).addTo(mymap)

       L.control.layers({'Loss': loss,
                                             'GLAD': glad}, null).addTo(mymap);


        var aoi = {"type":"FeatureCollection","features":[{"geometry":{"coordinates":[[[-69.9609375,-13.068776734357689],[-69.9609375,-12.983147716796571],[-69.873046875,-12.983147716796571],[-69.873046875,-13.068776734357689],[-69.9609375,-13.068776734357689]]],"type":"Polygon"},"properties":{"title":"XYZ tile (1252, 2197, 12)"},"type":"Feature"}]}
        L.geoJSON(aoi).addTo(mymap);

    </script>
</body>
</html>