Skip to content

Instantly share code, notes, and snippets.

@vidhav
Last active December 10, 2025 12:56
Show Gist options
  • Select an option

  • Save vidhav/416173582aa52ae29e8bc42d0529c9b7 to your computer and use it in GitHub Desktop.

Select an option

Save vidhav/416173582aa52ae29e8bc42d0529c9b7 to your computer and use it in GitHub Desktop.
Eksempel på oppsett av Leaflet med kart fra Kartverket.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Leaflet med norske kart</title>
<link href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" rel="stylesheet" />
</head>
<body>
<div id="map" style="height: 400px; width: 600px;"></div>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<script>
var map = L.map('map').setView([60.143851, 10.2489956], 15);
L.tileLayer('https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png', {
attribution: '<a href="https://www.kartverket.no/">Kartverket</a>'
}).addTo(map);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment