Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Projection

JMap.Projection

From this section you can make projection transformations.

Index

Functions

reprojectBoundaryBox

  • reprojectBoundaryBox(boundaryBox: JBoundaryBox, toProjection: string, fromProjection?: undefined | string): JBoundaryBox
  • JMap.Projection.reprojectBoundaryBox

    Returns the reprojected boundary box in the given projection.

    throws

    if invalid parameters

    example
    
    // returns the boundary box in long/lat
    const longLatBbox = JMap.Projection.reprojectBoundaryBox({
       x: -8251305.053809433,
       y: 5683448.361086178
     },
     "EPSG:4326",
     "EPSG:3857"
    )
    console.log("Long/lat boundary box", longLatBbox)

    Parameters

    • boundaryBox: JBoundaryBox

      the boundary box to reproject

    • toProjection: string

      the desired output projection (EPSG code)

    • Optional fromProjection: undefined | string

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

    Returns JBoundaryBox

reprojectLocation

  • reprojectLocation(location: JLocation, toProjection: string, fromProjection?: undefined | string): JLocation
  • JMap.Projection.reprojectLocation

    Returns reprojected location in the given projection.

    throws

    if invalid parameters

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

    Parameters

    • location: JLocation

      the location to reproject

    • toProjection: string

      the desired output projection (EPSG code)

    • Optional fromProjection: undefined | string

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

    Returns JLocation