Hello,I am trying to show the number of points visible in a textblock and change that number everytime the map extension is changed. So far I successfully queryed the map but while testing my code I found that if I go to full extent and then zoom to every point except one the number of points showed is the same. This is even weirder when you consider that most of my points are in southern Europe and the one left alone is in India. The code I am using is this:
Private Sub MyMap_ExtentChanged(ByVal sender As Object, ByVal e As ExtentEventArgs)
NumProyectosVisiblesMostrar()
End Sub
Private Sub NumProyectosVisiblesMostrar()
Dim idpParametrosIdentificacionProyectos As ESRI.ArcGIS.Client.Tasks.IdentifyParameters
Dim idtTareaIdentificacionProyectos As IdentifyTask
Try
idpParametrosIdentificacionProyectos = New IdentifyParameters() With {.Geometry = MyMap.Extent, .MapExtent = MyMap.Extent, .Width = CInt(Fix(MyMap.ActualWidth)), .Height = CInt(Fix(MyMap.ActualHeight)), .LayerOption = LayerOption.visible, .SpatialReference = MyMap.SpatialReference, .Tolerance = 0}
idtTareaIdentificacionProyectos = New IdentifyTask(_strQSURLMapa3)
AddHandler idtTareaIdentificacionProyectos.ExecuteCompleted, AddressOf idtTareaIdentificacionProyectos_ExecuteCompleted
AddHandler idtTareaIdentificacionProyectos.Failed, AddressOf idtTareaIdentificacionProyectos_Failed
idtTareaIdentificacionProyectos.ExecuteAsync(idpParametrosIdentificacionProyectos)
Catch ex As Exception
tbNumProyectos.Text = ""
End Try
End Sub
Private Sub idtTareaIdentificacionProyectos_Failed(ByVal sender As Object, ByVal e As TaskFailedEventArgs)
Try
tbNumProyectos.Text = ""
Catch ex As Exception
tbNumProyectos.Text = ""
End Try
End Sub
Private Sub idtTareaIdentificacionProyectos_ExecuteCompleted(ByVal sender As Object, ByVal args As IdentifyEventArgs)
Try
If args.IdentifyResults IsNot Nothing AndAlso args.IdentifyResults.Count > 0 Then
tbNumProyectos.Text = args.IdentifyResults.Count.ToString
Else
tbNumProyectos.Text = "0"
End If
Catch ex As Exception
tbNumProyectos.Text = ""
End Try
End Sub
Is something wrong with the way I am querying the map?Thank you