2

I can add points to a map but I want to show an image (like a baloon or location sign) instead of the default red circle for the points. how can I do that with Sharpmap? my code to draw points is:

    Dim vlay2 As New VectorLayer("Points")
    Dim geomColl As New Collection(Of GeoAPI.Geometries.IGeometry)()
    'Get the default geometry factory
    GeoAPI.GeometryServiceProvider.Instance = New NetTopologySuite.NtsGeometryServices()
    Dim gf As GeoAPI.Geometries.IGeometryFactory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory()

    geomColl.Add(gf.CreatePoint(New GeoAPI.Geometries.Coordinate(TextBox2.Text, TextBox3.Text)))
    vlay2.DataSource = New SharpMap.Data.Providers.GeometryProvider(geomColl)
    Mapbox1.Map.Layers.Add(vlay2)
    Mapbox1.Refresh()
1

I found My answer. we can do that by using:

    Dim img As Image = Image.FromFile("D:\Desktop\Pics\compass.png")
    vlay2.Style.Symbol = img
    Mapbox1.Map.Layers.Add(vlay2)

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.