//FeatureService Connection using replicamanager string featServiceUrl = @"http://<myserver>/arcgis/rest/services/test3/FeatureServer"; FeatureServiceReplicaManager fsreplica = new FeatureServiceReplicaManager(); //MobileCache string cacheStoragePath = @C:\GIS\Project\Mobil\db(Cache)\cache; MobileCache mobileCache = new MobileCache(cacheStoragePath); //delete old cache if (mobileCache.CacheExists == true) mobileCache.DeleteCache(); //////////////////////////// //Create a token to access the service with valid username\password TokenCredential token = new TokenCredential("user", "pass"); //Set feature service properties fsreplica.TokenCredential = token; fsreplica.Url = featServiceUrl; fsreplica.Initialize(); fsreplica.MobileCache = mobileCache; //Get the data from the service to the local cache fsreplica.CreateReplica(); //Open the cache and add it to the maplayers mobileCache.Open(); if (!fsreplica.IsRegistered) fsreplica.RegisterReplica(); map1.MapLayers.Add(mobileCache);
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.