Navigation API
advanced scriptingWorld Map Globe Edition · Scripting Support (C#)
WorldMapGlobe (namespace WPM). Access via WorldMapGlobe.instance.
FlyTo Methods
All FlyTo methods return a CallbackHandler that lets you chain actions:
map.FlyToCountry("Spain", 2f).Then(() => Debug.Log("Arrived!"));
CallbackHandler FlyToLocation(Vector3 destination)Flies to a sphere position using default duration.
CallbackHandler FlyToLocation(Vector3 destination, float duration, float destinationZoomLevel = -1f, float bounceIntensity = 0)Flies to a sphere position with full parameters.
CallbackHandler FlyToLocation(float latitude, float longitude)Flies to latitude/longitude coordinates.
CallbackHandler FlyToLocation(float latitude, float longitude, float duration, float destinationZoomLevel = -1f)Flies to lat/lon with duration and zoom.
CallbackHandler FlyToLocation(Vector2 latlon)Flies to a lat/lon Vector2.
CallbackHandler FlyToCountry(string name, float duration = -1, float zoomLevel = -1)Flies to a country by name.
CallbackHandler FlyToCountry(int countryIndex, float duration, float zoomLevel, float bounceIntensity)Flies to a country with bounce effect.
CallbackHandler FlyToProvince(int provinceIndex, float duration, float zoomLevel)Flies to a province.
CallbackHandler FlyToCity(int cityIndex, float duration, float zoomLevel)Flies to a city.
Zoom Control
CallbackHandler ZoomTo(float destinationZoomLevel)Smoothly zooms to a target level (0 = fully out, 1 = fully in).
CallbackHandler ZoomTo(float destinationZoomLevel, float duration)Zooms to a level over a specified duration.
float GetZoomExtents(Rect rect)Returns the zoom level needed to fit a rectangle on screen.
float GetRegionZoomExtents(Region region)Returns the zoom level needed to fit a region on screen.
Navigation State
bool isFlyingToActive { get; }True while a FlyTo animation is playing.
bool isFlyingComplete { get; }True once the latest FlyTo animation has finished.
bool isZoomToActive { get; }True while a ZoomTo animation is playing.
bool isZoomComplete { get; }True once the latest ZoomTo has finished.
bool isOrbitRotateToActive { get; }True during orbit rotation animation.
Vector3 GetCurrentMapLocation(bool worldSpace = false)Returns the sphere position at the center of the screen. If worldSpace is true, returns in world coordinates.
float navigationTime { get; set; }Default duration for FlyTo animations.
float navigationBounceIntensity { get; set; }Default bounce intensity for FlyTo animations (0 = no bounce).
NAVIGATION_MODE navigationMode { get; set; }Whether the Earth rotates or the camera rotates during navigation.
Camera Control
bool allowUserRotation { get; set; }Allow the user to rotate the globe.
bool allowUserZoom { get; set; }Allow the user to zoom in/out.
bool allowUserKeys { get; set; }Enable WASD keyboard controls.
bool keepStraight { get; set; }Keep the globe upright (no tilt).
ROTATION_AXIS_ALLOWED rotationAxisAllowed { get; set; }Restrict rotation to specific axes.
bool dragConstantSpeed { get; set; }Drag at a constant speed.
float mouseDragSensitivity { get; set; }Mouse drag sensitivity (0.1-3).
float cameraRotationSensibility { get; set; }Camera rotation sensitivity (0.1-3).
float zoomMaxDistance { get; set; }Maximum zoom-out distance.
float zoomMinDistance { get; set; }Minimum zoom-in distance.
ZOOM_MODE zoomMode { get; set; }Whether the Earth or Camera moves during zoom.
bool invertZoomDirection { get; set; }Invert mouse wheel zoom direction.
bool zoomAtMousePosition { get; set; }Zoom towards the mouse cursor position.
bool respectOtherUI { get; set; }Prevents globe interaction when pointer is over a UI element.
bool dragOnScreenEdges { get; set; }Enable rotation when the mouse approaches screen edges.
bool centerOnRightClick { get; set; }Center the globe on right-click position.
bool enableOrbit { get; set; }Enable orbit camera mode.
Transform orbitTarget { get; set; }Target for orbit mode.
bool VREnabled { get; set; }Enable VR-compatible interaction mode.
bool lockPan, lockYaw, lockPitchLock specific camera axes programmatically.
bool mouseIsOver { get; }True when the mouse is over the globe.
Camera mainCamera { get; set; }The camera used for globe interaction.
Suggest an improvement
Help us improve this documentation page.