Select to view content in your preferred language

How to add Layers to the Map control

519
0
05-29-2012 02:55 PM
Jitendrudulacaraju
Emerging Contributor
I see that the MobileService is obselete now and as so is the sdc layer class.
Now I have to build a Map with Operational and Base Map layers. In the Mobile 10.0 how is it done? I need an urgent help on this.


I used to do it like this in the old times:

MobileService.CacheStoragePath = ApplicationPath + @"\MapCache";     //@"C:\Temp\MapCache"; //Properties.Settings.Default.mapCache;




                //            ESRI.ArcGIS.Mobile.CatalogServices.CatalogService cataService = new ESRI.ArcGIS.Mobile.CatalogServices.CatalogService();










                //Mobile Service
                MobileService.Url = @"vv/ArcGIS/services/StormWaterMobile/MapServer/MobileServer";
                //MobileService.Url = @"vv/ArcGIS/services/StormWaterMobile/MapServer/MobileServer";// Properties.Settings.Default.mapServiceUrl;
                //MobileService.Url = @"http://.ad/ArcGIS/services/StormWaterMobile_TestNew/MapServer/MobileServer";
                //Validate the mobile service and open or create it
               
                MobileServiceConnection mblConn = MobileService.ServiceConnection;
                string mapName = MobileService.ServerMapName;
                if (MobileService.IsValid)
                {
                    try
                    {
                        MobileService.Open(CacheOpenMode.OpenOrCreate);



MobileTaxService = new MobileService();
                MobileTaxService.CacheStoragePath = (ApplicationPath + @"\MapCache\parcels");//@"C:\Temp\MapCache\parcels";


                if (MobileTaxService.IsValid)
                {
                    try
                    {
                        MobileTaxService.Open(CacheOpenMode.OpenOrCreate);
                    }
                    catch (Exception e) { log.Error(e.Message + " " + e.StackTrace + " " + e.Source); }
                }


                MobileMap.MapLayers.Add(MobileTaxService);

And

sdcBaseMapLayer = new SdcMapLayer(ApplicationPath + @"\BaseMap\Basemap2009_Mobile.navmap");// (@"C:\Temp\BaseMap\Basemap2009_Mobile.navmap");
                MobileMap.MapLayers.Add(sdcBaseMapLayer);
                sdcBaseMapLayer.Visible = false;


0 Kudos
0 Replies