Create map in VB.NET

  • Thread starter Thread starter JasonL
  • Start date Start date
J

JasonL

How do I create a map in VB.net where user can "drag" it using their stylus
as the map size is big and how to create a zoom in , zoom out function for
it? I would like to do something similar to those map in
http://www.mapopolis.com/

Thanks in advance
 
Jason,
Using the classes available in System.Drawing & System.Drawing.Drawing2D,
this is relatively painless.

To support zooming use the Graphics.ScaleTransform method.

To support panning (drag) use the Graphics.TranslateTransform method.

I would set Graphics.PageUnit & Graphics.PageScale to some reasonable
defaults for my data. For example Millimeter, then store all the data scaled
to Millimeters. You can then simply draw this data in the units stored.
Setting the Graphics.ScaleTransform would give you zoom ability...

Charles Petzold's book "Programming Microsoft Windows with Microsoft Visual
Basic.NET" from MS press has a number of chapters that describe how to use
the various objects in System.Drawing & System.Drawing.Drawing2D namespace.

Hope this helps
Jay
 
Back
Top