Click or drag to resize

ArcGISTiledLayer Class

This class allows you to display data from an ArcGIS Server map service or a local TileCache by using previously generated tiles.
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.7.0.0
Syntax
C#
public sealed class ArcGISTiledLayer : ImageTiledLayer

The ArcGISTiledLayer type exposes the following members.

Constructors
  NameDescription
Public methodArcGISTiledLayer
Initializes a new instance of the ArcGISTiledLayer class.
Public methodCode exampleArcGISTiledLayer(Uri)
Initializes a new instance of the ArcGISTiledLayer class from the specified URI.
Public methodArcGISTiledLayer(Item)
Initializes a new instance of the ArcGISTiledLayer class from the specified Item.
Public methodCode exampleArcGISTiledLayer(TileCache)
Initializes a new instance of the ArcGISTiledLayer class from a local TileCache.
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 propertyFullExtent
Gets or sets the full extent of this layer.
(Inherited from ImageTiledLayer.)
Public propertyGamma
Gets or sets layer gamma level.
(Inherited from ImageAdjustmentLayer.)
Public propertyCode exampleId
Gets or sets an identifier for the layer
(Inherited from Layer.)
Public propertyIsIdentifyEnabled
Gets a value indicating whether the layer supports the identify operation.
(Inherited from Layer.)
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 propertyNoDataTileBehavior
Gets or sets the NoDataTileBehavior for the . The value controls how a tile returning 'NoData' will be resampled.
(Inherited from ImageTiledLayer.)
Public propertyCode exampleOpacity
Gets or sets the opacity of the layer.
(Inherited from Layer.)
Public propertyRefreshInterval
Gets or sets the refresh interval on an ArcGISTiledLayer.
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 endpoint of the map service or the path to a local tile package.
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 propertySublayers
Gets a read-only collection of ArcGISSublayer objects in the ArcGISTiledLayer.
Public propertyTileCache
Gets the TileCache representing information about a local tile package.
Public propertyTileInfo
Gets or sets the tiling scheme information for this layer.
(Inherited from ImageTiledLayer.)
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 methodRetryLoadAsync
Retry loading the layer.
(Inherited from Layer.)
Top
Events
  NameDescription
Public eventCode exampleLoaded
Occurs when the layer is loaded.
(Inherited from Layer.)
Public eventCode exampleLoadStatusChanged
Occurs when the layer LoadStatus is changed.
(Inherited from Layer.)
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from Layer.)
Top
Remarks

The service may be hosted in the cloud on ArcGIS Online or on-premise with ArcGIS Server. ArcGISTiledLayer uses a cache of previously generated tiles to create a map instead of dynamically generating map images.

For use on ArcGIS Server MapServers that have Single Fused Map Cache equal to true.

Examples

Android

Example Name: ArcGISTiledLayerUrl

Load an ArcGIS tiled layer from a URL.

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.ArcGISTiledLayerUrl
{
    [Activity (ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "ArcGIS tiled layer (URL)",
        "Layers",
        "This sample demonstrates how to add an ArcGISTiledLayer as a base layer in a map. The ArcGISTiledLayer comes from an ArcGIS Server sample web service.",
        "")]
    public class ArcGISTiledLayerUrl : Activity
    {
        // Hold a reference to the map view
        private MapView _myMapView;

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

            Title = "ArcGIS tiled 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 tiled service
            Uri serviceUri = new Uri(
               "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer");

            // Create new tiled layer from the url
            ArcGISTiledLayer imageLayer = new ArcGISTiledLayer(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: ArcGISTiledLayerUrl

Load an ArcGIS tiled layer from a URL.

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.ArcGISTiledLayerUrl
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        "ArcGIS tiled layer (URL)",
        "Layers",
        "This sample demonstrates how to add an ArcGISTiledLayer as a base layer in a map. The ArcGISTiledLayer comes from an ArcGIS Server sample web service.",
        "")]
    public partial class ArcGISTiledLayerUrl : ContentPage
    {
        public ArcGISTiledLayerUrl ()
        {
            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 tiled service
            Uri serviceUri = new Uri(
               "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer");

            // Create new tiled layer from the url
            ArcGISTiledLayer imageLayer = new ArcGISTiledLayer(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.ArcGISTiledLayerUrl.ArcGISTiledLayerUrl">
  <Grid>
    <esriUI:MapView x:Name="MyMapView"/>
  </Grid>
</ContentPage>
See Also
Additional Examples
Hyperlink to ExampleDescription
ArcGISTiledLayerUrlLoad an ArcGIS tiled layer from a URL.
DisplayLayerViewStateView the status of the layers on the map.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
ExportTilesDownload tiles to a local tile cache file stored on the device.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
OfflineGeocodeGeocode addresses to locations and reverse geocode locations to addresses offline.
OfflineRoutingSolve a route on-the-fly using offline data.
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.