Toggle MapLayers visibility on ArcGIS Mobile 10.1

1726
2
12-10-2013 02:37 AM
EzequiasRodrigues_da_Rocha
New Contributor III
Hi everyone

I am trying to retrieve the MapLayers on my Map using ArcGIS Mobile 10.1 and i am getting only one item on it, even my MobileCache having more than ten items.

I added my mobile cache on the map using this command below:

myMap.MapLayers.Add(mobileCache);

See attached picture.
[ATTACH=CONFIG]29708[/ATTACH]
0 Kudos
2 Replies
HemingZhu
Occasional Contributor III
Hi everyone

I am trying to retrieve the MapLayers on my Map using ArcGIS Mobile 10.1 and i am getting only one item on it, even my MobileCache having more than ten items.

I added my mobile cache on the map using this command below:

myMap.MapLayers.Add(mobileCache);

See attached picture.
[ATTACH=CONFIG]29708[/ATTACH]


In order to retrieve to the layers in the MobileCache. You need using MobileCacheMapLayer and MobileCacheMapLayer.LayerDefinitions.
something like this:
MobileCacheMapLayer all_layers =new MobileCacheMapLayer(mobileCache);
myMap.MapLayers.Add(all_layers);

then for each layer you could use MobileCacheMapLayerDefinition like this:


MobileCacheMapLayerDefinition firstLayer=all_layers.LayerDefinitions[0]; But There are not much you can do with it exception visibility, opacity etc. To get underline FeatureSource of each layer, you could use mobileCache.FeatureSources[index]. Then you access features by using GetDataTable...
0 Kudos
selcukcelik
New Contributor
hint: if the rest of the items are unit(standalone) and relation so you can not use in mobile cache
0 Kudos