Home > @magiclane/maps-sdk > GemView
GemView class
Abstract class representing a GemView. Implements EventHandler and IMapViewListener.
Core
Signature:
export declare abstract class GemView implements EventHandler, IMapViewListener Implements: EventHandler, IMapViewListener
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
(Optional) | ||
|
|
(Optional) | ||
|
|
number | ||
|
|
any | ||
|
|
(Optional) | ||
|
Get the camera | |||
|
|
Get the cursor screen position. The coordinates are relative to the parent view screen | ||
|
|
Get the cursor WGS84 position. | ||
|
|
Get access to MapViewExtensions | ||
|
|
boolean |
Returns true if terrain topography is available for this map view. | |
|
|
boolean |
Returns true if a map animation is currently in progress. | |
|
|
boolean |
Returns true if the camera is currently moving. | |
|
|
boolean |
Returns true if the camera is following the current real/simulated position and false otherwise. | |
|
boolean |
Returns true if map rendering is enabled. | ||
|
|
number |
Get the map angle in degrees. | |
|
|
number |
Get the map ID. | |
|
|
number |
Get the maximum slippy zoom level. Bigger zoom factor means closer to the map. | |
|
number |
Get the maximum zoom level. Bigger zoom factor means closer to the map. | ||
|
number |
Get the minimum zoom level. Bigger zoom factor means closer to the map. | ||
|
|
any |
Get the pointer ID. | |
|
|
Get access to this view's preferences. | ||
|
|
number |
Get the map view current scale ( meters for 1 mm ) | |
|
|
number |
Get the slippy zoom level. | |
|
|
number |
Get the view angle in degrees. | |
|
|
RectType<number> |
The current viewport of the map view. Fields RectType.x and RectType.y are 0 as they are measured from the top left corner of the map view. Fields RectType.width and RectType.height are the width and height of the map view in physical pixels. To get the associated RectangleGeographicArea, use the appropriate coordinate transformation method. | |
|
|
Get the center of the current viewport in physical pixels. | ||
|
|
RectType<number> |
The current viewport of the map view in parent screen ratio coordinates. | |
|
|
number |
Get the zoom level. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
activateHighlight(landmarks, { renderSettings, highlightId, }, input) |
Activate highlight | |
|
Adds a GeoJSON data buffer as a marker collection. | ||
|
Set the map north-up oriented. | ||
|
Check if zooming to the given level is possible. | ||
|
Make a screen region capture of the current map in JPEG format. No cursor or on-screen information is included. On Android it includes the cursor and any on-screen information. | ||
|
Center the view on the given WGS area | ||
|
Center a geographic area within the specified screen rectangle. Positions the map to display the given area inside The zoom level is automatically selected to fit the area within the rectangle unless an explicit value is provided. | ||
|
Center the WGS coordinates on the specified screen coordinates. | ||
|
centerOnMapRoutes({ displayMode, screenRect, animation, }, input) |
Center on the routes visible on the map. | |
|
Center on the given route. The zoom level is automatically selected so that the entire route is visible on the map. | ||
|
Center on the given route instruction. The route instruction turn arrow will be visible on the map. | ||
|
centerOnRoutePart(route, startDist, endDist, { screenRect, animation, }, input) |
Center on the given route part. The zoom level is automatically selected so that the entire route is visible on the map. | |
|
centerOnRoutes({ routes, displayMode, screenRect, animation, }, input) |
Center on the given routes collection. All routes from the list will be visible on the map. The zoom level is automatically selected. | |
|
centerOnRouteTrafficEvent(routeTrafficEvent, { zoomLevel, rectangle, viewAngle, animation, }, input) |
Center on the given traffic event. | |
|
Check if a map scene object is visible within the provided rectangle. | ||
|
Clear the route instruction turn arrow. | ||
|
Retrieve the list of landmarks under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the map scene object under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieves a reference to a list of markers under the current cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the list of overlay items under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the list of overlay items under the cursor location filtered by overlay type. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the path under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the list of routes under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the list of streets under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Retrieve the traffic events under the cursor location. Use setCursorScreenPosition to set the cursor location. | ||
|
Disable highlighting. | ||
|
Disable highlighting. | ||
|
Disables the draw markers mode. | ||
|
Allows the user to draw markers on the map using touch gestures. Panning/zooming the map is deactivated. | ||
|
Get altitude for the given coordinates. | ||
|
Get the closest address landmark near the provided coordinates. | ||
|
Get highlighted geographic area. | ||
|
Returns true if the camera is following the current real/simulated position and false otherwise. | ||
|
Retrieve the set of landmarks on the specified coordinates. This is a quick synchronous reverse geocoding method. | ||
|
Get the optimal viewport rectangle for centering on highlights. | ||
|
getOptimalRoutesCenterViewport(routes, { screenRect }, input) |
Get the optimal viewport rectangle for centering on routes. | |
|
Get transfer statistics for the given online service type. | ||
|
Get the visible route interval in meters. | ||
|
Handle a touch event. | ||
|
highlightHoveredMapLabel(screenPosition, { selectMapObject }, input) |
Highlight the hovered map label under the given screen coordinates. To turn off the hover highlight, call this function with a (0, 0) screen position. A recommended usage is to call | |
|
Returns true if the camera is following the current real/simulated position in default auto-zoom mode and false otherwise. | ||
|
Returns true if the camera is following the current real/simulated position from a fixed relative position adjusted by user input and false otherwise. | ||
|
onPinchSwipe(centerPosInPix, zoomingSpeedInMMPerSec, rotatingSpeedInMMPerSec) | ||
|
registerCursorSelectionMapSceneObjectCallback(cursorSelectionMapSceneObjectCallback) |
Register a callback for cursor selection map scene object updates. | |
|
registerCursorSelectionUpdatedLandmarksCallback(cursorSelectionLandmarksCallback) |
Register a callback for cursor selection landmark updates. | |
|
registerCursorSelectionUpdatedMarkersCallback(cursorSelectionMarkersCallback) |
Register a callback for cursor selection marker match updates. | |
|
registerCursorSelectionUpdatedOverlayItemsCallback(cursorSelectionOverlayItemsCallback) |
Register a callback for cursor selection overlay item updates. | |
|
registerCursorSelectionUpdatedPathCallback(cursorSelectionPathCallback) |
Register a callback for cursor selection path updates. | |
|
registerCursorSelectionUpdatedRoutesCallback(cursorSelectionRoutesCallback) |
Register a callback for cursor selection route updates. | |
|
registerCursorSelectionUpdatedTrafficEventsCallback(cursorSelectionRouteTrafficCallback) |
Register a callback for cursor selection traffic event updates. | |
|
Register a callback for double-touch events. | ||
|
registerFollowPositionStateCallback(followPositionStateUpdatedCallback) |
Register a callback for follow-position state transitions. | |
|
Register this view for event handling. Initializes event filtering and handler registration. | ||
|
registerHoveredMapLabelHighlightedLandmarkCallback(hoveredMapLabelHighlightedLandmarkCallback) |
Register a callback for hovered map label landmark highlight updates. | |
|
registerHoveredMapLabelHighlightedOverlayItemCallback(hoveredMapLabelHighlightedOverlayItemCallback) |
Register a callback for hovered map label overlay item highlight updates. | |
|
Register a callback for hovered map label traffic event highlight updates. | ||
|
Register a callback for long-press touch events. | ||
|
Register a callback for map angle update events. | ||
|
registerMapViewMoveStateChangedCallback(onMapViewMoveStateChangedCallback) |
Register a callback for map movement state changes. | |
|
Register a callback for marker render events. | ||
|
Register a callback for move gesture events. | ||
|
Register a callback for pinch gesture events. | ||
|
Register a callback for pinch-swipe gesture events. | ||
|
Register a callback for rendered map scale changes. | ||
|
Register a callback for map style change events. | ||
|
Register a callback for shove gesture events. | ||
|
Register a callback for swipe gesture events. | ||
|
Register a touch callback. | ||
|
registerTouchHandlerModifyFollowPositionCallback(touchHandlerModifyFollowPositionCallback) |
Register a callback for touch-handler follow-position modification state transitions. | |
|
Register a callback for touch-move gesture events. | ||
|
Register a callback for touch-pinch gesture events. | ||
|
Register a callback for two-double-touch events. | ||
|
Register a callback for two-touch events. | ||
|
Register a callback for viewport resize events. | ||
|
Register a callback for view rendered events. | ||
|
Reset the map selection to the viewport center. Moves the cursor screen position back to the center of the current viewport, clearing any previous custom cursor placement used for selection operations. | ||
|
Restore following position from a manually adjusted mode (camera position fixed relative to the current/simulated position) to default auto-zoom mode. | ||
|
Scroll map. | ||
|
Set the view clipping rectangle in parent screen ratio coordinates. | ||
|
Set the cursor screen position. Use this function to trigger a map view selection (POI, landmark, overlay, route, path, marker) at the given screen coordinates. The current view selection can be queried via cursorSelectionRoutes, cursorSelectionLandmarks, cursorSelectionStreets, cursorSelectionOverlayItems, cursorSelectionMarkers methods. | ||
|
setSlippyZoomLevel(zoomLevel, { duration, screenPosition, }, input) |
Set a new zoom level based on slippy tile level. When 'follow position' is active, the current position will be used as the reference point for the operation. Otherwise, the screen center will be used. The zoom level may be between 0 and MaxSlippyZoomLevel. | |
|
setZoomLevel(zoomLevel, { duration, screenPosition }, input) |
Set a new zoom level centered on the specified screen position. This may be between 0 and maxZoomLevel | |
|
Stop the current map animation. Immediately stops any ongoing animated transition triggered by centering methods. By default, the map completes the animation instantaneously by jumping to the target destination. Set | ||
|
startFollowingPosition({ animation, zoomLevel, viewAngle, positionObj, }, input) |
Start following the current position. Requires automatic map rendering. Disables the cursor if it is enabled. | |
|
Stop the camera from following the current real/simulated position. | ||
|
Convert a screen(x, y) coordinate to a WGS(lon, lat) coordinate. | ||
|
Convert a list of WGS84 coordinates to screen coordinates. | ||
|
Convert a WGS84 coordinate to a screen coordinate. |