How to restrict map area in ActiveX?

ErikS
07-06-2004, 08:14 AM
I'm making an application for displaying locations and routes within one city and woul'd like to prevent the user from panning away or zooming out to far, while still being able to zoom in on parts of the city.

I know that it is possible to disable zoom and pan completely, I just want to restrict the area.

Thanks for any tips,
/Erik

Daniel
07-26-2004, 12:34 PM
I'm planning on doing something very similar. For the zoom functionality I've done this...


Dim MaxAltitude As Interger
Private Sub Form_Load()
MaxAltitude = objMap.Altitude
End Sub

Private Sub mpc_AfterViewChange()
If objMap.Altitude > MaxAltitude Then objMap.Altitude = MaxAltitude
End Sub

If you have a mousewheel and spin it too fast you can get outside or your MaxAltitude although as soon as the view changes again it will reset. I'm working on the panning at the moment, will post as soon as I have something.

 
Web mp2kmag.com
mapforums.com