1

I am developing a GIS_desktop application with VB.NET and MapWinGIS. When I load a shapefile into the application, it is displaying blocks instead of the actual polygons

display shapefile.

The shapefile is supposed to display the polygons as shown in the attached

original shapefile

  • Are you sure you just haven't forgot to set a border somewhere? That's how it would look if it used the same color as the fill. – lynxlynxlynx May 7 '18 at 7:32
  • Thank you for your response l managed to solve the problem using another method. l went back to my code and set the line width to 2. – tats May 8 '18 at 19:08
  • Please write up a short answer with the solution and accept it. – lynxlynxlynx May 8 '18 at 19:22
  • using this code 'Dim linewidth As Single Dim inHandle As integer linewidth =2 AxMpap1.set_ShapeLineWidth(intHandle,lineWidth)' – tats May 9 '18 at 12:47
  • An answer, not a comment. – lynxlynxlynx May 9 '18 at 17:07
1

I used this code to add line width, shape fill color and line color

enter code here
Public Sub LayerSymbology()         
    Dim LineWidth As Single           
    Dim FillColor As UInt32           
    Dim FIllLine As UInt32

    FillColor = Convert.ToInt32(RGB(100, 255, 0))            
    FillLine = Convert.ToInt32(RGB(0, 0, 0))            
    LineWidth = 2

    AxMap1.set_ShapeLayerFillColor(intHandle, FillColor)            
    AxMap1.set_ShapeLayerLineColor(intHandle, FIllLine)            
    AxMap1.set_ShapeLayerLineWidth(intHandle, LineWidth)
End Sub 

Private Sub ToolsStripButton1_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles BtnFile.Click             
    Dim shpfile As New MapWinGIS.Shapefile            
    Dim openDig As New OpenFileDialog

    openDig.Filter = "Supported Formats|*.shp*"  
    openDig.CheckFileExists = True

    If openDig.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then       
        shpfile.Open(openDig.FileName)         
        AxMap1.AddLayer(shpfile, True)
    End If

    LayerSymbology()
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.