What is it: ZoomIn, ZoomOut, ZoomTo or Altitude??

VC_Man
12-21-2006, 02:39 AM
laguage: VC++

Hi MP-guru's

I'm having problem with zoom-function.
First I use zoom by giving Altitude an value when creating a location.
But suppose I want to see all the pushpins of a few datasetS on the map, than I have to use ZoomTo function of datasetS object. But what value do I have to give the Altitude. Because if I do nothing, the zoom goes back to the zoom of Altitude...

It's a bit confusing to me, so I hope someone can help me.


Thank you.

VC_Man
12-21-2006, 03:44 AM
The situation is, if I do the ZoomTo function, than normally it shows all the pushpins. But when I get a new Location, the zoom will change accoording to the Altitude that is put in the GetLocation(latitude,longitude, ALTITUDE).

And I found out that leaving Altitude to zero '0', the map shows the globe (I don't know why, but that is how MP-api works).

So what is overruling what, and how to solve the problem so, that I can zoom using a slidebar and ZoomTo using a button. But when I use the ZoomTo, the new location doesn't change the zoom, but stays as the ZoomTo.

I hope I clarified a little bit of the situation here.

Wilfried
12-21-2006, 06:05 AM
Hi,

I'm not sure if I understeand the question but:

GetLocation(lat, lon, alt) just returns a Location object. It does not move or zoom the map.

Location.Goto() Moves the map so that the location object is in center of the map. It does not zoom the map.

MP.ActiveMap.Altitude = 1; This zooms to 1 km (or 1 mile). Set Altitude to zoom in or out, and read altitude to see the value.

DataSet.ZoomTo() moves and zooms the map for a best view on all the pushpins in the dataset.

ZoomIn() and ZoomOut() zooms some value in / out. You can use it if user has a button or so to zoom. To zoom exact the value you want then you better set the Altitude (see before).

Does this answer your question ?

VC_Man
12-22-2006, 03:10 AM
Hi Wilfried,

You understand the question perfectly well :-D

What I did is changing the altitude in the GetLocation(lat, lon, alt). I didn't know about Map.SetAltitude(). I've tried this out and it works very well.

I was working on a serverapp with MP embedded in, to add a feature ZoomTo. The programmer doesn't work here anymore, but he programmed MP using a different aproach (I find it more difficult). Anyway, I want a bunch of pushpins to see on the map by using ZoomTo(). But there are, as far as I can see, 2 types of ZoomTo, one for DataSet and one for DataSets! Because I don't know how that dude programmed and where it is (even the FBI won't find it) I used the DataSets.ZoomTo() method. But actually I want to use the DataSet.ZoomTo.

How can I get the DataSet of the standard MyPushpin set? Or how can I use the ZoomTo() for the MyPushpin set?

VC_Man
12-22-2006, 04:12 AM
Hi Wilfried,

I solved all the problem now, it is exactly like you said. So thnx for your reply anyway! The problem was on the webclient app that did my collague!

Wilfried
12-22-2006, 06:43 AM
Hi,

Good that it is working ;)

As for your last question:

object o = "My Pushpins";
MP.ActiveMap.DataSets.get_Item(ref o).ZoomTo();

 
Web mp2kmag.com
mapforums.com