-
Notifications
You must be signed in to change notification settings - Fork 0
/
iframe.html
79 lines (71 loc) · 2.23 KB
/
iframe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base target="_parent">
<link href="http://www.nps.gov/lib/bootstrap/3.3.2/css/nps-bootstrap.css" rel="stylesheet">
<style>
html, body, #map {
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}
#map {
left: 0;
position: absolute;
top: 0;
}
div.leaflet-container .leaflet-control-attribution {
display:none !important;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var $ = window.parent.$,
NPMap = JSON.parse(JSON.stringify(parent.NPMap)),
mapId = JSON.parse(JSON.stringify(parent.App)).mapId,
cluster = $('#fulcrum-cluster');
NPMap.hooks = {
init: function(callback) {
var $currentLat = $('#current-lat'),
$currentLng = $('#current-lng'),
$currentZoom = $('#current-zoom'),
map = NPMap.config.L,
zoom = $('#fulcrum-zoom, #navbar-title');
function updateCurrent() {
var latLng = map.getCenter();
$currentLat.html(latLng.lat.toFixed(2));
$currentLng.html(latLng.lng.toFixed(2));
$currentZoom.html(map.getZoom());
}
zoom.on('click', function() {
$('#fulcrum-zoom').css('background-color','#ddd');
map.fitBounds(NPMap.config.overlays[0].L.getBounds());
$('.setup.buttons')[3].style.backgroundColor = 'rgba(59,178,208,1)';
return false;
});
// NPMap.config.overlays[0].L.eachLayer( function(layer){
// if (layer._latlng.lat === 0) {
// map.removeLayer(layer);
// layer.clearLayers
// }
// });
map.on('moveend', updateCurrent);
updateCurrent();
callback();
}
};
if (NPMap.baseLayers === undefined || NPMap.baseLayers.length === 0){
NPMap.baseLayers = ['cartodb-positron'];
};
(function() {
var s = document.createElement('script');
s.src = 'http://www.nps.gov/lib/npmap.js/2.0.0/npmap-bootstrap.js';
document.body.appendChild(s);
})();
</script>
</body>
</html>