Loading Street level Names with Map

May 7, 2012 at 7:44 PM

Have a Visual studio VB 2010 project with the following requirements:

Map of UK with zoom and pan
Zoom in to local strrets with names shown.
Show footpaths

I have the MapWinGis ActiveX loaded and can display .shp and raster files ok.
I have downloaded England .shp files from OpenStreet Map.
First question:- this are very slow loading, I surpose this is because I am loading them all at full extents and should load some as I zoom in?
Second question:- When zoomed in to local street level the roads are only shown as single lines not double lines as on  OpenStreet Map and the names are not shown. There is a .dbf file which has the names in it, how do I load this? and how do you get the double lines?
Third Question:- Cannot find the footpaths in .shp files, where can they be located?
Fourth Question:- I have a lot of Raster (.Tiff) files which are tiles, I can load each one, how can I load them so that as I pan the next one loads? 


May 8, 2012 at 12:05 AM

1. How many features are in the shapefile? if its roads for England I'm going to assume its many thousand. You can either try breaking the shapefile into region shapefiles and then load those on a need basis -AND/OR- use a visibility expression to render only those within a region. For example you can use "[County] = 'Cheshire'" if your shapefile has that information. That may even be too much and you may have to use an expression based on city. The visibility expression is discussed in the documentation here http://mapwingis.codeplex.com/documentation, try the first link and then go to the shapefile hierarchy or do a search for "VisibilityExpression".

2. You have to tell MapWindow how to render the symbology and the labels. For symbology there are some good examples on the link http://mapwingis.codeplex.com/documentation in the middle of the page along with a labeling sample. I think i saw an example for a railroad symbology so following the example I'm sure you could devise one for roads.

3. Don't know what footpaths are so if its not included in the shapefile then maybe its calculated. You may have to come up with an algorithm for that.

4. That may have to be done in an map_ExtentsChanged event in your code so that it loads the tiff based on its current extents. You may want to pre-load several tiles around your point of interest and then if the user pans or changes extents then you adjust accordingly.

I would recommend spending some time with the documentation and examples. That will go a long way to understand the framework. Again most of it is here





May 10, 2012 at 4:29 PM

@ sindizzy Thanks for the reply, I had looked through some examples documentation but only VB.net ones, there are a lot of C# so I shall go through these. I mainly use VB and this project was in Visual Studio  2010, I will have to covert code from C# to vb, so will have a look through the examples and documentaion.

Thanks David