Built with blockbuilder.org
Last active
August 25, 2022 02:04
-
-
Save biovisualize/5ef4011f86665aa1d72175c9367b1520 to your computer and use it in GitHub Desktop.
Planet OS point API basic demo
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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<style> | |
</style> | |
</head> | |
<body> | |
<div class="container"></div> | |
<script> | |
// Just grab your API key from http://data.planetos.com/account/settings/ | |
var API_KEY = 'd7d0466b16e24b7084d0c97ea8343762'; | |
d3.json('http://api.planetos.com/v1/datasets/noaa_ww3_global_1.25x1d/point?lon=-50.5&lat=49.5&apikey='+API_KEY, function(error, json){ | |
console.log(json); | |
var html = '<ul>'; | |
json.entries.forEach(function(d, i){ | |
d3.entries(d.data).forEach(function(dB, iB){ | |
html += '<li>' + dB.key + ': ' + dB.value + '</li>'; | |
}); | |
}); | |
html += '</ul>'; | |
document.querySelector('.container').innerHTML = html | |
}); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment