centerOnCoordinates method

void centerOnCoordinates(
  1. Coordinates coords, {
  2. int zoomLevel = -1,
  3. Point<int>? screenPosition,
  4. GemAnimation? animation,
  5. double? mapAngle,
  6. double? viewAngle,
  7. double slippyZoomLevel = -1.0,
})

Center the WGS coordinates on the screen coordinates.

Parameters

  • IN coords Coordinates
  • IN zoomLevel Zoom level (Use -1 for automatic selection)
  • IN screenPosition Screen position where the coordinates should project (default uses the specified cursor coordinates). The coordinates are relative to the parent view screen.
  • IN animation Specifies the animation to be used by the operation.
  • IN mapAngle The map's angle in degrees. Must be between 0 and 360 degrees, where 0 represents north-up alignment.
  • IN viewAngle The camera's pitch angle in degrees. Must be between 0 and 90, where 0 represents a direct top-down view.

Implementation

void centerOnCoordinates(
  final Coordinates coords, {
  final int zoomLevel = -1,
  final Point<int>? screenPosition,
  final GemAnimation? animation,
  double? mapAngle,
  double? viewAngle,
  final double slippyZoomLevel = -1.0,
}) {
  if (viewAngle != null && (viewAngle - viewAngle.toInt() == 0)) {
    viewAngle -= 0.0000000001;
  }
  if (mapAngle != null && (mapAngle - mapAngle.toInt() == 0)) {
    mapAngle -= 0.0000000001;
  }
  objectMethod(
    _pointerId,
    'MapView',
    'centerOnCoordinates',
    args: <String, Object>{
      'coords': coords,
      'zoomLevel': zoomLevel,
      'slippyZoomLevel': slippyZoomLevel,
      if (screenPosition != null) 'xy': XyType<int>.fromPoint(screenPosition),
      if (animation != null) 'animation': animation,
      if (mapAngle != null) 'mapAngle': mapAngle,
      if (viewAngle != null) 'viewAngle': viewAngle,
    },
  );
}