Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unboxing the Shetlands
<!DOCTYPE html>
<html>
<head>
<title>Maps with New Zealand</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
width: 100%;
}
#map2 {
position: fixed;
width: 400px;
height: 220px;
right: 10px;
bottom: 20px;
z-index: 2;
border: 4px solid;
}
</style>
</head>
<body>
<div id="map" style="z-index:0";></div>
<div id="map2" ></div>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<script>
var map = L.map('map').setView([60.3133164,-1.1096393], 8);
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>.'
}).addTo(map);
L.polygon([
[-32.8745737,160.1507374],
[-34.3022127,180.3600048],
[-49.535595,174.4049265],
[-49.3069068,160.5013235]
], {
color: '#D4DADC',
fillColor: '#D4DADC',
fillOpacity: 1
}
).addTo(map);
var map2 = L.map('map2').setView([56.7800308,-4.0853518], 5);
map2.removeControl(map2.zoomControl);
map2.dragging.disable();
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: 'Esri'
}).addTo(map2);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment