The strategies you use to programmatically zoom in and out of GeographicGlobe and GeographicAxes objects are different. For GeographicGlobe objects, you specify a camera height using the camheight function. For GeographicAxes objects, you specify a zoom level using the ZoomLevel property or specify latitude and longitude limits using the geolimits function. To create GeographicGlobe and GeographicAxes objects with similar map scales, approximate camera height and zoom level using the heightToZoomLevel and zoomLevelToHeight local functions (defined here).
You can verify the behavior of the zoomLevelToHeight local function by displaying GeographicAxes and GeographicGlobe objects using comparable magnification levels.
Specify the latitude and longitude of the Sydney Opera House. Create geographic axes with a basemap, map center, and zoom level that allows you to clearly see the building.
Create a geographic globe. Position the camera above the Sydney Opera House using the campos function.
Calculate an approximate camera height from the zoom level using the zoomLevelToHeight local function. Then, set the camera height using the camheight function. Note that the geographic axes and geographic globe displays are comparable.
To verify the behavior of the heightToZoomLevel function, calculate an approximate zoom level from the camera height.
Note that z and z2 are equal.
This code defines a local function called zoomLevelToHeight that approximates the camera height h for a GeographicGlobe object using the zoom level z and map center latitude lat of a GeographicAxes object.
This code defines a local function called heightToZoomLevel that approximates the zoom level z for a GeographicAxes object using the camera height h and latitude lat of a GeographicGlobe object.