• JMap.Projection.reprojectLocation

    Returns reprojected location in the given projection.

    Parameters

    • location: JLocation

      the location to reproject

    • toProjection: string

      the desired output projection (EPSG code)

    • Optional fromProjection: string

      projection of the given location, by default the project projection (EPSG code)

    Returns Promise<JLocation>

    Throws

    if invalid parameters

    Example

    // returns the location in long/lat
    const longLatLocation = await JMap.Projection.reprojectLocation({
    x: -8251305.053809433,
    y: 5683448.361086178
    },
    "EPSG:4326",
    "EPSG:3857"
    )
    console.log("Long/lat location", longLatLocation)