This project has moved and is read-only. For the latest updates, please go here.

Display some points in VB

Topics: General Topics
Nov 2, 2006 at 9:06 PM
I'd like to draw a point, but I'm using VB. I don't know where is the problem

here is the code:

map = New SharpMap.Map(MapImage1.Size)

Dim layer As New SharpMap.Layers.VectorLayer("track")

Dim GeomColl As New Collection(Of SharpMap.Geometries.Geometry)
GeomColl.Add(New SharpMap.Geometries.Point(10, 10))

layer.DataSource = New SharpMap.Data.Providers.GeometryProvider(GeomColl)
Jul 15, 2007 at 3:12 AM
This works for me using an ImageMap component in a form (note that Layer3 has an index of 2 here, as there were 2 previous layers added):

Dim Layer3 As New SharpMap.Layers.VectorLayer("Layer3")
Dim PointColl As New System.Collections.Generic.List(Of SharpMap.Geometries.Geometry)

Layer3.DataSource = New SharpMap.Data.Providers.GeometryProvider(PointColl)

PointColl.Add(New SharpMap.Geometries.Point(-50.6786, -21.51))
PointColl.Add(New SharpMap.Geometries.Point(-50.67875, -21.515))
PointColl.Add(New SharpMap.Geometries.Point(-50.67865, -21.525))
PointColl.Add(New SharpMap.Geometries.Point(-50.6784, -21.52))
PointColl.Add(New SharpMap.Geometries.Point(-50.67833, -21.53))
PointColl.Add(New SharpMap.Geometries.Point(-50.67825, -21.531))

MapImage1.Map.Zoom = MapImage1.Map.Zoom * 1.1