if (LayerComboBox.SelectedItem != "Select...") { FeatureLayer queryLayer = new FeatureLayer(); string layerComboBoxItem; string layerID; layerComboBoxItem = LayerComboBox.SelectedItem.ToString(); layerID = GetLayerID(layerComboBoxItem).ToString(); queryLayer.ID = "QueryLayer"; queryLayer.Url = "http://......./rest/services/QueryLayerService/MapServer/" + layerID; queryLayer.OutFields.Add("*"); MyMap.Layers.Add(queryLayer); queryLayer.Initialize(); } }
QueryFormCombo1.ItemsSource = (MyMap.Layers["QueryLayer"] as FeatureLayer).LayerInfo.Fields;
Also, I debug into it, prior to adding to the map layers collection, and I see the "Graphics" collection is empty:
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.