How do I set up ArcGISTiledMapServiceLayer to access a layer on my c: drive?

2897
2
Jump to solution
08-13-2014 07:38 AM
DaleShearer
Occasional Contributor

Hi, thanks for looking at my question.  I am just getting started with ArcGIS Runtime SDK for .NET and I have already built the little sample app - create an offline map.

 

Now I am on to my own app, upon startup in the xaml an online map is loaded, that works fine.  Now I want to switch between a online map and an offline map, the offline map is on my C: drive.  If I set up the xaml to load th emap on the C: drive on startup, that works fine.

 

In my app the online map is the basemap.  On my button I can remove the BaseMap with the code:  MyMap.Layers.Remove("BaseMap")

 

I can add the map back in with:

 

ArcGISTiledMapServiceLayer As New ArcGISTiledMapServiceLayer

ArcGISTiledMapServiceLayer.serviceUri = "http://etc./MapServer"

ArcGISTiledMapServiceLayer.ID = "BaseMap"

MyMap.Layers.Add(ArcGISTiledMapServiceLayer)

 

Removing the Basemap and adding it back works fine.

 

Now using a button I want to to do the same with tile package map on my C: drive.  The problem is getting the  ArcGISTiledMapServiceLayer to recognize the map on the C: drive.  C:\Test\Map.tpk.

 

It is not a ServiceUri or any other extension type that is available.

 

Thanks for your help.  Dale,

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

Use the ArcGISLocalTiledLayer to load local TPKs. ie

var layer = new ArcGISLocalTiledLayer(@"C:\Test\Map.tpk") { ID = "Local BaseMap" };

View solution in original post

0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

Use the ArcGISLocalTiledLayer to load local TPKs. ie

var layer = new ArcGISLocalTiledLayer(@"C:\Test\Map.tpk") { ID = "Local BaseMap" };

0 Kudos
DaleShearer
Occasional Contributor

Thank you very much, I got it to work with your reply.  Dale,

0 Kudos