The plan is to have a cesium-based globe where clicking on the globe produces a lat/lon value, which in turn is used to generate a HWITW URI that can load the time series graph for that point. This would be displayed in a pane in Cesium.
Here's some sample code for getting the lat/lon value in Cesium:
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.canvas.addEventListener('click', function (e) {
var mousePosition = new Cesium.Cartesian2(e.clientX, e.clientY);
var ellipsoid = viewer.scene.globe.ellipsoid;
var cartesian = viewer.camera.pickEllipsoid(mousePosition, ellipsoid);
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
var longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(2);
var latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(2);
alert(longitudeString + ', ' + latitudeString);
} else {
alert('Globe was not picked');
}
}, false);
The plan is to have a cesium-based globe where clicking on the globe produces a lat/lon value, which in turn is used to generate a HWITW URI that can load the time series graph for that point. This would be displayed in a pane in Cesium.
Here's some sample code for getting the lat/lon value in Cesium: