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 ''excluding vehicle idle after journey end Else graphicsLayer.Graphics.Add(graphicLine) End If End IfSolved! Go to Solution.
I am getting error "The type 'ArrowPatternTransformer' does not support direct content"
<extendedSymbols:ExtendedLineSymbol x:Key="arrowLineSymbol" Fill="Red" > <extendedSymbols:ExtendedLineSymbol.GeometryTransformer> <extendedSymbols:ArrowPatternTransformer AtEnd="True" > <extendedSymbols:ArrowPatternTransformer.CompositeTransform> <CompositeTransform ScaleX="5" ScaleY="3" /> </extendedSymbols:ArrowPatternTransformer.CompositeTransform> </extendedSymbols:ArrowPatternTransformer> </extendedSymbols:ExtendedLineSymbol.GeometryTransformer> </extendedSymbols:ExtendedLineSymbol>
<extendedSymbols:ExtendedLineSymbol x:Key="arrowLineSymbol" Fill="Red" > <extendedSymbols:ExtendedLineSymbol.GeometryTransformer> <extendedSymbols:ArrowPatternTransformer AtEnd="True" /> </extendedSymbols:ExtendedLineSymbol.GeometryTransformer> </extendedSymbols:ExtendedLineSymbol>
Wowww...Working perfect ...Thank u so much...
1.How can i reduce the redcolour arrow size?
2.Sometimes 2 graphics will add on the same location with different attribute.This time only i can see the arrow without line.How can i avoid this case?
With Lottssssss Thankssssss
<extendedSymbols:ExtendedLineSymbol x:Key="arrowLineSymbol" Fill="Red" > <extendedSymbols:ExtendedLineSymbol.GeometryTransformer> <extendedSymbols:ArrowPatternTransformer AtEnd="True" > <CompositeTransform ScaleX="5" ScaleY="3" /> </extendedSymbols:ArrowPatternTransformer> </extendedSymbols:ExtendedLineSymbol.GeometryTransformer> </extendedSymbols:ExtendedLineSymbol>
<extendedSymbols:ExtendedLineSymbol x:Key="arrowLineSymbol" Fill="Red" > <extendedSymbols:ExtendedLineSymbol.GeometryTransformer> <extendedSymbols:ArrowPatternTransformer AtEnd="True" > <CompositeTransform ScaleX="5" ScaleY="3" /> </extendedSymbols:ArrowPatternTransformer> </extendedSymbols:ExtendedLineSymbol.GeometryTransformer> </extendedSymbols:ExtendedLineSymbol>
Not done in the sample but you might do it by tweaking the AddPatterns code for adding the pattern only if the geometry path has a length greater than a tolerance threshold
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("arrowLineSymbol"), Symbol),
.Geometry = polyline
}
'.Geometry = mercator.FromGeographic(polyline)
If (EventId1 = 12 And EventId2 = 14) Then ''excluding vehicle idle after journey end
Else
graphicsLayer.Graphics.Add(graphicLine)
End If
End If
I am getting error "The type 'ArrowPatternTransformer' does not support direct content"
<extendedSymbols:ExtendedLineSymbol x:Key="arrowLineSymbol" Fill="Red" > <extendedSymbols:ExtendedLineSymbol.GeometryTransformer> <extendedSymbols:ArrowPatternTransformer AtEnd="True" > <extendedSymbols:ArrowPatternTransformer.CompositeTransform> <CompositeTransform ScaleX="5" ScaleY="3" /> </extendedSymbols:ArrowPatternTransformer.CompositeTransform> </extendedSymbols:ArrowPatternTransformer> </extendedSymbols:ExtendedLineSymbol.GeometryTransformer> </extendedSymbols:ExtendedLineSymbol>