<esri:Map Grid.Row="3" Extent="-120, 20, -100, 40" Name="MyMap" Visibility="Visible" Background="Transparent" Margin="2,0" BorderThickness="1" BorderBrush="{StaticResource TitleBarGradient}"> <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" /> <esri:GraphicsLayer ID="MyGraphicsLayer"> <esri:GraphicsLayer.MapTip> <StackPanel Orientation="Vertical" Margin="10,10,10,10"> <TextBlock Text="{Binding [Name]}" Width="120" Height="20" TextAlignment="Center" FontWeight="SemiBold"/> </StackPanel> </esri:GraphicsLayer.MapTip> </esri:GraphicsLayer> </esri:Map> For recordcount = 0 To e.Result.Count - 1 'Dim geometry1 As New Point(csys, rsOman("lon"), rsOman("lat")) Dim Status As String = "" Dim EventId As Integer Dim colourstyle As String EventId = e.Result(recordcount).EEventID If EventId = 253 Then colourstyle = "GlobePictureSymbol_Blue" ElseIf EventId = 110 Then colourstyle = "GlobePictureSymbol_Green" ElseIf EventId = 108 Then colourstyle = "GlobePictureSymbol_Green" ElseIf EventId = 101 Then colourstyle = "GlobePictureSymbol_Red" ElseIf EventId = 142 Then colourstyle = "GlobePictureSymbol_Black" ElseIf EventId = 254 Then colourstyle = "GlobePictureSymbol_Gray" Else colourstyle = "GlobePictureSymbol_Black" End If Status = e.Result(recordcount).EEventName '************************* ''''''''''LOCATION FROM POI and Roaddata same connection not possible bfre close Dim procname As String = "" Dim location As String location = "" If e.Result(recordcount).EStreetAddress <> "NULL" And e.Result(recordcount).EStreetAddress <> "" Then location = e.Result(recordcount).ELocationName & ", STREET: " & e.Result(recordcount).EStreetAddress Else location = e.Result(recordcount).ELocationName & "" End If '''''''''''''''''''''''''' TxtLastUpd.Text = e.Result(recordcount).Edatedisplay Dim gpsNMEASentences As String = "$GPGGA,92204.9, " & e.Result(recordcount).ELat & ", N," & e.Result(recordcount).ELon & ", W, 1, 04, 2.4, 25.7, M,,,,*75" Dim gpsNMEASentenceArray() As String = gpsNMEASentences.Split(ControlChars.Lf) Dim gpsNMEASentence() As String = gpsNMEASentenceArray(0).Split(","c) Dim graphic As New Graphic() With { .Geometry = mercator.FromGeographic(New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)))), .Symbol = TryCast(LayoutRoot.Resources(colourstyle), Symbol) } Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer) graphicsLayer.Graphics.Clear() graphicsLayer.Graphics.Add(graphic) esriLogoImage.Visibility = Windows.Visibility.Collapsed MyMap.Visibility = Windows.Visibility.Visible MyMap.ZoomTo(graphicsLayer.FullExtent) NextSolved! Go to Solution.
What u said is correct..Almost all locations are very closer....How can i expand to reach a minimal size???
.Geometry = mercator.FromGeographic(New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)))),
<esri:Map Extent="-120, 20, -100, 40" Grid.Row="3" Name="MyMap" Visibility="Visible" Background="Transparent" Margin="2,0" BorderThickness="1" BorderBrush="{StaticResource TitleBarGradient}">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
<esri:GraphicsLayer ID="MyGraphicsLayer" />
</esri:Map> Dim gpsNMEASentences As String = "$GPGGA, 92204.9, " & e.Result(Loopcnt).ETLat & ", N," & e.Result(Loopcnt).ETLon & ", W, 1, 04, 2.4, 25.7, M,,,,*75"
Dim gpsNMEASentenceArray() As String = gpsNMEASentences.Split(ControlChars.Lf)
Dim gpsNMEASentence() As String = gpsNMEASentenceArray(0).Split(","c)
''.Geometry = mercator.FromGeographic(New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)))),
Dim graphic As New Graphic() With
{
.Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2))),
.Symbol = TryCast(LayoutRoot.Resources(colourstyle), Symbol)
}
Dim strhotspot As String = ""
strhotspot = "VEHICLE: " & Trim(TryCast(CmbFahrname.SelectedItem, comboloadclass).ename.ToString()) & ", DATETIME: " & e.Result(Loopcnt).ETdatedisplay & ", LOCATION: " & e.Result(Loopcnt).ETLocationName & ", SPEED: " & e.Result(Loopcnt).ETspeed & ", STATUS: " & Status
graphic.Attributes.Add("STRHOTSPOT", strhotspot)
AddHandler graphic.MouseLeave, AddressOf Graphic_MouseLeave
AddHandler graphic.MouseEnter, AddressOf Graphic_MouseEnter
'Delete the existing find object and add the new one
If (Not MyMap Is Nothing) Then
If recordcount = 1 Then
If (EventId1 = 12 And EventId2 = 14) Then ''excluding vehicle idle after journey end
Else
graphicsLayer.Graphics.Add(graphic)
End If
Else
If (EventId1 = 12 And EventId2 = 14) Then ''excluding vehicle idle after journey end
Else
graphicsLayer.Graphics.Add(graphic)
End If
End If
''adding lines''''''''''''''''''
If recordcount > 1 Then
Dim startPoint As New MapPoint(Startlong, Startlat)
Dim endPoint As New MapPoint(Endlong, Endlat)
Dim pointCollection As New ESRI.ArcGIS.Client.Geometry.PointCollection()
pointCollection.Add(startPoint)
pointCollection.Add(endPoint)
Dim polyline As New ESRI.ArcGIS.Client.Geometry.Polyline()
polyline.Paths.Add(pointCollection)
Dim graphicLine As New Graphic() With
{
.Symbol = TryCast(LayoutRoot.Resources("DefaultLineSymbol"), Symbol),
.Geometry = mercator.FromGeographic(polyline)
}
If (EventId1 = 12 And EventId2 = 14) Then
Else
graphicsLayer.Graphics.Add(graphicLine)
End If
End If
MyMap.ZoomTo(graphicsLayer.FullExtent)
.Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)), New SpatialReference(4326)),
.Geometry = mercator.FromGeographic(polyline)
.Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)), New SpatialReference(4326)),
Dim gpsNMEASentences As String = "$GPGGA, 92204.9, " & e.Result(Loopcnt).ETLat & ", N," & e.Result(Loopcnt).ETLon & ", W, 1, 04, 2.4, 25.7, M,,,,*75"
Dim gpsNMEASentenceArray() As String = gpsNMEASentences.Split(ControlChars.Lf)
Dim gpsNMEASentence() As String = gpsNMEASentenceArray(0).Split(","c)
''.Geometry = mercator.FromGeographic(New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)))),
Dim graphic As New Graphic() With
{
.Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2)), New SpatialReference(4326)),
.Symbol = TryCast(LayoutRoot.Resources(colourstyle), Symbol)
}
Dim strhotspot As String = ""
strhotspot = "VEHICLE: " & Trim(TryCast(CmbFahrname.SelectedItem, comboloadclass).ename.ToString()) & ", DATETIME: " & e.Result(Loopcnt).ETdatedisplay & ", LOCATION: " & e.Result(Loopcnt).ETLocationName & ", SPEED: " & e.Result(Loopcnt).ETspeed & ", STATUS: " & Status
graphic.Attributes.Add("STRHOTSPOT", strhotspot)
AddHandler graphic.MouseLeave, AddressOf Graphic_MouseLeave
AddHandler graphic.MouseEnter, AddressOf Graphic_MouseEnter
'Delete the existing find object and add the new one
If (Not MyMap Is Nothing) Then
If recordcount = 1 Then
If (EventId1 = 12 And EventId2 = 14) Then ''excluding vehicle idle after journey end
Else
graphicsLayer.Graphics.Add(graphic)
End If
Else
If (EventId1 = 12 And EventId2 = 14) Then ''excluding vehicle idle after journey end
Else
graphicsLayer.Graphics.Add(graphic)
End If
End If
''adding lines''''''''''''''''''
If recordcount > 1 Then
Dim startPoint As New MapPoint(Startlong, Startlat)
Dim endPoint As New MapPoint(Endlong, Endlat)
Dim pointCollection As New ESRI.ArcGIS.Client.Geometry.PointCollection()
pointCollection.Add(startPoint)
pointCollection.Add(endPoint)
Dim polyline As New ESRI.ArcGIS.Client.Geometry.Polyline()
polyline.Paths.Add(pointCollection)
Dim graphicLine As New Graphic() With
{
.Symbol = TryCast(LayoutRoot.Resources("arrowLineSymbol"), Symbol),
.Geometry = polyline
}
If (EventId1 = 12 And EventId2 = 14) Then ''excluding vehicle idle after journey end
Else
graphicsLayer.Graphics.Add(graphicLine)
End If
End If
If recordcount = 1 Then
Else
Startlong = e.Result(Loopcnt).ETLon
Startlat = e.Result(Loopcnt).ETLat
End If
'''''''''''''''''''''''''''''''
esriLogoImage.Visibility = Windows.Visibility.Collapsed
MyMap.Visibility = Windows.Visibility.Visible
End If
txtEndLong.Text = e.Result(Loopcnt).ETLon
TxtEndLat.Text = e.Result(Loopcnt).ETLat
recordcount = recordcount + 1
Next
If datastat = False Then
MessageBox.Show("NO DATA,Pls Try Again....")
Else
MyMap.ZoomTo(graphicsLayer.FullExtent)
End If
But i am getting mapdata not available screen
I guess it's working well if you zoom out. Isn't it?
Are your graphics at the right location? (else there is a Spatial Reference mismatch somewhere).
Yes if i zoom out i can see the points on map...The clients needs to click button then need to zoom out then only they can see the map...How can i avoid this situation???
I guess it's because your graphcis are too close and so your full extent is too small. You can expand it to reach a minimal size.
What u said is correct..Almost all locations are very closer....How can i expand to reach a minimal size???