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

How to get the map scale from a MapBox?

Topics: SharpMap Project
Nov 16, 2012 at 4:57 PM

Using a MapBox with a Google Maps tile layer how do I get the scale on both the X and Y axis of what is currently in the visible map?

I've been looking at MapBox.Map.Envelope but the values seem a bit strange. The Height reported approximates the visible width (if I compare it to the value reported in Google Earth using the ruler tool). The Width reported does not approximate the visible height.

What are the axes? The pre-defined map schema is BruTile.PreDefined.SphericalMercatorInvertedWorldSchema and this has the Axis property set to InvertedY. Is this why the Height value looks like the Width? What about the height then since the value of Width reported is not even close to the actual visible height (again, compared to the value reported by the ruler tool in Google Earth).

How do I convert the visible Envelope of the Map into an X and Y distance in metres?