Tremblements de terre

Tremblements depuis 1900

Carte des tremblements de terre depuis 1900.

Retour

Code Javascript

const width = "100%", height = "100%";

var graph = document.getElementById('graph');
graph.style.height = height;
graph.style.width = width;


var Esri_WorldImagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
    attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
});


d3.json(window.location.origin+"/storage/datas/6198d53eadd48-from1901to2014.json")
.then(function(eqs) {
var heatMapData = [];
    eqs.features.forEach(function(d) {
        heatMapData.push(new L.latLng(
            +d.geometry.coordinates[1], 
            +d.geometry.coordinates[0],
            +d.properties.title.substring(2, 5) / 10));
    });

	buildMap("graph", Esri_WorldImagery, heatMapData);
});


function buildMap(divId, tileLayer, datas) {
	var map = L.map(divId).setView([0, 40], 2);
	map.addLayer(tileLayer);
	var heatLayer = L.heatLayer(datas, {maxZoom: 12, minOpacity: 1, radius: 6, blur: 8, max: 1.0});
    map.addLayer(heatLayer);
}