Directories | |
| dart | |
| java | |
| kotlin | |
| objc | |
| swift | |
Examples of using LocationWindowCamera for managing map camera in Navigine SDK.
LocationWindowCamera provides API for managing map camera, including:
Getting and setting current camera position.
Adding and removing camera event listeners.
Smooth camera movement with automatic animation.
Camera movement with specified animation type.
Class describing camera position:
point - point the camera is looking at (Point)zoom - zoom level (double)rotation - rotation angle in degrees (double)Interface for receiving camera position change events:
onCameraPositionChanged(reason, finished) - called when position changesInterface for receiving movement completion notifications:
onMoveFinished(completed) - called when movement completesAnimation types:
NONE - no animationLINEAR - linear animationCUBIC - cubic animation (smooth start and end)QUINT - quintic animationSINE - sine animation (very smooth)Camera update reasons:
GESTURES - user gesturesAPPLICATION - programmatic changeExamples are available for the following platforms:
dart/location_window_camera_example.dartjava/LocationWindowCameraExample.javakotlin/LocationWindowCameraExample.ktobjc/LocationWindowCameraExample.h and objc/LocationWindowCameraExample.mswift/LocationWindowCameraExample.swiftAll API methods may throw exceptions with incorrect parameters or system issues. It's recommended to wrap calls in try-catch blocks:
The examples include special comment blocks for easy code extraction:
[dart_LocationWindow_getCamera] - Get current camera[dart_LocationWindow_setCamera] - Set camera position[dart_LocationWindow_addCameraListener] - Add camera listener[dart_LocationWindow_flyTo] - Fly to position[dart_LocationWindow_moveTo] - Move to position with animation[java_LocationWindow_getCamera] - Get current camera[java_LocationWindow_setCamera] - Set camera position[java_LocationWindow_addCameraListener] - Add camera listener[java_LocationWindow_flyTo] - Fly to position[java_LocationWindow_moveTo] - Move to position with animation[kotlin_LocationWindow_getCamera] - Get current camera[kotlin_LocationWindow_setCamera] - Set camera position[kotlin_LocationWindow_addCameraListener] - Add camera listener[kotlin_LocationWindow_flyTo] - Fly to position[kotlin_LocationWindow_moveTo] - Move to position with animation[objc_LocationWindow_getCamera] - Get current camera[objc_LocationWindow_setCamera] - Set camera position[objc_LocationWindow_addCameraListener] - Add camera listener[objc_LocationWindow_flyTo] - Fly to position[objc_LocationWindow_moveTo] - Move to position with animation[swift_LocationWindow_getCamera] - Get current camera[swift_LocationWindow_setCamera] - Set camera position[swift_LocationWindow_addCameraListener] - Add camera listener[swift_LocationWindow_flyTo] - Fly to position[swift_LocationWindow_moveTo] - Move to position with animation