Local Map Services

3322
10
Jump to solution
06-09-2012 08:37 PM
Labels (1)
ShaunWeston
Occasional Contributor
So I understand that when we load map packages they are bound to the local server and a mini ArcGIS Server is created with a list of services we can access through the REST API. I can see these services at a directory like this:

http://127.0.0.1:50000/V3XM5j/arcgis/rest/services (With the name changing each time)

And I see that the map services, gp services, feature services and geocoding services are all listed there, HOWEVER the Tiled packages are not?

Just wondering why they are not listed? It's great that the architecture is basically the same as ArcGIS Server, but are the tiled map services done differently?
0 Kudos
10 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

Yes, apologies if the previous answers weren't clear, if your app has for example a folder browser dialog which returns a folder name you can enumerate the files in that folder looking for .TPK (Tile Packages) and .MPK (Map Packages) then create ArcGISLocalTiledLayer and ArcGISLocalDynamicMapServiceLayers from those by setting the Path property in each case. If it's a fairly simple view-only affair then you can just instantiate the layer object, set the Path property and add it to the map. The map will kick off the layer initialization which in turn will start a RuntimeLocalServer instance if required and create/start the LocalMapService as required. In that scenario you don't necessarily need to work with the LocalServer/LocalService classes directly.

If you need a little more functionality from your layers then for example you might need to ask the user whether they want to edit, in which case you'll need to create an ArcGISLocalFeatureLayer from that MapPackage (which will start both a LocalMapService and a LocalFeatureService because the latter is a sub type of the MapServer). There are a few other properties on the local service objects you might need to consider setting as well, such as MaxRecords - which typically for a local service you can set very high but by default it's a 1000 like ArcGIS for Server. In this scenario you will need to work with the LocalService classes directly to set those properties.

Cheers

Mike
0 Kudos