Dear All,
I have create multiple ring on a particular LAT LONG. Number of ring, distance from center and ring Border Color is depend on user. I have created ring with specified diatance, but not able to change the boder color.
Please help, and I also want to add layer for controling the layer, so that user can select layer. Following are the code
Dim
winformsMap1 As WinformsMap = DirectCast(WinformsMap1, WinformsMap)
Dim no As Integer = Val(drpNoOfRings.Text)
Dim RingBufferShape(no - 1) As EllipseShape
Dim RingName As String = ""
Dim ringLayer As InMemoryFeatureLayer = New InMemoryFeatureLayer()
Dim ringFeatureLayer As New LayerOverlay()
ringFeatureLayer.Layers.Add("ringFeatureLayer", ringLayer)
Dim Longitude As Double = Convert.ToDouble(txtLongitude.Text, CultureInfo.InvariantCulture)
Dim Latitude As Double = Convert.ToDouble(txtLatitude.Text, CultureInfo.InvariantCulture)
Dim dRadius As Double = 1
Dim i As Integer = 0
Dim ColorHexCode As String
Dim ColorRGBCode As String
Dim CurSelectedColor As Color
Dim CurColor As GeoColor
For i = 0 To grdRing.RowCount - 1
Application.DoEvents()
ColorHexCode = grdRing.Rows(i).Cells("ColorCode").ToString
ColorRGBCode = ConvertColor.HEX2RGBColor(ColorHexCode)
CurSelectedColor = System.Drawing.ColorTranslator.FromWin32(CInt(ColorRGBCode))
CurColor = New GeoColor(CurSelectedColor.R, CurSelectedColor.G, CurSelectedColor.B)
dRadius = 0
dRadius = constKMinDouble * Val(grdRing.Rows(i).Cells("Distance").Value)
RingBufferShape(i) = New EllipseShape(New PointShape(Longitude, Latitude), dRadius, dRadius)
RingName = "R" & i.ToString
RingBufferShape(i).Id = RingName
ringLayer.InternalFeatures.Add(RingName, New Feature(RingBufferShape(i)))
ringLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = CurColor
ringLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Next
winformsMap1.Overlays.Add("ringLayerOverlay", ringFeatureLayer)
winformsMap1.Refresh()
Application.DoEvents()
Me.Dispose()
Regards
Sanjay