Skip to content

Instantly share code, notes, and snippets.

@vidhav
Created October 13, 2016 07:15
Show Gist options
  • Save vidhav/416173582aa52ae29e8bc42d0529c9b7 to your computer and use it in GitHub Desktop.
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/[email protected]/dist/leaflet.css" rel="stylesheet" />
</head>
<body>
<div id="map" style="height: 400px; width: 600px;"></div>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script>
var map = L.map('map').setView([60.14520081354696, 10.251832008361816], 15);
L.tileLayer('http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo2&zoom={z}&x={x}&y={y}', {
attribution: '<a href="http://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