Created
June 2, 2018 16:14
-
-
Save mapsmania/d4a8e9874e1ea118a6cb5dc720882ecf to your computer and use it in GitHub Desktop.
Maps with New Zealand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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([-24.7822262,138.0143796], 4); | |
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { | |
attribution: '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <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([-41.7012716,173.0267141], 4); | |
map2.removeControl(map2.zoomControl); | |
map2.dragging.disable(); | |
L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { | |
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