private void Initialize() { // Create a scene for the sceneview. Scene myScene = new Scene(Basemap.CreateImagery()); _mySceneView.Scene = myScene; // Create a geometry for the ground overlay. Envelope overlayGeometry = new Envelope(-123.066227926904, 44.04736963555683, -123.0796942287304, 44.03878298600624, SpatialReferences.Wgs84); // Create a KML Icon for the overlay image. KmlIcon overlayImage = new KmlIcon(_imageryUri); // Create the KML ground overlay. _overlay = new KmlGroundOverlay(overlayGeometry, overlayImage); // Set the rotation of the ground overlay. _overlay.Rotation = -3.046024799346924; // Create a KML dataset with the ground overlay as the root node. KmlDataset dataset = new KmlDataset(_overlay); // Create a KML layer for the scene view. KmlLayer layer = new KmlLayer(dataset); // Add the layer to the map. _mySceneView.Scene.OperationalLayers.Add(layer); // Move the viewpoint to the ground overlay. _mySceneView.SetViewpoint(new Viewpoint(_overlay.Geometry, new Camera(_overlay.Geometry.Extent.GetCenter(), 1250, 45, 60, 0))); // Set the default value for the slider. _slider.Value = 255; }
private void Initialize() { // Create a scene for the sceneview. Scene myScene = new Scene(Basemap.CreateImagery()); _mySceneView.Scene = myScene; // Create a geometry for the ground overlay. Envelope overlayGeometry = new Envelope(-123.066227926904, 44.04736963555683, -123.0796942287304, 44.03878298600624, SpatialReferences.Wgs84); // Create a KML Icon for the overlay image. KmlIcon overlayImage = new KmlIcon(_imageryUri); // Create the KML ground overlay. KmlGroundOverlay overlay = new KmlGroundOverlay(overlayGeometry, overlayImage); // Set the rotation of the ground overlay. overlay.Rotation = -3.046024799346924; // Create a KML dataset with the ground overlay as the root node. KmlDataset dataset = new KmlDataset(overlay); // Create a KML layer for the scene view. KmlLayer layer = new KmlLayer(dataset); // Add the layer to the map. _mySceneView.Scene.OperationalLayers.Add(layer); // Move the viewpoint to the ground overlay. _mySceneView.SetViewpoint(new Viewpoint(overlay.Geometry, new Camera(overlay.Geometry.Extent.GetCenter(), 1250, 45, 60, 0))); // Add an event handler for the on-screen slider. _slider.ProgressChanged += (s, e) => { // Change the color of the KML ground overlay image to edit the alpha-value. (Other color values are left as-is in the original image.) overlay.Color = System.Drawing.Color.FromArgb(e.Progress, 0, 0, 0); // Display the value. _valueLabel.Text = e.Progress.ToString(); }; }
public void AddGroundOverlay(KmlGroundOverlay overlay) { GroundOverlays.Add(overlay); }