private void Initialize() { // Initialize the cameras (viewpoints) with two points _zoomedOutCamera = new Camera(_zoomedOutPoint, 42000, 0, 0, 0); _zoomedInCamera = new Camera(_zoomedInPoint, 2500, 90, 75, 0); // Create the scene for displaying the feature layer in static mode Scene staticScene = new Scene(); // Basemap omitted to make it easier to distinguish the rendering modes staticScene.LoadSettings.PreferredPointFeatureRenderingMode = FeatureRenderingMode.Static; staticScene.LoadSettings.PreferredPolygonFeatureRenderingMode = FeatureRenderingMode.Static; staticScene.LoadSettings.PreferredPolylineFeatureRenderingMode = FeatureRenderingMode.Static; // Create the scene for displaying the feature layer in dynamic mode Scene dynamicScene = new Scene(); dynamicScene.LoadSettings.PreferredPointFeatureRenderingMode = FeatureRenderingMode.Dynamic; dynamicScene.LoadSettings.PreferredPolygonFeatureRenderingMode = FeatureRenderingMode.Dynamic; dynamicScene.LoadSettings.PreferredPolylineFeatureRenderingMode = FeatureRenderingMode.Dynamic; // Create the service feature tables ServiceFeatureTable faultTable = new ServiceFeatureTable(new Uri(_featureService + "0")); ServiceFeatureTable contactTable = new ServiceFeatureTable(new Uri(_featureService + "8")); ServiceFeatureTable outcropTable = new ServiceFeatureTable(new Uri(_featureService + "9")); // Create the feature layers FeatureLayer faultLayer = new FeatureLayer(faultTable); FeatureLayer contactLayer = new FeatureLayer(contactTable); FeatureLayer outcropLayer = new FeatureLayer(outcropTable); // Add the layers to each scene staticScene.OperationalLayers.Add(faultLayer); staticScene.OperationalLayers.Add(contactLayer); staticScene.OperationalLayers.Add(outcropLayer); dynamicScene.OperationalLayers.Add(faultLayer.Clone()); dynamicScene.OperationalLayers.Add(contactLayer.Clone()); dynamicScene.OperationalLayers.Add(outcropLayer.Clone()); // Add the scenes to the scene views MyStaticSceneView.Scene = staticScene; MyDynamicSceneView.Scene = dynamicScene; // Set the initial viewpoints for the scenes MyStaticSceneView.SetViewpointCamera(_zoomedOutCamera); MyDynamicSceneView.SetViewpointCamera(_zoomedOutCamera); }
private void Button_Clicked(object sender, EventArgs e) { // Zoom out if zoomed if (_zoomed) { MyStaticSceneView.SetViewpointCameraAsync(_zoomedOutCamera, new TimeSpan(0, 0, 5)); MyDynamicSceneView.SetViewpointCameraAsync(_zoomedOutCamera, new TimeSpan(0, 0, 5)); } else // Zoom in otherwise { MyStaticSceneView.SetViewpointCameraAsync(_zoomedInCamera, new TimeSpan(0, 0, 5)); MyDynamicSceneView.SetViewpointCameraAsync(_zoomedInCamera, new TimeSpan(0, 0, 5)); } // Toggle zoom state _zoomed = !_zoomed; }
private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { // Zoom out if zoomed. if (_zoomed) { MyStaticSceneView.SetViewpointCameraAsync(_zoomedOutCamera, new TimeSpan(0, 0, 5)); MyDynamicSceneView.SetViewpointCameraAsync(_zoomedOutCamera, new TimeSpan(0, 0, 5)); } else // Zoom in otherwise. { MyStaticSceneView.SetViewpointCameraAsync(_zoomedInCamera, new TimeSpan(0, 0, 5)); MyDynamicSceneView.SetViewpointCameraAsync(_zoomedInCamera, new TimeSpan(0, 0, 5)); } // Toggle zoom state. _zoomed = !_zoomed; }