PDA

View Full Version : zoom level and scalebar



marcick
04-26-2013, 02:01 AM
Hallo,
I have a VB.NET app that uses MappointControl object (MP 2011 europe). I need a scalebar on the map (eg 1cm = 100mt and so) but I don't like much that one included in the built-in toolbar nr 4, it's too much invasive on small screen.
Is it possible to intercept an event everytime the zoomlevel change ? I autoanswer to this, it seems the AfterRedraw eventi is ok for this.
But now, how to determine the scale to show my own ruler of the correct lenght ? How many km is the with/height of the map after a redraw event is generated ?
Thanks
Marco

dudel
09-20-2013, 06:50 AM
I found the the mouse roll zoom to be too course, so I implemented my own zoom using the altitude property. This gives me much finer resolution for sizing a map that will be printed or copied.
private void cmdZoomIn_Click(object sender, EventArgs e)
{
MPC.ActiveMap.Altitude--;
}
private void cmdZoomOut_Click(object sender, EventArgs e)
{
MPC.ActiveMap.Altitude++;
}


Getting the altitude to translate into distance per inch should be doable. I need to ponder on that a bit.

thanks,

Don

marcick
09-23-2013, 06:21 AM
Hi Dudel,
I'll have a look to the altitude property to see how is related to the scalebar, thanks
Marco

marcick
09-24-2013, 03:47 AM
Seems easy.
Detecting the AfterRedraw event, you multiply the property Width and PixelSize and obtain the distance covered by the map width (in Km or miles depending by the units).
Then just need to invent a scalebar as I like.
Thanks
Marco