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:
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.