Click or drag to resize

ArcGISMapImageLayer Class

This class allows you to display data from an ArcGIS Map service by using dynamically generated map images.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.9.0.0
Syntax
C#
public sealed class ArcGISMapImageLayer : ImageAdjustmentLayer, 
	ITimeAware

The ArcGISMapImageLayer type exposes the following members.

Constructors
  NameDescription
Public methodArcGISMapImageLayer
Initializes a new instance of the ArcGISMapImageLayer class.
Public methodCode exampleArcGISMapImageLayer(Uri)
Initializes a new instance of the ArcGISMapImageLayer class with the specified URI.
Public methodArcGISMapImageLayer(Item)
Initializes a new instance of the ArcGISMapImageLayer class from the specified PortalItem.
Top
Properties
  NameDescription
Public propertyAttribution
Gets the attribution text for the layer.
(Inherited from Layer.)
Public propertyBrightness
Gets or sets layer brightness level.
(Inherited from ImageAdjustmentLayer.)
Public propertyCanChangeVisibility
Gets a value indicating whether the layer content's visibility can be changed.
(Inherited from Layer.)
Public propertyContrast
Gets or sets layer contrast level.
(Inherited from ImageAdjustmentLayer.)
Public propertyCredential
Gets or sets the Credential used to access a remote service.
Public propertyDescription
Gets the description for the layer.
(Inherited from Layer.)
Public propertyCode exampleFullExtent
Gets the full extent of the layer, which is the extent where all the data in the layer is contained.
(Inherited from Layer.)
Public propertyFullTimeExtent
Gets the temporal window that encapsulates the instance's complete set of data
Public propertyGamma
Gets or sets layer gamma level.
(Inherited from ImageAdjustmentLayer.)
Public propertyGeodatabaseVersion
Gets or sets the geodatabase version of the map image layer.
Public propertyCode exampleId
Gets or sets an identifier for the layer
(Inherited from Layer.)
Public propertyImageFormat
Gets or sets the MapServiceImageFormat of the map image layer.
Public propertyIsIdentifyEnabled
Gets a value indicating whether the layer supports the identify operation.
(Inherited from Layer.)
Public propertyIsTimeFilteringEnabled
Gets or sets whether the instance respects any temporal filters that are applied to it
Public propertyCode exampleIsVisible
Gets or sets a value indicating whether the layer content is visible.
(Inherited from Layer.)
Public propertyItem
Gets the ArcGIS Item
(Inherited from Layer.)
Public propertyLoadError
Gets the load error of the layer, if there is one.
(Inherited from Layer.)
Public propertyCode exampleLoadStatus
Gets the load status of the layer.
(Inherited from Layer.)
Public propertyCode exampleMaxScale
Gets or sets the maximum scale where the layer is visible.
(Inherited from Layer.)
Public propertyCode exampleMinScale
Gets or sets the minimum scale where the layer is visible.
(Inherited from Layer.)
Public propertyCode exampleName
Gets or sets the name of the layer content.
(Inherited from Layer.)
Public propertyCode exampleOpacity
Gets or sets the opacity of the layer.
(Inherited from Layer.)
Public propertyRefreshInterval
Gets or sets the refresh interval on an ArcGISMapImageLayer.
Public propertyServiceInfo
Gets the map service information.
Public propertyShowInLegend
Gets or sets a value indicating whether the layer content participates in the legend.
(Inherited from Layer.)
Public propertySource
Gets or sets the URI of the map service.
Public propertySpatialReference
Gets the spatial reference of the layer.
(Inherited from Layer.)
Public propertyCode exampleSublayerContents
Gets the sub layer contents of a layer content.
(Inherited from Layer.)
Public propertyCode exampleSublayers
Gets a list of sublayers of this map image layer.
Public propertySupportsTimeFiltering
Gets whether the instance supports filtering its data based on time
Public propertyCode exampleTables
Gets a read-only list of non-spatial tables in the map image layer.
Public propertyTimeInterval
Gets a temporal value that represents the suggested temporal interval to use when sequentially stepping through the instance's data by time
Public propertyTimeOffset
Gets or sets the amount of time by which to offset the temporal values of data points in this instance when displaying the data in a GeoView
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
(Inherited from Layer.)
Public methodCode exampleClone
Clones this instance of Layer and its members.
(Inherited from Layer.)
Public methodGetLegendInfosAsync
Returns an immutable list of LegendInfo.
(Inherited from Layer.)
Public methodIsVisibleAtScale
Returns the layer content's effective visibility at the specified scale.
(Inherited from Layer.)
Public methodCode exampleLoadAsync
Initiates loading of a layer
(Inherited from Layer.)
Public methodCode exampleLoadTablesAndLayersAsync
Asynchronously initiates loading of the layer's sublayers.
Public methodResetSublayers
Resets the sub-layers of this ArcGISMapImageLayer to the default values defined by the ArcGIS Server service.
Public methodRetryLoadAsync
Retry loading the layer.
(Inherited from Layer.)
Top
Events
  NameDescription
Public eventFullTimeExtentChanged
Raised when the FullTimeExtent of the instance's data changes
Public eventCode exampleLoaded
Occurs when the layer is loaded.
(Inherited from Layer.)
Public eventLoadStatusChanged
Occurs when the layer LoadStatus is changed.
(Inherited from Layer.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Layer.)
Top
Remarks

ArcGIS map image layer displays maps from an ArcGIS map server (version 9.3 and higher) using REST. A map service can contain multiple layers, rendered by the server each time a request is made and returned to the client as a single image. While the image itself does not contain information about the features it displays, you can get the underlying data (service feature table) for each sub-layer. This layer supports time-based filtering.

Functional characteristics

Map images are created and returned by the server on every request, so they always show the latest data at the time of the request. Characteristics of the image, such as brightness, contrast, gamma, and opacity can be specified. By obtaining the associated sub-layers of the ArcGISMapImageLayer using the Sublayers property, you can control each sub-layer visibility and filter the data via the definition expression. Also, the spatial reference can be changed from the service's default and the service will re-project each image on the fly.

The underlying service feature table, for each map image sub-layer or for non-spatial tables used in the service, can be accessed via the Tables property. These tables can be queried using any valid combination of attribute, spatial, and temporal criteria via the numerous QueryFeaturesAsync methods. You can also query for summary statistics or to find related features in other tables via the numerous QueryRelatedFeasturesAsync methods.

If you want the background color for the map image to be transparent, make sure the ImageFormat is set to PNG.

Performance characteristic

The map service creates map images on the fly. Rendering time depends on the amount and complexity of the data in the map. This will typically be slower than fetching the equivalent map as pre-rendered (or cached) tiles via an ArcGISTiledLayer. Because the server renders the map, map image layers require less processing time on the client than similar maps rendered locally.

ArcGIS map image layers are good candidates for showing features that change periodically over time, or that require some sort of filtering by the user. Although rendering occurs on the server, the client has access to service feature tables for all sub-layers (as well as non-spatial tables and relationships).

Sample Code:

Examples

Android

Example Name: ArcGISMapImageLayerUrl

Add an ArcGIS Map Image Layer from a URL to a map.

Code example screen shot.

C#
// Copyright 2016 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 Android.App;
using Android.OS;
using Android.Widget;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using System;

namespace ArcGISRuntime.Samples.ArcGISMapImageLayerUrl
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "ArcGIS map image layer",
        category: "Layers",
        description: "Add an ArcGIS Map Image Layer from a URL to a map.",
        instructions: "",
        tags: new[] { "ArcGIS dynamic map service layer", "ArcGISMapImageLayer", "layers" })]
    public class ArcGISMapImageLayerUrl : Activity
    {
        // Hold a reference to the map view
        private MapView _myMapView;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Title = "ArcGIS map image layer (URL)";

            // Create the UI, setup the control references and execute initialization 
            CreateLayout();
            Initialize();
        }

        private void Initialize()
        {
            // Create new Map
            Map myMap = new Map();

            // Create uri to the map image layer
            Uri serviceUri = new Uri(
               "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/WorldElevations/MapServer");

            // Create new image layer from the url
            ArcGISMapImageLayer imageLayer = new ArcGISMapImageLayer(serviceUri);

            // Add created layer to the basemaps collection
            myMap.Basemap.BaseLayers.Add(imageLayer);

            // Assign the map to the MapView
            _myMapView.Map = myMap;
        }

        private void CreateLayout()
        {
            // Create a new vertical layout for the app
            LinearLayout layout = new LinearLayout(this) { Orientation = Orientation.Vertical };

            // Add the map view to the layout
            _myMapView = new MapView(this);
            layout.AddView(_myMapView);

            // Show the layout in the app
            SetContentView(layout);
        }
    }
}
Examples

Xamarin Forms Android

Example Name: ArcGISMapImageLayerUrl

Add an ArcGIS Map Image Layer from a URL to a map.

Code example screen shot.

C#
// Copyright 2016 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 Esri.ArcGISRuntime.Mapping;
using System;
using Xamarin.Forms;

namespace ArcGISRuntime.Samples.ArcGISMapImageLayerUrl
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "ArcGIS map image layer",
        category: "Layers",
        description: "Add an ArcGIS Map Image Layer from a URL to a map.",
        instructions: "",
        tags: new[] { "ArcGIS dynamic map service layer", "ArcGISMapImageLayer", "layers" })]
    public partial class ArcGISMapImageLayerUrl : ContentPage
    {
        public ArcGISMapImageLayerUrl()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization 
            Initialize();
        }

        private void Initialize()
        {
            // Create new Map
            Map myMap = new Map();

            // Create uri to the map image layer
            Uri serviceUri = new Uri(
               "https://sampleserver5.arcgisonline.com/arcgis/rest/services/Elevation/WorldElevations/MapServer");

            // Create new image layer from the url
            ArcGISMapImageLayer imageLayer = new ArcGISMapImageLayer(serviceUri);

            // Add created layer to the basemaps collection
            myMap.Basemap.BaseLayers.Add(imageLayer);

            // Assign the map to the MapView
            MyMapView.Map = myMap;
        }
    }
}
XAML
<?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.ArcGISMapImageLayerUrl.ArcGISMapImageLayerUrl">
  <Grid>
    <esriUI:MapView x:Name="MyMapView">
      <mapping:Map/>
    </esriUI:MapView>
  </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
AnalyzeHotspotsUse a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
ArcGISMapImageLayerUrlAdd an ArcGIS Map Image Layer from a URL to a map.
AuthorMapCreate and save a map as an ArcGIS `PortalItem` (i.e. web map).
BufferListGenerate multiple individual buffers or a single unioned buffer around multiple points.
ChangeSublayerRendererApply a renderer to a sublayer.
ChangeSublayerVisibilityChange the visibility of sublayers.
ChangeTimeExtentFilter data in layers by applying a time extent to a MapView.
DisplayLayerViewStateDetermine if a layer is currently being viewed.
IdentifyLayersIdentify 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.
ManageOperationalLayersAdd, remove, and reorder operational layers in a map.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
SetMapSpatialReferenceSpecify a map's spatial reference.
TokenSecuredChallengeThis 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.