LayerCollection Class |
Namespace: Esri.ArcGISRuntime.Mapping
public class LayerCollection : RuntimeObservableCollection<Layer>
The LayerCollection type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | LayerCollection |
Initializes a new instance of the LayerCollection class.
|
Name | Description | |
---|---|---|
![]() ![]() | Count | Gets the number of elements contained in the RuntimeCollectionT. (Inherited from RuntimeCollectionT.) |
![]() | IsReadOnly | Gets a value indicating whether the collection is read-only. (Inherited from RuntimeCollectionT.) |
![]() ![]() | ItemInt32 | Gets or sets the element at the specified index. (Inherited from RuntimeCollectionT.) |
![]() | ItemString |
Gets a layer in the collection by its Id.
|
Name | Description | |
---|---|---|
![]() ![]() | Add | Adds an item to the collection. (Inherited from RuntimeCollectionT.) |
![]() | AddRange |
Adds the elements of the specified collection to the end of the RuntimeCollectionT.
(Inherited from RuntimeObservableCollectionT.) |
![]() | BlockReentrancy |
Disallow reentrant attempts to change this collection. E.g. a event handler
of the CollectionChanged event is not allowed to make changes to this collection.
(Inherited from RuntimeObservableCollectionT.) |
![]() | CheckReentrancy | Check and assert for reentrant attempts to change this collection. (Inherited from RuntimeObservableCollectionT.) |
![]() ![]() | Clear | Removes all items from the collection (Inherited from RuntimeCollectionT.) |
![]() | ClearItems |
Called by base class Collection<T> when the list is being cleared;
raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.) |
![]() ![]() | Contains | Determines whether the collection contains a specific value. (Inherited from RuntimeCollectionT.) |
![]() | CopyTo | (Inherited from RuntimeCollectionT.) |
![]() ![]() | GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from RuntimeCollectionT.) |
![]() ![]() | IndexOf | Determines the index of a specific item in the collection. (Inherited from RuntimeCollectionT.) |
![]() ![]() | Insert | Inserts an item to the collection at the specified index. (Inherited from RuntimeCollectionT.) |
![]() | InsertItem |
Called by base class Collection<T> when an item is added to list;
raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.) |
![]() | Move | Moves the item at the specified index to a new location in the collection. (Inherited from RuntimeCollectionT.) |
![]() | MoveItem |
Called by base class ObservableCollection<T> when an item is to be moved within the list;
raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.) |
![]() | OnCollectionChanged |
Raises the CollectionChanged event with the provided arguments.
(Inherited from RuntimeObservableCollectionT.) |
![]() | OnPropertyChanged |
Raises a PropertyChanged event (per INotifyPropertyChanged).
(Inherited from RuntimeObservableCollectionT.) |
![]() ![]() | Remove | Removes the first occurrence of a specific object from the collection (Inherited from RuntimeCollectionT.) |
![]() ![]() | RemoveAt | Removes the item at the specified index. (Inherited from RuntimeCollectionT.) |
![]() | RemoveItem |
Called by base class Collection<T> when an item is removed from list;
raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.) |
![]() | SetItem |
Called by base class Collection<T> when an item is set in list;
raises a CollectionChanged event to any listeners.
(Inherited from RuntimeObservableCollectionT.) |
Name | Description | |
---|---|---|
![]() ![]() | CollectionChanged |
Occurs when the collection changes, either by adding or removing an item.
(Inherited from RuntimeObservableCollectionT.) |
![]() | PropertyChanged |
Do not use.
(Inherited from RuntimeObservableCollectionT.) |
Android
Example Name: RasterLayerFile
Create and use a raster layer made from a local raster file.
// Copyright 2017 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific // language governing permissions and limitations under the License. using System; using Android.App; using Android.OS; using Android.Widget; using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.Rasters; using Esri.ArcGISRuntime.UI.Controls; using ArcGISRuntime.Samples.Managers; namespace ArcGISRuntime.Samples.RasterLayerFile { [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)] [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("7c4c679ab06a4df19dc497f577f111bd")] [ArcGISRuntime.Samples.Shared.Attributes.Sample( name: "Raster layer (file)", category: "Layers", description: "Create and use a raster layer made from a local raster file.", instructions: "When the sample starts, a raster will be loaded from a file and displayed in the map view.", tags: new[] { "data", "image", "import", "layer", "raster", "visualization" })] public class RasterLayerFile : Activity { // Reference to the MapView used in the sample private MapView _myMapView; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Title = "Raster layer (file)"; // Create the layout CreateLayout(); // Initialize the app Initialize(); } private void CreateLayout() { // Create a stack layout LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical }; // Add the mapview to the layout _myMapView = new MapView(this); layout.AddView(_myMapView); // Set the layout as the sample view SetContentView(layout); } private async void Initialize() { // Add an imagery basemap Map myMap = new Map(Basemap.CreateImagery()); // Get the file name string filepath = GetRasterPath(); // Load the raster file Raster myRasterFile = new Raster(filepath); // Create the layer RasterLayer myRasterLayer = new RasterLayer(myRasterFile); // Add the layer to the map myMap.OperationalLayers.Add(myRasterLayer); // Add map to the mapview _myMapView.Map = myMap; try { // Wait for the layer to load await myRasterLayer.LoadAsync(); // Set the viewpoint await _myMapView.SetViewpointGeometryAsync(myRasterLayer.FullExtent); } catch (Exception e) { new AlertDialog.Builder(this).SetMessage(e.ToString()).SetTitle("Error").Show(); } } private string GetRasterPath() { return DataManager.GetDataFolder("7c4c679ab06a4df19dc497f577f111bd", "raster-file", "Shasta.tif"); } } }
Xamarin Forms Android
Example Name: RasterLayerGeoPackage
Display a raster contained in a GeoPackage.
// Copyright 2017 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific // language governing permissions and limitations under the License. using System; using ArcGISRuntime.Samples.Managers; using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.Rasters; using System.Linq; using Xamarin.Forms; namespace ArcGISRuntime.Samples.RasterLayerGeoPackage { [ArcGISRuntime.Samples.Shared.Attributes.Sample( name: "Raster layer (GeoPackage)", category: "Data", description: "Display a raster contained in a GeoPackage.", instructions: "When the sample starts, a raster will be loaded from a GeoPackage and displayed in the map view.", tags: new[] { "OGC", "container", "data", "image", "import", "layer", "package", "raster", "visualization" })] [ArcGISRuntime.Samples.Shared.Attributes.OfflineData("68ec42517cdd439e81b036210483e8e7")] public partial class RasterLayerGeoPackage : ContentPage { public RasterLayerGeoPackage() { InitializeComponent(); // Read data from the GeoPackage Initialize(); } private async void Initialize() { // Create a new map MyMapView.Map = new Map(Basemap.CreateLightGrayCanvas()); // Get the full path string geoPackagePath = GetGeoPackagePath(); try { // Open the GeoPackage GeoPackage myGeoPackage = await GeoPackage.OpenAsync(geoPackagePath); // Read the raster images and get the first one Raster gpkgRaster = myGeoPackage.GeoPackageRasters.FirstOrDefault(); // Make sure an image was found in the package if (gpkgRaster == null) { return; } // Create a layer to show the raster RasterLayer newLayer = new RasterLayer(gpkgRaster); await newLayer.LoadAsync(); // Set the viewpoint await MyMapView.SetViewpointAsync(new Viewpoint(newLayer.FullExtent)); // Add the image as a raster layer to the map (with default symbology) MyMapView.Map.OperationalLayers.Add(newLayer); } catch (Exception e) { await Application.Current.MainPage.DisplayAlert("Error", e.ToString(), "OK"); } } private static string GetGeoPackagePath() { return DataManager.GetDataFolder("68ec42517cdd439e81b036210483e8e7", "AuroraCO.gpkg"); } } }
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms" xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" x:Class="ArcGISRuntime.Samples.RasterLayerGeoPackage.RasterLayerGeoPackage"> <esriUI:MapView x:Name="MyMapView"/> </ContentPage>
Hyperlink to Example | Description |
---|---|
AddAnIntegratedMeshLayer | View an integrated mesh layer from a scene service. |
AddEncExchangeSet | Display nautical charts per the ENC specification. |
AddFeatures | Add features to a feature layer. |
AddPointSceneLayer | View a point scene layer from a scene service. |
AnalyzeHotspots | Use a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots. |
ArcGISMapImageLayerUrl | Add an ArcGIS Map Image Layer from a URL to a map. |
ArcGISTiledLayerUrl | Load an ArcGIS tiled layer from a URL. |
AuthorMap | Create and save a map as an ArcGIS `PortalItem` (i.e. web map). |
BrowseWfsLayers | Browse a WFS service for layers and add them to the map. |
BufferList | Generate multiple individual buffers or a single unioned buffer around multiple points. |
ChangeEncDisplaySettings | Configure the display of ENC content. |
ChangeFeatureLayerRenderer | Change the appearance of a feature layer with a renderer. |
ChangeStretchRenderer | Use a stretch renderer to enhance the visual contrast of raster data for analysis. |
ChangeSublayerRenderer | Apply a renderer to a sublayer. |
ChangeSublayerVisibility | Change the visibility of sublayers. |
ChangeTimeExtent | Filter data in layers by applying a time extent to a MapView. |
ChangeViewpoint | Set the map view to a new viewpoint. |
ClosestFacilityStatic | Find routes from several locations to the respective closest facility. |
ControlAnnotationSublayerVisibility | Use annotation sublayers to gain finer control of annotation layer subtypes. |
CreateAndSaveKmlFile | Construct a KML document and save it as a KMZ file. |
CreateFeatureCollectionLayer | Create a Feature Collection Layer from a Feature Collection Table, and add it to a map. |
CustomDictionaryStyle | Use a custom dictionary style (.stylx) to symbolize features using a variety of attribute values. |
DeleteFeatures | Delete features from an online feature service. |
DisplayAnnotation | Display annotation from a feature service URL. |
DisplayDrawingStatus | Get the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing. |
DisplayKml | Display KML from a URL, portal item, or local KML file. |
DisplayKmlNetworkLinks | Display a file with a KML network link, including displaying any network link control messages at launch. |
DisplayLayerViewState | Determine if a layer is currently being viewed. |
DisplaySubtypeFeatureLayer | Displays a composite layer of all the subtype values in a feature class. |
DisplayUtilityAssociations | Create graphics for utility associations in a utility network. |
DisplayWfs | Display a layer from a WFS service, requesting only features for the current extent. |
DistanceMeasurement | Measure distances between two points in 3D. |
EditAndSyncFeatures | Synchronize offline edits with a feature service. |
EditFeatureAttachments | Add, delete, and download attachments for features from a service. |
EditKmlGroundOverlay | Edit the values of a KML ground overlay. |
FeatureCollectionLayerFromPortal | Create a feature collection layer from a portal item. |
FeatureCollectionLayerFromQuery | Create a feature collection layer to show a query result from a service feature table. |
FeatureLayerDefinitionExpression | Limit the features displayed on a map with a definition expression. |
FeatureLayerDictionaryRenderer | Convert features into graphics to show them with mil2525d symbols. |
FeatureLayerExtrusion | Extrude features based on their attributes. |
FeatureLayerGeodatabase | Display features from a local geodatabase. |
FeatureLayerGeoPackage | Display features from a local GeoPackage. |
FeatureLayerQuery | Find features in a feature table which match an SQL query. |
FeatureLayerRenderingModeMap | Render features statically or dynamically by setting the feature layer rendering mode. |
FeatureLayerRenderingModeScene | Render features in a scene statically or dynamically by setting the feature layer rendering mode. |
FeatureLayerSelection | Select features in a feature layer. |
FeatureLayerShapefile | Open a shapefile stored on the device and display it as a feature layer with default symbology. |
FeatureLayerTimeOffset | Display a time-enabled feature layer with a time offset. |
FeatureLayerUrl | Show features from an online feature service. |
FindServiceAreasForMultipleFacilities | Find the service areas of several facilities from a feature service. |
GenerateGeodatabase | Generate a local geodatabase from an online feature service. |
GenerateOfflineMapWithOverrides | Take a web map offline with additional options for each layer. |
GeodatabaseTransactions | Use transactions to manage how changes are committed to a geodatabase. |
GroupLayers | Group a collection of layers together and toggle their visibility as a group. |
IdentifyKmlFeatures | Show a callout with formatted content for a KML feature. |
IdentifyLayers | Identify features in all layers in a map. MapView supports identifying features across multiple layers. Because some layer types have sublayers, the sample recursively counts results for sublayers within each layer. |
IdentifyRasterCell | Get the cell value of a local raster at the tapped location and display the result in a callout. |
LineOfSightGeoElement | Show a line of sight between two moving objects. |
ListKmlContents | List the contents of a KML file. |
ListRelatedFeatures | List features related to the selected feature. |
ManageOperationalLayers | Add, remove, and reorder operational layers in a map. |
MapImageLayerTables | Find features in a spatial table related to features in a non-spatial table. |
MapImageSublayerQuery | Find features in a sublayer based on attributes and location. |
PerformValveIsolationTrace | Run a filtered trace to locate operable features that will isolate an area from the flow of network resources. |
PlayKmlTours | Play tours in KML files. |
QueryFeatureCountAndExtent | Zoom to features matching a query and count the features in the current visible extent. |
RasterColormapRenderer | Apply a colormap renderer to a raster. |
RasterHillshade | Use a hillshade renderer on a raster. |
RasterLayerFile | Create and use a raster layer made from a local raster file. |
RasterLayerGeoPackage | Display a raster contained in a GeoPackage. |
RasterLayerImageServiceRaster | Create a raster layer from a raster image service. |
RasterLayerRasterFunction | Load a raster from a service, then apply a function to it. |
RasterRenderingRule | Display a raster on a map and apply different rendering rules to that raster. |
RasterRgbRenderer | Apply an RGB renderer to a raster layer to enhance feature visibility. |
ReadGeoPackage | Add rasters and feature tables from a GeoPackage to a map. |
ReadShapefileMetadata | Read a shapefile and display its metadata. |
RenderUniqueValues | Render features in a layer using a distinct symbol for each unique attribute value. |
SceneLayerSelection | Identify features in a scene to select. |
SceneLayerUrl | Display an ArcGIS scene layer from a URL. |
SelectEncFeatures | Select features in an ENC layer. |
ServiceFeatureTableCache | Display a feature layer from a service using the **on interaction cache** feature request mode. |
ServiceFeatureTableManualCache | Display a feature layer from a service using the **manual cache** feature request mode. |
ServiceFeatureTableNoCache | Display a feature layer from a service using the **no cache** feature request mode. |
SetMapSpatialReference | Specify a map's spatial reference. |
ShowLabelsOnLayer | Display custom labels on a feature layer. |
ShowPopup | Show predefined popups from a web map. |
StatisticalQuery | Query a table to get aggregated statistics back for a specific field. |
StyleWmsLayer | Change the style of a Web Map Service (WMS) layer. |
SurfacePlacements | Position graphics relative to a surface using different surface placement modes. |
SymbolizeShapefile | Display a shapefile with custom symbology. |
TimeBasedQuery | Query data using a time extent. |
TokenSecuredChallenge | This sample demonstrates how to prompt the user for a username and password to authenticate with ArcGIS Server to access an ArcGIS token-secured service. Accessing secured services requires a login that's been defined on the server. |
TraceUtilityNetwork | Discover connected features in a utility network using connected, subnetwork, upstream, and downstream traces. |
UpdateAttributes | Update feature attributes in an online feature service. |
UpdateGeometries | Update a feature's location in an online feature service. |
ViewPointCloudDataOffline | Display local 3D point cloud data. |
ViewshedCamera | Analyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point. |
ViewshedGeoElement | Analyze the viewshed for an object (GeoElement) in a scene. |
ViewshedLocation | Perform a viewshed analysis from a defined vantage point. |
WfsXmlQuery | Load a WFS feature table using an XML query. |
WmsIdentify | Identify features in a WMS layer and display the associated popup content. |
WMSLayerUrl | Display a WMS layer using a WMS service URL. |
WmsServiceCatalog | Connect to a WMS service and show the available layers and sublayers. |
WMTSLayer | Display a layer from a Web Map Tile Service. |