<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Layers missing from identify results in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511589#M13090</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have to initialize the LayerIds property of your identifyParameter with the list of currently visible layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The confusion is coming from the 'visible' value of the LayerOption. This option means 'identify the layers visible in the map service' (i.e the layers visible before you turned on/off some layers&amp;nbsp; by code).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Apr 2010 09:03:47 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2010-04-28T09:03:47Z</dc:date>
    <item>
      <title>Layers missing from identify results</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511588#M13089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have implemented the identify sample as shown in the ESRI samples at &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#Identify" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#Identify&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems to work OK BUT . . .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My map consists of 2 roadway layers plus any one of 3 layers showing the area's school districts. The 3 school layers are turned on/off by making selections with a checkbox to display elementary, middle, or high schools. My problem is that irregardless of which school layer is displayed, the identify always reveals only the elementary and roadway layer data. How can I cause the identify results to contain the visible school layer data? Code below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#Region "Identify"

 Private Sub QueryPoint_MouseClick(ByVal sender As Object, ByVal e As ESRI.ArcGIS.Client.Map.MouseEventArgs)
&amp;nbsp; Dim clickPoint As ESRI.ArcGIS.Client.Geometry.MapPoint = e.MapPoint

&amp;nbsp; Dim identifyParams As ESRI.ArcGIS.Client.Tasks.IdentifyParameters = New IdentifyParameters() With {.Geometry = clickPoint, .MapExtent = MyMap.Extent, .Width = CInt(Fix(MyMap.ActualWidth)), .Height = CInt(Fix(MyMap.ActualHeight)), .LayerOption = LayerOption.visible}

&amp;nbsp; Dim identifyTask As New IdentifyTask("http://maps.pagnet.org/arcgis/rest/services/SchoolSearch2/MapServer")
&amp;nbsp; AddHandler identifyTask.ExecuteCompleted, AddressOf IdentifyTask_ExecuteCompleted
&amp;nbsp; AddHandler identifyTask.Failed, AddressOf IdentifyTask_Failed
&amp;nbsp; identifyTask.ExecuteAsync(identifyParams)

&amp;nbsp; Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer)
&amp;nbsp; graphicsLayer.ClearGraphics()
&amp;nbsp; Dim graphic As New ESRI.ArcGIS.Client.Graphic() With {.Geometry = clickPoint, .Symbol = DefaultPictureSymbol}
&amp;nbsp; graphicsLayer.Graphics.Add(graphic)
 End Sub

 Public Sub ShowFeatures(ByVal results As List(Of IdentifyResult))
&amp;nbsp; _dataItems = New List(Of DataItem)()

&amp;nbsp; If results IsNot Nothing AndAlso results.Count &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp; IdentifyComboBox.Items.Clear()
&amp;nbsp;&amp;nbsp; For Each result As IdentifyResult In results
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim feature As Graphic = result.Feature
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim title As String = result.Value.ToString() &amp;amp; " (" &amp;amp; result.LayerName &amp;amp; ")"
&amp;nbsp;&amp;nbsp;&amp;nbsp; _dataItems.Add(New DataItem() With {.Title = title, .Data = feature.Attributes})
&amp;nbsp;&amp;nbsp;&amp;nbsp; IdentifyComboBox.Items.Add(title)
&amp;nbsp;&amp;nbsp; Next result

&amp;nbsp;&amp;nbsp; ' Workaround for bug with ComboBox 
&amp;nbsp;&amp;nbsp; IdentifyComboBox.UpdateLayout()

&amp;nbsp;&amp;nbsp; IdentifyComboBox.SelectedIndex = 0
&amp;nbsp; End If
 End Sub

 Private Sub cb_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
&amp;nbsp; Dim index As Integer = IdentifyComboBox.SelectedIndex
&amp;nbsp; If index &amp;gt; -1 Then
&amp;nbsp;&amp;nbsp; IdentifyDetailsDataGrid.ItemsSource = _dataItems(index).Data
&amp;nbsp; End If
 End Sub

 Private Sub IdentifyTask_ExecuteCompleted(ByVal sender As Object, ByVal args As IdentifyEventArgs)
&amp;nbsp; IdentifyDetailsDataGrid.ItemsSource = Nothing
&amp;nbsp; IdentifyResultsPanel.Visibility = Windows.Visibility.Visible

&amp;nbsp; If args.IdentifyResults IsNot Nothing AndAlso args.IdentifyResults.Count &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp; If DataGridScrollViewer.Visibility = Visibility.Collapsed Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; DataGridScrollViewer.Visibility = Visibility.Visible
&amp;nbsp;&amp;nbsp;&amp;nbsp; IdentifyGrid.Height = Double.NaN
&amp;nbsp;&amp;nbsp;&amp;nbsp; IdentifyGrid.UpdateLayout()
&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp; ShowFeatures(args.IdentifyResults)
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp; IdentifyComboBox.Items.Clear()
&amp;nbsp;&amp;nbsp; IdentifyComboBox.UpdateLayout()

&amp;nbsp;&amp;nbsp; If DataGridScrollViewer.Visibility = Visibility.Visible Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; DataGridScrollViewer.Visibility = Visibility.Collapsed
&amp;nbsp;&amp;nbsp;&amp;nbsp; IdentifyGrid.Height = Double.NaN
&amp;nbsp;&amp;nbsp;&amp;nbsp; IdentifyGrid.UpdateLayout()
&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; End If
 End Sub

 Public Class DataItem
&amp;nbsp; Private privateTitle As String
&amp;nbsp; Public Property Title() As String
&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp; Return privateTitle
&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp;&amp;nbsp; Set(ByVal value As String)
&amp;nbsp;&amp;nbsp;&amp;nbsp; privateTitle = value
&amp;nbsp;&amp;nbsp; End Set
&amp;nbsp; End Property
&amp;nbsp; Private privateData As IDictionary(Of String, Object)

&amp;nbsp; Public Property Data() As IDictionary(Of String, Object)
&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp; Return privateData
&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp;&amp;nbsp; Set(ByVal value As IDictionary(Of String, Object))
&amp;nbsp;&amp;nbsp;&amp;nbsp; privateData = value
&amp;nbsp;&amp;nbsp; End Set
&amp;nbsp; End Property
 End Class

 Private Sub IdentifyTask_Failed(ByVal sender As Object, ByVal e As TaskFailedEventArgs)
&amp;nbsp; MessageBox.Show("Identify failed. Error: " &amp;amp; e.Error.Message)
 End Sub

#End Region
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:23:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511588#M13089</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2021-12-11T22:23:33Z</dc:date>
    </item>
    <item>
      <title>Layers missing from identify results</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511589#M13090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have to initialize the LayerIds property of your identifyParameter with the list of currently visible layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The confusion is coming from the 'visible' value of the LayerOption. This option means 'identify the layers visible in the map service' (i.e the layers visible before you turned on/off some layers&amp;nbsp; by code).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 09:03:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511589#M13090</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2010-04-28T09:03:47Z</dc:date>
    </item>
    <item>
      <title>Layers missing from identify results</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511590#M13091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK Thanks. I was able to get what I want with this change. Note, I had to change the layer option to all to make them all available as needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; Dim identifyParams As ESRI.ArcGIS.Client.Tasks.IdentifyParameters = New IdentifyParameters() With {.Geometry = clickPoint, .MapExtent = MyMap.Extent, .Width = CInt(Fix(MyMap.ActualWidth)), .Height = CInt(Fix(MyMap.ActualHeight)), .LayerOption = LayerOption.all}

&amp;nbsp; If Elementary_Checkbox.IsChecked Then
&amp;nbsp;&amp;nbsp; identifyParams.LayerIds.Add(2)
&amp;nbsp; End If
&amp;nbsp; If Middle_Checkbox.IsChecked Then
&amp;nbsp;&amp;nbsp; identifyParams.LayerIds.Add(5)
&amp;nbsp; End If
&amp;nbsp; If High_Checkbox.IsChecked Then
&amp;nbsp;&amp;nbsp; identifyParams.LayerIds.Add(8)
&amp;nbsp; End If&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:23:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layers-missing-from-identify-results/m-p/511590#M13091</guid>
      <dc:creator>DonFreeman</dc:creator>
      <dc:date>2021-12-11T22:23:35Z</dc:date>
    </item>
  </channel>
</rss>

