MobileCache mobileCache = new MobileCache("physical location of your mobilecache on the field computer"); MobileServiceConnection msc = new MobileServiceConnection(); msc.Url = "your arcgisserver name + /arcgis/services/ + name of the service + /MapServer/Mobileserver"); msc.CreateCache(mobileCache.StoragePath); mobileCache.Open(); foreach (Layer aLayer in mobileCache.Layers) { if(aLayer.Name == "the name of the layer you are trying to sync") { FeatureLayer aFeatureLayer = (FeatureLayer)aLayer; FeatureLayerSyncAgent flsa = new FeatureLayerSyncAgent(aFeatureLayer); flsa.MapDocumentConnection = msc; flsa.SynchronizationDirection = SyncDirection.Bidirectional; SyncResults results = new SyncResults(); results = flsa.Synchronize(); } }
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.