예제 #1
0
        private void Initialize()
        {
            // Create service feature table using a point, polyline, and polygon service.
            ServiceFeatureTable pointServiceFeatureTable    = new ServiceFeatureTable(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/0"));
            ServiceFeatureTable polylineServiceFeatureTable = new ServiceFeatureTable(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/8"));
            ServiceFeatureTable polygonServiceFeatureTable  = new ServiceFeatureTable(new Uri("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9"));

            // Create feature layers from service feature tables
            List <FeatureLayer> featureLayers = new List <FeatureLayer>
            {
                new FeatureLayer(pointServiceFeatureTable),
                new FeatureLayer(polylineServiceFeatureTable),
                new FeatureLayer(polygonServiceFeatureTable)
            };

            // Add each layer to the map as a static layer and a dynamic layer
            foreach (FeatureLayer layer in featureLayers)
            {
                // Add the static layer to the top map view
                layer.RenderingMode = FeatureRenderingMode.Static;
                MyMapViewTop.Map.OperationalLayers.Add(layer);

                // Add the dynamic layer to the bottom map view
                FeatureLayer dynamicLayer = (FeatureLayer)layer.Clone();
                dynamicLayer.RenderingMode = FeatureRenderingMode.Dynamic;
                MyMapViewBottom.Map.OperationalLayers.Add(dynamicLayer);
            }

            // Set the view point of both MapViews.
            MyMapViewTop.SetViewpoint(_zoomOutPoint);
            MyMapViewBottom.SetViewpoint(_zoomOutPoint);
        }
        private void Initialize()
        {
            // 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);
        }