parseCoord static method

Coord? parseCoord(
  1. dynamic value
)

Implementation

static Coord? parseCoord(dynamic value) {
  if (value == null) return null;

  if (value is Coord) {
    return value;
  } else if (value is Map<String, dynamic>) {
    // lat, lng가 있으면 LatLng으로 파싱
    if (value.containsKey('lat') && value.containsKey('lng')) {
      return NLatLng.fromJson(value);
    }
    // x, y가 있으면 Point로 파싱
    else if (value.containsKey('x') && value.containsKey('y')) {
      return NPoint.fromJson(value);
    }
  }
  return null;
}