Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: how to write expression with vb.net in mapwingis (ShapefileCategory.Expression)

$
0
0
I would like to give color to the map with new category. to make must make previous expression. I've tried but still failed. What is wrong ? Please help me.
Dim category As MapWinGIS.ShapefileCategory = sf.Categories.Add("Manual")
Dim ad As String = "Alaska"
Dim UniqueShape As New MapWinGIS.Shapefile
UniqueShape = FormMain.AxMapMain.get_GetObject(idx)

Dim af As String = UniqueShape.Table.Field(1).Name
Const cote As String = """"

'failed
' category.Expression = "[STATE_NAME] = """ + ad + """"
'failed
' category.Expression = "[STATE_NAME] <> """""
'failed
category.Expression = "[" + af + "] = " + ad
'failed
category.Expression = "[STATE_NAME] = " & cote & "Alaska" & cote
'failed
'category.Expression = "[STATE_NAME] = ""Alaska"""

Dim utils As New MapWinGIS.Utils
category.DrawingOptions.FillColor = utils.ColorByName(MapWinGIS.tkMapColor.Magenta)
sf.Categories.ApplyExpression(0)

sf.DefaultDrawingOptions.Visible = False
' FormMain.AxMapMain.AddLayer(sf, True)
FormMain.AxMapMain.Redraw()
FormMain.AxMapMain.Refresh()

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>