How can I retrieve the current zoom level?

Jun 4, 2009 at 3:25 PM

The javascript VE control has a method named GetZoomLevel(). I've been looking at the VE SDK (which seems to be in transition to Bing) and I can't quite figure out how to retrieve this value.

I understand that I'd need to add my own method to the InfoStrat.VE.VEMap class but I don't know which VE class method it would call. I've poked around the intellisense of the globeControl.Host.Navigation and elsewhere but can't seem to find it.

Jun 4, 2009 at 4:02 PM
Edited Jun 4, 2009 at 4:03 PM

Nevermind. I needed the zoom level to get a pixel coordinate from a lat/lon. I can call


and get this value.



Jun 4, 2009 at 4:21 PM

There are functions in VEMap to help translate between VELatLong and position/coordinates.

See this thread:

Jun 8, 2009 at 8:03 PM

Actually, I do need to do this. I need to figure out what current zoom level I am at, I need to know how many digits long the quadkey is for the tiles. I assume I can get this from the altitude, but I don't know the ratio of altitude to zoom level. There is a finite number of zoom levels and an almost infinite number of altitude values.

How can I get the actual zoom level the map is at?



Jun 8, 2009 at 8:09 PM

You'll have to use the VEMap.GlobeControl and look it up in the VE3D API.


Why do you need the quadkey?  If you are adding tiles, see this thread:

Jun 8, 2009 at 8:38 PM

I need the quadkey or actually the zoom level because I am putting together a heatmap with VE by using this work from Johannes Kebeck -!42E1F70205EC8A96!7742.entry . Johannes did this work with the the JavaScript VE and I wanted to do it with the WPF VE (the Geometry and math should all be the same) which I have successfully done. This works without problem only if the user keeps the zoom level at 10 because I've hardcoded this value in the absence of a function to read it at runtime.

I need the zoom level as a parameter into the LatLongToPixel() function he provides and this function is called repeatedly to build the heatmap image from a set of LatLongs. I know that VEMap.LatLongToPoint() exists and that it does not require a zoom level but when I tried to use it the resulting heatmap was off and to the South-East (for U.S. coordinates) of where it should have been. Without repeating all the details in the above link, I will say that I couldn't figure out the reason for the offset so I reverted to Joannes' LatLongToPixel() which does require a zoom level rather than the VEMap.LatLongToPoint() which does not.

The link you site above is a discussion I had opened up and it what I am doing at the end of creating the heat map image. At the end of creating this image, I cut it up and serve it back to VE as map tiles.