-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.html
More file actions
executable file
·120 lines (103 loc) · 3.53 KB
/
Copy pathdefault.html
File metadata and controls
executable file
·120 lines (103 loc) · 3.53 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<title>GeoJSON tutorial - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js" integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg==" crossorigin=""></script>
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id='map'></div>
<!--<script src="sample-geojson.js" type="text/javascript"></script>-->
<script type="text/javascript" src="leaflet.ajax.min.js"></script>
<script>
var map = L.map('map').setView([39.74739, -105], 3);
// $("#map").height($(window).height()).width($(window).width());
map.invalidateSize();
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);
// var jsonTest = new L.GeoJSON.AJAX(["colleges.geojson","counties.geojson"],{onEachFeature:popUp}).addTo(m);
var geojsonLayer = L.geoJson.ajax("https:www.fema.gov/api/open/v1/FemaRegions?$format=geojson");
fetch('https://www.fema.gov/api/open/v1/FemaRegions?$format=geojson')
.then(function(response) { return response.json(); })
.then(function(json) {
L.geoJSON(json.FemaRegions).addTo(map);
});
// var baseballIcon = L.icon({
// iconUrl: 'baseball-marker.png',
// iconSize: [32, 37],
// iconAnchor: [16, 37],
// popupAnchor: [0, -28]
// });
// function onEachFeature(feature, layer) {
// var popupContent = "<p>I started out as a GeoJSON " +
// feature.geometry.type + ", but now I'm a Leaflet vector!</p>";
//
// if (feature.properties && feature.properties.popupContent) {
// popupContent += feature.properties.popupContent;
// }
//
// layer.bindPopup(popupContent);
// }
//
// L.geoJSON([bicycleRental, campus], {
//
// style: function (feature) {
// return feature.properties && feature.properties.style;
// },
//
// onEachFeature: onEachFeature,
//
// pointToLayer: function (feature, latlng) {
// return L.circleMarker(latlng, {
// radius: 8,
// fillColor: "#ff7800",
// color: "#000",
// weight: 1,
// opacity: 1,
// fillOpacity: 0.8
// });
// }
// }).addTo(map);
//
// L.geoJSON(freeBus, {
//
// filter: function (feature, layer) {
// if (feature.properties) {
// // If the property "underConstruction" exists and is true, return false (don't render features under construction)
// return feature.properties.underConstruction !== undefined ? !feature.properties.underConstruction : true;
// }
// return false;
// },
//
// onEachFeature: onEachFeature
// }).addTo(map);
//
// var coorsLayer = L.geoJSON(coorsField, {
//
// pointToLayer: function (feature, latlng) {
// return L.marker(latlng, {icon: baseballIcon});
// },
//
// onEachFeature: onEachFeature
// }).addTo(map);
</script>
</body>
</html>