Hi Tsui,
I’m having the same issue of points behind the lines with 4.5.15.0
This is the code:
Private Sub WpfMap1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles WpfMap1.Loaded
WpfMap1.MapUnit = GeographyUnit.DecimalDegree
WpfMap1.CurrentExtent = New RectangleShape(-50, 16, 66, -50)
WpfMap1.BackgroundOverlay.BackgroundBrush = New GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255))
Dim worldLayer As ShapeFileFeatureLayer = New ShapeFileFeatureLayer(System.Windows.Forms.Application.StartupPath & “\Data\Countries02.shp”)
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.County1
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Dim layerOverlay As LayerOverlay = New LayerOverlay()
layerOverlay.Layers.Add(“worldLayer”, worldLayer)
WpfMap1.Overlays.Add(“WorldOverlay”, layerOverlay)
'Adds the Overlay that contains the lines and points
Dim TracksOverlay As New LayerOverlay
TracksOverlay.TileType = TileType.SingleTile
WpfMap1.Overlays.Add(“TracksOverlay”, TracksOverlay)
Dim InMemoryTrackFeatureLayer As New InMemoryFeatureLayer
InMemoryTrackFeatureLayer.ZoomLevelSet.ZoomLevel03.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.Red, 3, True)
InMemoryTrackFeatureLayer.ZoomLevelSet.ZoomLevel03.DefaultPointStyle = PointStyles.City2
InMemoryTrackFeatureLayer.ZoomLevelSet.ZoomLevel03.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
InMemoryTrackFeatureLayer.Open()
Dim LS As New LineShape()
LS.Vertices.Add(New Vertex(0, 1))
LS.Vertices.Add(New Vertex(2, 1))
'Adds the point before
InMemoryTrackFeatureLayer.InternalFeatures.Add(New Feature(New PointShape(0.5, 1).GetWellKnownText, “Track1Point1”))
'Adds the line
InMemoryTrackFeatureLayer.InternalFeatures.Add(New Feature(LS.GetWellKnownText, “Track1”))
'Adds the point after
InMemoryTrackFeatureLayer.InternalFeatures.Add(New Feature(New PointShape(1, 1).GetWellKnownText, “Track1Point2”))
InMemoryTrackFeatureLayer.Close()
TracksOverlay.Layers.Add(InMemoryTrackFeatureLayer)
WpfMap1.CurrentExtent = TracksOverlay.GetBoundingBox()
WpfMap1.Refresh()
End Sub
As you can see, no mater the order I add the Features to the Layer, the LineShape is always drawn on top. In addition, when this happens and I try to GetFeaturesNearestTo the point, the points are never detected, only the line.