Home > @magiclane/maps-sdk > GemView > centerOnCoordinates

GemView.centerOnCoordinates() method

Center the WGS coordinates on the specified screen coordinates.

Signature:

centerOnCoordinates(coords: Coordinates, options?: {
        zoomLevel?: number;
        screenPosition?: Point;
        animation?: GemAnimation;
        mapAngle?: number;
        viewAngle?: number;
        slippyZoomLevel?: number;
    }): void;

Parameters

Parameter

Type

Description

coords

Coordinates

Coordinates to center on.

options

{ zoomLevel?: number; screenPosition?: Point; animation?: GemAnimation; mapAngle?: number; viewAngle?: number; slippyZoomLevel?: number; }

(Optional) Options for centering.

options properties:

  • Optional zoomLevel?: number

    Zoom level (use -1 for automatic selection).

  • Optional screenPosition?: Point

    Screen position where the coordinates should project (default uses the specified cursor coordinates). The coordinates are relative to the parent view screen.

  • Optional animation?: GemAnimation

    Specifies the animation to be used by the operation.

  • Optional mapAngle?: number

    Map rotation angle in the range 0.0 - 360.0 degrees (use Infinity for automatic selection).

  • Optional viewAngle?: number

    Map view angle in the range -90.0 - 90.0 degrees (use Infinity for automatic selection).

  • Optional slippyZoomLevel?: number

    Slippy zoom level (use -1.0 for automatic selection).

Returns:

void

Exceptions

An exception if the operation fails.