Hi
Please can help me with this
I’m not an English speaker, sorry for my redaction
I try to fill diferentes polygon, but only fill one by one, i want to make same this code
I try with this code but only fill one
This code from “Getting Started With the MapWinGIS ActiveX Control”
'Set up a coloring scheme for the countries polygons` Dim ShapeNum As Integer` Dim Region As String`
im FieldNum As Integer
FieldNum = 2
For ShapeNum = 0 To sfWorld.NumShapes - 1
Region = sfWorld.CellValue(FieldNum, ShapeNum)
Select Case Region
Case “Antarctica”
mapMain.set_ShapeFillColor(hndWorld, ShapeNum,
… Convert.ToUInt32(RGB(100, 50, 0)))![map|690x470]
Case “Asia”
mapMain.set_ShapeFillColor(hndWorld, ShapeNum,
… Convert.ToUInt32(RGB(120, 70, 20)))
i try with this
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim myWorldShape As New Mapwingis.Shapefile
Dim Nestado As Integer = 0
Nestado = CInt(TextBox1.Text)
sfWorld = AxMap1.get_Shapefile(hndWorld)
myWorldShape = AxMap1.get_GetObject(hndWorld)
For i As Integer = 0 To myWorldShape.NumShapes
If myWorldShape.CellValue(0, i) = Nestado Then
MsgBox(myWorldShape.CellValue(1, i).ToString, MsgBoxStyle.OkOnly, "Estado")
'pintar
pintar(i + 1)
End If
Next
End Sub
Public Sub pintar(cve_ent As Integer)
'Creado por: Daniel RM Fecha: 17/05/19 pinta los poligonos en la posicicon recibida
AxMap1.Projection = tkMapProjection.PROJECTION_NONE
AxMap1.GrabProjectionFromData = True
Dim cad As String
cad = String.Format("{0:00}", cve_ent) 'Agregamos formato igual al de la tabla de id
Dim ct As New Mapwingis.ShapefileCategory
ct = sfWorld.Categories.Add("Estados") ' Agregamos una categoria
ct.Expression = "[CVE_ENT] = """ + cad + """" ' Condicion a cumplir
Dim Utils = New Utils
ct.DrawingOptions.FillColor = Utils.ColorByName(tkMapColor.Green) 'pintamos el poligono
sfWorld.Categories.ApplyExpression(0) ' aplicamoS la expresion en el indice seleccionado
End Sub
I want to fill more than one at a time