I am trying to add some features on my map.
I do the following on form load
Map1.MapUnit = GeographyUnit.DecimalDegree
Map1.BackgroundOverlay.BackgroundBrush = New GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)
Dim baseLayer As New ShapeFileFeatureLayer(mapPath)
baseLayer.RequireIndex = False
baseLayer.zoomlevelset.zoomlevel01.DefaultAreaStyle = AreaStyles.Country1
baseLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Dim layerOverlay As New LayerOverlay()
layerOverlay.Layers.Add(baseLayer)
Map1.Overlays.Add(layerOverlay)
Map1.CurrentExtent = New RectangleShape(22.835, 41.2921, 25.8892, 40.4029)
Dim pointLayer As New InMemoryFeatureLayer()
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType = PointType.Symbol
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolType = PointSymbolType.Circle
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Dim dynamicOverlay As New LayerOverlay()
dynamicOverlay.Layers.Add("PointLayer", pointLayer)
Map1.Overlays.Add("PointOverlay", dynamicOverlay)
Map1.Refresh()
and at some point i try to draw some icons
Public Sub drawOnMap()
For Each u As User In Me.list.Values
If u.lastPosition.x <> Nothing And u.lastPosition.y <> Nothing Then
Dim latitude As Double = Convert.ToDouble(u.lastPosition.y, CultureInfo.InvariantCulture)
Dim longitude As Double = Convert.ToDouble(u.lastPosition.x, CultureInfo.InvariantCulture)
Dim feature As New Feature(longitude, latitude, "user" & u.userId)
Dim pointLayer As InMemoryFeatureLayer = DirectCast(Form1.Map1.FindFeatureLayer("PointLayer"), InMemoryFeatureLayer)
If Not pointLayer.InternalFeatures.Contains("user" & u.userId) Then
pointLayer.InternalFeatures.Add("user" & u.userId, feature)
End If
End If
Next
Form1.Map1.Refresh(Form1.Map1.Overlays("PointOverlay"))
End Sub
Via the debug i can confirm that u.lastPosition.x and .y are valid decimal values and withing the map
However i do not see the circle symbols as i defined it to.
Can you please help me as i am new to this?