How to improve the rendering of ShapeFiles? Any way to include a Blank Layer?

Topics: SharpMap v0.9 / v1.x
Mar 5, 2015 at 10:16 AM
Hi.

I'm using Sharpmap to show 4-5 shp layers. As i using WPF, I use map.GetMap() to show the result in a Bitmap. I have tried with OSM layer and it works perfectly.
The problem comes when i try to show shp files when no internet connection. I load these layers as a vector Sharpmap layer. They show correctly but when i try to pan or to zoom the performance is really poor, the app gets stuck. When I zoom in the app behaves correctly becouse the map is more simple than when i show whole map. I think is a problem of the complexity that map has. On the other hand, these files aren't very big, max 2mb.
Any ideas?

I have another question.
It is possible to add a blank or empty layer?? I mean a layer without graphics but when i click on it return coordinates of the position, like an OSM layer without tiles.

Thanks in advance.
Coordinator
Mar 6, 2015 at 8:20 AM
Edited Mar 6, 2015 at 8:23 AM
  1. Threre is a WPF control in Branches/1.0. Currently you have to compile the solution yourself, though. You might want to disable the use of a memory cache. (ShapeFile.UseMemoryCache=false;)
  2. Create yourself a class implementing IProvider and use that as a datasource for your layer.
Quick guide to the provider:
  • The constructor should take the extent/envelope you want covered,
  • The IProvider.GetExtents() method should return just that,
  • All GetXXX functions should return 0 or empty lists , ExecuteXXX should do nothing.
Mar 6, 2015 at 12:55 PM
I think already do that by:
            SharpMap.Layers.VectorLayer smVectorLayer = new SharpMap.Layers.VectorLayer(layerName);

            smVectorLayer.DataSource = new SharpMap.Data.Providers.ShapeFile(pathToFile, true, false);

            map.AddLayer(smVectorLayer);

    Where pathToFile is the .shp file.
The next SharpMap 1.2 will have wpf support??

Thanks.
Coordinator
Mar 6, 2015 at 8:17 PM
88madri wrote:
I think already do that by:
            SharpMap.Layers.VectorLayer smVectorLayer = new SharpMap.Layers.VectorLayer(layerName);

            smVectorLayer.DataSource = new SharpMap.Data.Providers.ShapeFile(pathToFile, true, false);

            map.AddLayer(smVectorLayer);
yes
The next SharpMap 1.2 will have wpf support??
We are working on that.