I have dataset has multiple pushpins.
when activemap gets new dataset
How can I get activemap to zoom in or out show all pushpins?
Thanks
This is a discussion on Zoom IN to show all pushpins in one screen within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have dataset has multiple pushpins. when activemap gets new dataset How can I get activemap to zoom in or ...
I have dataset has multiple pushpins.
when activemap gets new dataset
How can I get activemap to zoom in or out show all pushpins?
Thanks
Hey Xrok
Use the ZoomTo method on the DataSets Collection or a Dataset Object
Example
Sub ZoomToPushpinSet()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objPin As MapPoint.Pushpin
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
'Add a Pushpin to the map
objMap.AddPushpin objMap.FindResults("San Jose, CA")(1)
'Zoom to all the Pushpin sets
objMap.DataSets.ZoomTo
' or Zoom to the new Pushpin Set
objMap.DataSets.item("My Pushpins").ZoomTo
End Sub
Note: "My Pushpins" can be an integer index. I think the most recently created dataset is index 1 but best to refer by them by name to be sure.
Ciao,
Calv1ns
Hi,
I think 'my pushpins' is always index 1. However you are rith to refer by name in case of forward compatibility.My Pushpins" can be an integer index. I think the most recently created dataset is index 1 but best to refer by them by name to be sure
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
That help me get to do what I want a accomplished.
Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)