Thank you very much for your help Ben.
But now... I have another problem, I'm using a featureMarkerOverlay and trying to add it features from a shapefileFeatureLayer but I don´t know how.
I've tried this way:
Dim markers As New FeatureMarkerOverlay()
markers.IsBaseOverlay = False
markers.Name = "Hoteles"
Dim feats As New Collection(Of Feature)
PointLayer.Open()
feats = PointLayer.QueryTools.GetAllFeatures(ReturningColumnsType.AllColumns)
PointLayer.Close()
markers.FeatureSource.Open()
For Each feat As Feature In feats
If feat.ColumnValues("FEATTYP") = "7324" Then
markers.FeatureSource.AddFeature(feat)
End If
Next
markers.FeatureSource.Close()
But it throws a nullReferenceException when I open the featureSource of the markerLayer
I also have tried this:
Dim PointLayer As New ShapeFileFeatureLayer(MapPath("~\Maps\espes2________pi.shp"))
PointLayer.RequireIndex = False
Dim markers As New FeatureMarkerOverlay()
markers.FeatureSource = PointLayer.FeatureSource
markers.IsBaseOverlay = False
markers.Name = "Hoteles"
'proj4.Close()
markers.FeatureSource.Open()
Dim features As Collection(Of Feature) = markers.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns)
markers.FeatureSource.Close()
markers.FeatureSource.Open()
For Each feat As Feature In features
If Not feat.ColumnValues("FEATTYP") = "7314" Then
markers.FeatureSource.BeginTransaction()
markers.FeatureSource.DeleteFeature(feat.ColumnValues("ID"))
markers.FeatureSource.CommitTransaction()
End If
Next
markers.FeatureSource.Close()
But it throws an IOException when I commitTransaction.
Any idea of the reason or how to solve this?
Thanks again!