LatLng constructor

const LatLng(
  1. double latitude,
  2. double longitude
)

Creates a geographical location specified in degrees latitude and longitude.

The latitude is clamped to the inclusive interval from -90.0 to +90.0.

The longitude is normalized to the half-open interval from -180.0 (inclusive) to +180.0 (exclusive)

Implementation

const LatLng(double latitude, double longitude)
    : assert(latitude != null),
      assert(longitude != null),
      latitude =
          (latitude < -90.0 ? -90.0 : (90.0 < latitude ? 90.0 : latitude)),
      longitude = (longitude + 180.0) % 360.0 - 180.0;