"Hello world" code for Brutile DotSpatial integration

Jan 12, 2012 at 3:05 PM

Dear all,

is there an "Hello world" code for Brutile DotSpatial integration? Just an example with a Map component and a Brutile Layer.

Thank you,


Jan 23, 2012 at 6:27 PM

This would be nice. 

I could try to work on something such as this, but there are no promises that it would work seamlessly. 

Jan 24, 2012 at 8:16 PM

I will wait for you, it would be great!

Jan 27, 2012 at 8:49 PM

I have added a tutorial that shows how to get the WebMap extension. I'm not sure whether this will help you.


Jan 29, 2012 at 8:40 PM

Hu mudnug,,
first of all thank for your time.

I have just read your blog post, but I do not know if it will help me. My goal is to insert in a simple app that we are trying to develop the WebMap toolbar.
In this image our app, and the place where we could insert WebMap toolbar: http://i.minus.com/irWEQNGf4XEgz.png

We would like to have it as default tool and not to load it using Extension Manager. Moreover we are not using in this moment the "File menu" useful to load Extension Manager.

Probably our goal is a simple one, but in this moment we are not able to load extension manager with "our" toolbar.


Best regards,


Jan 30, 2012 at 4:21 PM

We have a simple app that uses BruTile outside of the WebMap plugin.  Very much along the lines of a "Hello World" example.

You can download the DotSpatial BruTile layer here:



In the Form_Load

            ToolStripDropDown tsDropDown = new ToolStripDropDown();
            ToolStripDropDownButton tsDropDownButton;
            tsDropDownButton = new ToolStripDropDownButton("Map Type");
            tsDropDownButton.DropDown = tsDropDown;
            tsDropDown.Items.Add("None", null, tsDropDown_OnClick);
            tsDropDown.Items.Add("Google Satellite", null, tsDropDown_OnClick);
            tsDropDown.Items.Add("Google Map", null, tsDropDown_OnClick);
            tsDropDown.Items.Add("Yahoo Map", null, tsDropDown_OnClick);

In the tsDropDown_OnClick event

        private void tsDropDown_OnClick(object sender, EventArgs e)
            ToolStripItem tsItem = sender as ToolStripItem;

            Cursor tmpCursor = Cursor.Current;            
            Cursor.Current = Cursors.WaitCursor;

                if (_btLayer != null)

                    _btLayer = null;

                if (String.Compare(tsItem.Text, "Google Satellite", true) == 0)
                    _btLayer = BruTileLayer.CreateGoogleAerialLayer();
                    _btLayer.LegendText = "Google Satellite";
                else if (String.Compare(tsItem.Text, "Google Map", true) == 0)
                    _btLayer = BruTileLayer.CreateGoogleMapLayer();
                    _btLayer.LegendText = "Google Map";
                else if (String.Compare(tsItem.Text, "Yahoo Map", true) == 0)
                    _btLayer = BruTileLayer.CreateYahooMapLayer();
                    _btLayer.LegendText = "Yahoo Map";

                else if (String.Compare(tsItem.Text, "None", true) == 0)



Hope this helps.


Jan 30, 2012 at 4:47 PM

I'll also write a tutorial that illustrates how to use the current extension in your toolbar (in case that is what you want).

Jan 30, 2012 at 4:52 PM

Hi Kurt,
you are very kind. Thank you very much.

I'll try your code as soon as possible, and I will write you.

Best regards and once again thank you,


Jan 30, 2012 at 4:57 PM

Hi Mudnug,
you are very kind too, and this second tutorial would be a big present for me.


Do it only if you have the time and if it's very easy for you.
Best regards,
Jan 30, 2012 at 11:45 PM

Here's the tutorial http://wp.me/pvy5A-2v. I realized this can be an expansive topic, so my initial comments are somewhat limited. Let me know if you need more information.

Jan 31, 2012 at 7:27 PM

Hi mudnug,
I have no words, thank you very much.

I will make a test as soon as pobbile.

Best regards,


Feb 2, 2012 at 3:46 PM

it works great but Extreemly slow

it takes about 10 sec to zoom in

Feb 2, 2012 at 5:31 PM

That sounds rather slow. Are you referring to the 2010  BruTile layer? We sped it up when we pulled it into an extension for DotSpatial.

Feb 2, 2012 at 9:03 PM
Edited Feb 2, 2012 at 10:10 PM


You may have to disable automatic detection of proxy in you internet-explorer settings


Sped up doing what?

Feb 3, 2012 at 2:32 PM
FObermaier wrote:


You may have to disable automatic detection of proxy in you internet-explorer settings


Sped up doing what?

Got it to work with disabling the automatic detextion of proxy

but that is a workaround not a solution, i can't ask all people to do the same

i used the BruTileLayer Control

BruTile version
DotSpatial from changset 1559 

the only thing i changed in BruTileLayer is 

_projection = ProjectionInfo.FromEpsgCode(epsgCode);


maby i should try with the latest BruTile source

but i would like to get a "Hello World" excample on how to use the WebMap plug-in through code and not drag & drop



Feb 3, 2012 at 3:28 PM

Some changes have been made in BruTile to address the auto proxy detection performance issues.  I think I heard that these changes might be redone in favor of a cleaner approach,, but that the performance issues would still be addressed.  Anyway, it would be worth a try to see if you can get it to work with the latest BruTile.  You might have to make some code adjustments to get your code that is consuming BruTile to build.


Feb 19, 2014 at 8:30 AM
Edited Feb 19, 2014 at 8:30 AM
but what is this _btLayer? Where should i define it in my C# code or is it a layer?