Published
Edited
Nov 7, 2019
2 forks
2 stars
Insert cell
Insert cell
Insert cell
available = {
if ("geolocation" in navigator) {
/* geolocation is available */
return true;
} else {
/* geolocation IS NOT available */
return false;
}
}
Insert cell
Insert cell
position = {
return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resolve, reject, {
enableHighAccuracy: true
});
});
}
Insert cell
Insert cell
Insert cell
Insert cell
currentPosition = Generators.observe(next => {
navigator.geolocation.watchPosition(next, next, {
enableHighAccuracy: true
});
})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more