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

Changes to MapBox

Jun 19, 2012 at 10:36 AM


I've encountered a couple of issues with MapBox that required modifications. I assume I cantcommit changes to MapBox myself so thought i'd propose the changes here:


Change 1

The mouse wheel is inverted. Scrolling forward zooms out and backwards zooms in. The other way around is more natural. So in OnMouseWheel I changed the line:

double scale = (e.Delta / 120.0);


double scale = (0-e.Delta / 120.0);

I understand this may not be what everyone wants so a better approach may be to have a boolean property called InvertMouseWheel and use this to determine whether to invert the delta value or not (with the default being to use the current behaviour).


Change 2

When I use a background tile layer I often found that not all the tiles would be displayed and the map would need to be refreshed for them all to appear. So in HandleMapNewTileAvaliable I changed the line:




This solved the problem.


Please let me know how to proceed with these changes.


Jun 19, 2012 at 10:45 AM


The mousewheel scrolldirection can be controlled by setting the property WheelZoomMagnitude to -1*WheelZoomMagnitude (or an exact value).
Probably we should think of changing the default value from 2 to -2 since that is what most internet controls today use

I will look into the other issue with tile-layers

Aug 21, 2012 at 1:00 PM


Hi everyone,
when  loading the tiles asynchron as backgound layer I noticed the same problem that not all tiles are displayed. I guess if this happens one reason for it can be that by sending the HTTP Requests the maximum number of concurrent connections has been exceeded.
So in my case inserting the following code to increase the default number of connections before loading a tiles layer helped.

System.Net.ServicePointManager.DefaultConnectionLimit = 80;