Error 1 The best overloaded method match for 'SharpMap.Data.Providers.GeometryProvider.GeometryProvider(System.Collections.ObjectModel.Collection<SharpMap.Geometries.Geometry>)' has some invalid arguments D:/Documents and Settings/Ibra/Meus documentos/Visual Studio 2005/Projects/Mapa/Mapa/Form1.cs 151 44 Mapa
System.Collections.Generic.List<SharpMap.Geometries.Geometry> Pontos = new System.Collections.Generic.List<SharpMap.Geometries.Geometry>();
.
.
.
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (map != null)
{
SharpMap.Geometries.Point ClickPnt = new SharpMap.Geometries.Point();
ClickPnt = map.ImageToWorld(new System.Drawing.Point(e.X, e.Y));
Pontos.Add(ClickPnt);
VectorLayer m_VectorLayer = new VectorLayer("Ponto");
m_VectorLayer.DataSource = new SharpMap.Data.Providers.GeometryProvider(Pontos); -> "Error"
m_VectorLayer.Style.Symbol = new Bitmap("D://BOLA1.BMP");
map.Layers.Add(m_VectorLayer);
pictureBox1.Image = map.GetMap();
}
}
Error 2 The best overloaded method match for 'SharpMap.Data.Providers.GeometryProvider.GeometryProvider(System.Collections.ObjectModel.Collection<SharpMap.Geometries.Geometry>)' has some invalid arguments D:/Documents and Settings/Ibra/Meus documentos/Visual Studio 2005/Projects/Mapa/Mapa/Form1.cs 175 32 Mapa
Error 3 Argument '1': cannot convert from 'System.Collections.Generic.List<SharpMap.Geometries.Geometry>' to 'System.Collections.ObjectModel.Collection<SharpMap.Geometries.Geometry>' D:/Documents and Settings/Ibra/Meus documentos/Visual Studio
2005/Projects/Mapa/Mapa/Form1.cs 175 77 Mapa
This error happened after I changed DLL to open the data through MsSqlSpatial
Ibraim,
I was getting the same sort of error as your error 3. It went away when I used the correct versions of the SharpMap.dll and SharpMap.UI.dll. The version numbering it was looking for was 0.9.2423.31552.
HTH
Best regards
...And it's not needed a reference to MsSqlSpatialLibrary.dll. It's uniquely to be used by msscmd.exe and to be deployed in the database, it should be not used in other contexts.