-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquake.js
35 lines (29 loc) · 1 KB
/
quake.js
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
// var quakeLayer;
var quakeData;
var ql;
var quakeAttrib = 'Earthquake data © <a href="https://earthquake.usgs.gov/">USGS</a>';
function onEachFeatureQuake(feature, layer) {
var popupText = "Magnitude: " + feature.properties.mag
+ "<br>Location: " + feature.properties.place
+ "<br><a href='" + feature.properties.url + "'>More info</a>";
layer.bindPopup(popupText);
// }
// });
}
// quakeLayer = function() {
// $.getJSON("https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson", function(data) {
// // addDataToMap(data, layer);
// quakeData = data;
// ql = L.geoJson(quakeData, {
// onEachFeature: onEachFeatureQuake
// });
// });
function quakeLayer() {
$.getJSON("https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson", function(data) {
// addDataToMap(data, layer);
quakeData = data;
ql = L.geoJson(quakeData, {
onEachFeature: onEachFeatureQuake
});
});
}