Commit f0f1d345 authored by Rushikesh Padsala's avatar Rushikesh Padsala
Browse files

changed default basemap and camera view App.js

parent 160d6515
Pipeline #1297 passed with stage
in 2 seconds
...@@ -11,13 +11,16 @@ ...@@ -11,13 +11,16 @@
animation: false, animation: false,
shadow: false, shadow: false,
// // Set default basemap // // Set default basemap
imageryProvider : new Cesium.MapboxImageryProvider({ imageryProvider : new Cesium.BingMapsImageryProvider({
mapId: 'mapbox.streets' url : 'https://dev.virtualearth.net',
key : 'ArfoC16LZfs9KzyU-OJyXSqVI6a9-Swv-cq7oO6e2bWYqZOS8M77coukVzeYDyLA',
mapStyle : Cesium.BingMapsStyle.AERIAL
}), }),
baseLayerPicker: true baseLayerPicker: true
}); });
viewer.clock.shouldAnimate = false; viewer.clock.shouldAnimate = false;
viewer.scene.globe.enableLighting = false;
viewer.clock.startTime = Cesium.JulianDate.fromIso8601("2019-09-20T13:00:00Z"); viewer.clock.startTime = Cesium.JulianDate.fromIso8601("2019-09-20T13:00:00Z");
viewer.clock.stopTime = Cesium.JulianDate.fromIso8601("2019-09-20T13:20:00Z"); viewer.clock.stopTime = Cesium.JulianDate.fromIso8601("2019-09-20T13:20:00Z");
viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2019-09-20T13:00:00Z"); viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("2019-09-20T13:00:00Z");
...@@ -27,23 +30,36 @@ ...@@ -27,23 +30,36 @@
// Configuring the camera // Configuring the camera
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// // Create an initial camera view // // Create an initial camera view
var initialPosition = Cesium.Rectangle.fromDegrees(-73.9907, 40.6776, -73.9856, 40.6809); var initialPosition = Cesium.Cartesian3.fromDegrees(-73.993092, 40.655215, 600);
//var initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees(1.0820674827650922, -0.6183562882750495, 0.003599879447971688); var initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees(354, -20, 0);
var homeCameraView = { var homeCameraView = {
destination : initialPosition destination : initialPosition,
//orientation : initialOrientation, orientation : {
//endTransform: Cesium.Matrix4.IDENTITY heading : initialOrientation.heading,
pitch : initialOrientation.pitch,
roll : initialOrientation.roll
}
}; };
// // Set the initial view // // Set the initial view
viewer.scene.camera.setView(homeCameraView); viewer.scene.camera.setView(homeCameraView);
console.log (Cesium.Rectangle.fromDegrees);
// set home button to initial view // set home button to initial view
viewer.homeButton.viewModel.command.beforeExecute.addEventListener(function (e) { viewer.homeButton.viewModel.command.beforeExecute.addEventListener(function (e) {
e.cancel = true; e.cancel = true;
viewer.scene.camera.flyTo(homeCameraView); viewer.scene.camera.flyTo(homeCameraView);
}); });
console.log (viewer.scene.camera); viewer.camera.changed.addEventListener(function() {
var deg = Math.round( Cesium.Math.toDegrees(viewer.camera.heading))
console.log('Heading:', deg)
var deg = Math.round( Cesium.Math.toDegrees(viewer.camera.pitch))
console.log('Pitch:', deg)
var deg = Math.round( Cesium.Math.toDegrees(viewer.camera.roll))
console.log('Roll:', deg)
});
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Loading GeoJSON with polygon outline - strokewidth is an issue with windows // Loading GeoJSON with polygon outline - strokewidth is an issue with windows
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment