This project has moved and is read-only. For the latest updates, please go here.

Where to find MapBox and MapBox Toolbar?

Topics: SharpMap v0.9 / v1.x, WinForms Controls
May 21, 2009 at 3:38 PM

Trying to catch up with SharpMap developments, bring myself up to date (more or less).  I would like to use both MapBox (and its associated toolbar) and MapImage in my desktop application.  I am using an older version, MapBox exclusively, from a previous patch version, that supported rasters, I understand this capability has been folded into the trunk.  The previous version has the userful MapBox toolbar that allows zooming, etc.

Using change set 44819, I do not find MapBox or MapToolbar to be available to me anywhere, SharpMap.Forms, which previously contained MapBox, now only contains MapImage.  But I do find recent discussion posts still referring to MapBox.  If need be, I will re-configure my application to use MapImage exclusively (I have not yet tested the raster capability), but would really like to get the toolbar capability of MapBox for MapImage as well.

Any help much appreciated, thanks in advance.

Richard Males

Cincinnati, Ohio, USA


May 21, 2009 at 6:28 PM

Hi Richard, you can use the MapBox from the SharpMap.UI project in the trunk. It doesn't have a ToolBar as such but it has an ActiveTool property which takes a value from the Tools enum, hence it is very straight forward to build a tool bar (or any other ui) hth jd

May 28, 2009 at 10:15 PM


You should be able to add the MapBox.cs, MapToolBar.cs and DCButton.cs from my patch to the latest change set of the SharpMap.UI project.  MapBox and MapImage are essentially, the main difference is that the MapBox Paint() event is overriden to allow caching.  They can be used interchangibly, so you shouldn't need to use both.


May 28, 2009 at 11:39 PM

Thanks.  I am currently using an earlier version of the trunk for the dlls (change set 44819).   I am assuming I can pull the code in your latest patch and still use it with these older dlls.  Let me know if you think I need to rebuild the trunk (I only have Visual Studio c# express, which will not build it directly, so need to get the build done for me by a colleague).





May 31, 2009 at 10:55 PM


Sorry to bother you again.

I have been trying to get a simple example put together utilizing the MapBox and MapToolBar from your patch.   I am, as noted in previous post, using the dlls from change set 44819 (would like to stay with the trunk builds if possible to be consistent with the overall SharpMap project direction), but I get various compile errors.  I also needed to add the resource.designer.cs to the project, complains about  m_Map.ZoomNearestRSet(bZoomIn) not being a member of m_Map, does not like GetStyle with 2 arguments.

 fdr = ds.Tables[0][i];
                                        if (!(layer.Theme.GetStyle(ds.Tables[0][i], layer) as SharpMap.Styles.VectorStyle).Render)

I would really like to have the additional zooming capabilities (in particular zoomwindow) and other tools that are available with the MapBox and the toolbar, or, at minimum replicate these with MapImage, but I am basically trying to be a user of whatever the "standard" SharpMap is at present.  If I can't get these capabilities relatively easily with my admittedly limited skills and understanding, I will just make do with what I can get out of MapImage, but if there is a relatively straightforward way to get these capabilities, I would much appreciate being pointed in the right direction.  I have started by building my own toolbar and implementing the various ActiveTools available in MapImage for each button, I could use some guidance on implementing the ZoomWindow without it being available directly in MapImage


Thanks in advance.


Dick Males

Cincinnati, Ohio, USA