Snippets

Philip O'Gorman Xamarin ArcGis Download maps for offline use

Created by Philip O'Gorman last modified
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Tasks.Offline;
using System;

namespace FormsMapsShared.ArcGisRendering
{
    public class OffLineMap
    {
        Uri server = new Uri("http://server.arcgisonline.com/arcgis/services/World_Imagery/MapServer");
        public Envelope MapViewEnvelope { get; set; }

        public void DownLoadOffLineMap()
        {
            // Get the the extent covered by generated tile cache, here we are using
            // the area being displayed on screen
            var exportTileCacheTask = new ExportTileCacheTask(server);
            // Set up GenerateTileCacheParameters
            var parameters = new ExportTileCacheParameters()
            {
                AreaOfInterest = MapViewEnvelope
            };

            var job = exportTileCacheTask.EstimateTileCacheSize(parameters);
        }
    }
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.