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 _myStaticScene.Scene = staticScene; _myDynamicScene.Scene = dynamicScene; // Set the initial viewpoints for the scenes _myStaticScene.SetViewpointCamera(_zoomedOutCamera); _myDynamicScene.SetViewpointCamera(_zoomedOutCamera); }
private void Initialize() { // Viewpoint locations for map view to zoom in and out to. _zoomOutPoint = new Viewpoint(new MapPoint(-118.37, 34.46, SpatialReferences.Wgs84), 650000, 0); _zoomInPoint = new Viewpoint(new MapPoint(-118.45, 34.395, SpatialReferences.Wgs84), 50000, 90); // Set the Map property of both of the MapViews _myMapViewTop.Map = new Map(); _myMapViewBottom.Map = new Map(); // Set the top map to render all features in static rendering mode _myMapViewTop.Map.LoadSettings.PreferredPointFeatureRenderingMode = FeatureRenderingMode.Static; _myMapViewTop.Map.LoadSettings.PreferredPolylineFeatureRenderingMode = FeatureRenderingMode.Static; _myMapViewTop.Map.LoadSettings.PreferredPolygonFeatureRenderingMode = FeatureRenderingMode.Static; // Set the bottom map to render all features in dynamic rendering mode _myMapViewBottom.Map.LoadSettings.PreferredPointFeatureRenderingMode = FeatureRenderingMode.Dynamic; _myMapViewBottom.Map.LoadSettings.PreferredPolylineFeatureRenderingMode = FeatureRenderingMode.Dynamic; _myMapViewBottom.Map.LoadSettings.PreferredPolygonFeatureRenderingMode = FeatureRenderingMode.Dynamic; // Create service feature table using a point, polyline, and polygon service. ServiceFeatureTable pointServiceFeatureTable = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/0")); ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/8")); ServiceFeatureTable polygonServiceFeatureTable = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9")); // Create feature layer from service feature tables. FeatureLayer pointFeatureLayer = new FeatureLayer(pointServiceFeatureTable); FeatureLayer polylineFeatureLayer = new FeatureLayer(polylineServiceFeatureTable); FeatureLayer polygonFeatureLayer = new FeatureLayer(polygonServiceFeatureTable); // Add each layer to top map. _myMapViewTop.Map.OperationalLayers.Add(pointFeatureLayer.Clone()); _myMapViewTop.Map.OperationalLayers.Add(polylineFeatureLayer.Clone()); _myMapViewTop.Map.OperationalLayers.Add(polygonFeatureLayer.Clone()); // Add each layer to top map. _myMapViewBottom.Map.OperationalLayers.Add(pointFeatureLayer); _myMapViewBottom.Map.OperationalLayers.Add(polylineFeatureLayer); _myMapViewBottom.Map.OperationalLayers.Add(polygonFeatureLayer); // Set the view point of both MapViews. _myMapViewTop.SetViewpoint(_zoomOutPoint); _myMapViewBottom.SetViewpoint(_zoomOutPoint); }
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 { InitialViewpoint = new Viewpoint(_zoomedOutPoint, _zoomedOutCamera) }; // Create the scene for displaying the feature layer in dynamic mode. Scene dynamicScene = new Scene { InitialViewpoint = new Viewpoint(_zoomedOutPoint, _zoomedOutCamera) }; foreach (string identifier in new[] { "8", "9", "0" }) { // Create the table. ServiceFeatureTable serviceTable = new ServiceFeatureTable(new Uri(FeatureService + identifier)); // Create and add the static layer. FeatureLayer staticLayer = new FeatureLayer(serviceTable) { RenderingMode = FeatureRenderingMode.Static }; staticScene.OperationalLayers.Add(staticLayer); // Create and add the dynamic layer. FeatureLayer dynamicLayer = (FeatureLayer)staticLayer.Clone(); dynamicLayer.RenderingMode = FeatureRenderingMode.Dynamic; dynamicScene.OperationalLayers.Add(dynamicLayer); } // Add the scenes to the scene views. MyStaticSceneView.Scene = staticScene; MyDynamicSceneView.Scene = dynamicScene; }
private async void Initialize() { // Set the Map property of both MapViews _myMapViewTop.Map = new Map(); _myMapViewBottom.Map = new Map(); // Set the top map to render all features in static rendering mode _myMapViewTop.Map.LoadSettings.PreferredPointFeatureRenderingMode = FeatureRenderingMode.Static; _myMapViewTop.Map.LoadSettings.PreferredPolylineFeatureRenderingMode = FeatureRenderingMode.Static; _myMapViewTop.Map.LoadSettings.PreferredPolygonFeatureRenderingMode = FeatureRenderingMode.Static; // Set the bottom map to render all features in dynamic rendering mode _myMapViewBottom.Map.LoadSettings.PreferredPointFeatureRenderingMode = FeatureRenderingMode.Dynamic; _myMapViewBottom.Map.LoadSettings.PreferredPolylineFeatureRenderingMode = FeatureRenderingMode.Dynamic; _myMapViewBottom.Map.LoadSettings.PreferredPolygonFeatureRenderingMode = FeatureRenderingMode.Dynamic; // Create service feature table using a point, polyline, and polygon service. ServiceFeatureTable poinServiceFeatureTable = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/0")); ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/8")); ServiceFeatureTable polygonServiceFeatureTable = new ServiceFeatureTable(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9")); // Create feature layer from service feature tables. FeatureLayer pointFeatureLayer = new FeatureLayer(poinServiceFeatureTable); FeatureLayer polylineFeatureLayer = new FeatureLayer(polylineServiceFeatureTable); FeatureLayer polygonFeatureLayer = new FeatureLayer(polygonServiceFeatureTable); // Add each layer to top map. _myMapViewTop.Map.OperationalLayers.Add(pointFeatureLayer.Clone()); _myMapViewTop.Map.OperationalLayers.Add(polylineFeatureLayer.Clone()); _myMapViewTop.Map.OperationalLayers.Add(polygonFeatureLayer.Clone()); // Add each layer to top map. _myMapViewBottom.Map.OperationalLayers.Add(pointFeatureLayer); _myMapViewBottom.Map.OperationalLayers.Add(polylineFeatureLayer); _myMapViewBottom.Map.OperationalLayers.Add(polygonFeatureLayer); // Set the view point of both MapViews. _myMapViewTop.SetViewpoint(_zoomOutPoint); _myMapViewBottom.SetViewpoint(_zoomOutPoint); }