PowerPan/leaflet.nauticscale

View on GitHub
example/index.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
    <title>Nautic Scale example</title>
    <meta charset="utf-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="../components/leaflet/dist/leaflet.css" />
</head>
<body>
<div id="map" style="left: 0; right: 0; top: 0; bottom: 0;position: fixed"></div>
<script src="../components/leaflet/dist/leaflet.js"></script>
<script src="../src/leaflet.nauticscale.js"></script>
<script>
    var course = 0.0;
    var position = L.latLng(54.15, 8.0);
    var map = L.map('map');

    map.setView(position, 10);
    var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
    L.tileLayer(osmUrl, {
        maxZoom: 18
    }).addTo(map);

    map.addControl(new L.Control.ScaleNautic({
        metric: true,
        imperial: true,
        nautic: true
    }));


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