Function toPoint

  • the factory function to create a Point(the following ways are equivalent)

    Parameters

    • Lon: number
    • Lat: number
    • Optional properties: any

    Returns Point

    Example

    // base usage
    let point = toPoint(120, 30);
    // override properties
    // all properties are optional(可以不传)
    let point = toPoint(120, 30, { name: 'test' });
    let point = toPoint([120, 30], { name: 'test' });
    // lon, lat = X, Y = lng, lat = x, y
    let point = toPoint({lon: 120, lat: 30}, { name: 'test' });
  • Parameters

    • coordinates: [number, number]
    • Optional properties: any

    Returns Point

  • Parameters

    • obj: {
          lat: number;
          lon: number;
      } | {
          x: number;
          y: number;
      } | {
          lat: number;
          lng: number;
      }
    • Optional properties: any

    Returns Point

Generated using TypeDoc