Skip to main content

flywave-mapview.mapviewutils.zoomontargetposition

Home > @flywave/flywave-mapview > MapViewUtils > zoomOnTargetPosition

MapViewUtils.zoomOnTargetPosition() function

Zooms and moves the map in such a way that the given target position remains at the same position after the zoom.

Signature:

function zoomOnTargetPosition(mapView: MapView, targetNDCx: number, targetNDCy: number, zoomLevel: number, maxTiltAngle?: number): boolean;

Parameters

Parameter

Type

Description

mapView

MapView

Instance of MapView.

targetNDCx

number

Target x position in NDC space.

targetNDCy

number

Target y position in NDC space.

zoomLevel

number

The desired zoom level.

maxTiltAngle

number

(Optional) The maximum tilt angle to comply by, in globe projection, in radian.

Returns:



boolean

`false` if requested zoom cannot be achieved due to the map view's maximum bounds [MapView.geoMaxBounds](./flywave-mapview.mapview.geomaxbounds.md)<!-- -->,`true` otherwise.