symbols in the feature layer vanished suddenly,but label still visible

660
0
03-04-2018 11:35 PM
lin2Zhang
New Contributor
I have a client WPF (C#) application enabled with map viewing and feature selection functions, here ArcGIS runtime SDK 10.2.7 is used. The feature services are hosted in intranet feature service running in 10.3 ArcGIS server.
the way to implement the map application similar like below: (sorry for unable to discover the services)
       <add key="FeatureUri11" value="http://abcd:6080/arcgis/rest/services/abcd/FeatureServer/0/>
       <add key="FeatureUri12" value="http://abcd:6080/arcgis/rest/services/abcd/FeatureServer/1/>
       <add key="FeatureUri13" value="http://abcd:6080/arcgis/rest/services/abcd/FeatureServer/2/>
        private async Task AddFeatureLayers()
        {
            try
            { 
                FeatureLayer featureLayer = await CreateFeatureLayer(FeatureUri11, "featureid1", "featureName1");
               if(featureLayer!=null) MainMapView.Map.Layers.Add(featureLayer);  
    featureLayer = await CreateFeatureLayer(FeatureUri12, "featureid2", "featureName2");
               if(featureLayer!=null) MainMapView.Map.Layers.Add(featureLayer);   
    featureLayer = await CreateFeatureLayer(FeatureUri13, "featureid3", "featureName3");
               if(featureLayer!=null) MainMapView.Map.Layers.Add(featureLayer); 
            }
            catch (Exception e)
            {
                _logger.Error("AddFeatureLayers:" + e.ToString());
            }
        }
        private async Task<FeatureLayer> CreateFeatureLayer(string url,string id,string displayName)
        {
            if (string.IsNullOrEmpty(url)) return null;
            // create a ServiceFeatureTable from the layer in the SF311 feature service
            var gdbFeatureSvcTable = await ServiceFeatureTable.OpenAsync(new Uri(url));
            // define the query mode for retrieving features from the server
            gdbFeatureSvcTable.Mode = QueryMode.OnDemand; 
            // create a feature layer from the table
            var featureLayer = new FeatureLayer(gdbFeatureSvcTable);
            featureLayer.ID = id; // (assign an ID so it can be found later)
            featureLayer.DisplayName = displayName;
            return featureLayer;
        }

The feature service layers which are point geometry type were configured to be shown in all scale, the label was set with a visible range , as well as picture symbol was pointed to the feature in mxd file before publishing as services in server side. the feature tables are only containing 3000 records currently, and around 300 records with coordinate in current phase. so it means there is only small amount to be displayed on the map.
The client application will load a base map and a few feature layers. the network speed is quite low.  
Issue is: at the beginning, the feature service can be loaded into map and is visible to user, but quite lots of symbols of the feature layer will be vanished after doing pan, zoom in/out actions. The weird thing is that those labels were there and visible,only symbols disappear and unable to select, there were still some symbol and label visible. (The rare case is the whole layer was disappear after sometime, not consistently happen.)  the issue cannot be recovered after waiting for some time, e.g. one hour. It is able to recover if remove the feature layer from map and re-add it by calling AddFeatureLayers() again. The issue was happened consistently. Is there anyway to refresh the mapview/map/feature? Anyone encountered the same issue before?
I have tried the code below, not working:
var serviceFeature = layer.FeatureTable as ServiceFeatureTable;
if (serviceFeature != null) serviceFeature.RefreshFeatures(false);
0 Kudos
0 Replies