Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Print

JMap.Application.Print

You can manage everything related to print here.

Index

Functions

getAllPaperFormats

  • JMap.Application.Print.getAllPaperFormats

    Returns all available paper formats.

    Different sizes are available: "letter" | "legal" | "a3" | "a4".

    deprecated

    will be removed in the futur

    example
    
    // returns all available paper formats
    JMap.Application.Print.getAllPaperFormats()

    Returns JAppPaperFormat[]

getFileType

  • JMap.Application.Print.getFileType

    Returns the current type of the file, that is used when downloading the print.

    One of the following: "png" | "jpeg" | "pdf"

    example
    
    // returns "png", "jpeg", or "pdf"
    JMap.Application.Print.getFileType()

    Returns JAPP_PRINT_FILE_TYPES

getHiResolution

  • getHiResolution(): boolean
  • JMap.Application.Print.getHiResolution

    Returns true if the map export is set to hi resolution, false otherwise.

    example
    
    // get export resolution
    JMap.Application.Print.getHiResolution()
    // true

    Returns boolean

getPageSubTitle

  • getPageSubTitle(): string
  • JMap.Application.Print.getPageSubTitle

    Returns the subtitle displayed in the bottom of the print layout.

    example
    
    // returns the displayed subtitle
    JMap.Application.Print.getPageSubTitle()

    Returns string

getPageTitle

  • getPageTitle(): string
  • JMap.Application.Print.getPageTitle

    Returns the title displayed in the bottom of the print layout.

    example
    
    // returns the displayed title
    JMap.Application.Print.getPageTitle()

    Returns string

getPaperFormat

  • JMap.Application.Print.getPaperFormat

    Returns the active paper format.

    deprecated

    will be removed in the futur

    example
    
    // returns active paper format
    JMap.Application.Print.getPaperFormat()

    Returns JAppPaperFormat

isDateVisibile

  • isDateVisibile(): boolean
  • JMap.Application.Print.isDateVisibile

    Returns true if the date is displayed in the bottom of the print layout.

    example
    
    // returns true if the date is visible
    JMap.Application.Print.isDateVisibile()

    Returns boolean

isNorthArrowVisible

  • isNorthArrowVisible(): boolean
  • JMap.Application.Print.isNorthArrowVisible

    Returns true if the north arrow is displayed in the bottom of the print layout.

    example
    
    // returns true if the north arrow is visible
    JMap.Application.Print.isNorthArrowVisible()

    Returns boolean

isOrientationPortrait

  • isOrientationPortrait(): boolean
  • JMap.Application.Print.isOrientationPortrait

    Returns true if the print layout is portrait, else false (landscape).

    example
    
    // returns true if the print layout is portrait, else false (landscape)
    JMap.Application.Print.isOrientationPortrait()

    Returns boolean

isScaleControlVisible

  • isScaleControlVisible(): boolean
  • JMap.Application.Print.isScaleControlVisible

    Returns true if the scale control widget is visible, else false.

    example
    
    // true if the scale controle widget is displayed
    JMap.Application.Print.isScaleControlVisible()

    Returns boolean

setDateVisibility

  • setDateVisibility(isVisible: boolean): void
  • JMap.Application.Print.setDateVisibility

    Sets the date visible or hidden in the bottom of the print layout.

    example
    
    // Hide the date
    JMap.Application.Print.setDateVisibility(false)
    
    // Show the date
    JMap.Application.Print.setDateVisibility(true)

    Parameters

    • isVisible: boolean

      true to display, false to hide

    Returns void

setFileType

  • JMap.Application.Print.setFileType

    Sets the type of file used when downloading the print.

    throws

    if fileType is not correct

    example
    
    // set the layout as portrait
    JMap.Application.Print.setFileType("pdf")

    Parameters

    Returns void

setHiResolution

  • setHiResolution(isHiResolution: boolean): void
  • JMap.Application.Print.setHiResolution

    Sets the parameter determining if the map will be exported in hi resolution or not.

    throws

    if isHiResolution is not a boolean

    example
    
    // set export mode to hi resolution
    JMap.Application.Print.setHiResolution(true)

    Parameters

    • isHiResolution: boolean

      true or false

    Returns void

setNorthArrowVisibility

  • setNorthArrowVisibility(isVisible: boolean): void
  • JMap.Application.Print.setNorthArrowVisibility

    Sets the north arrow visible or hidden in the bottom of the print layout.

    example
    
    // Hide the north arrow
    JMap.Application.Print.setNorthArrowVisibility(false)
    
    // Show the north arrow
    JMap.Application.Print.setNorthArrowVisibility(true)

    Parameters

    • isVisible: boolean

      true to display, false to hide

    Returns void

setOrientation

  • setOrientation(isPortrait: boolean): void
  • JMap.Application.Print.setOrientation

    Sets the print layout orientation as portrait or landscape.

    throws

    if isPortrait is not a boolean

    example
    
    // set the layout as portrait
    JMap.Application.Print.setOrientation(true)
    
    // set the layout as landscape
    JMap.Application.Print.setOrientation(false)

    Parameters

    • isPortrait: boolean

      true to display as portrait, false as landscape

    Returns void

setPageSubTitle

  • setPageSubTitle(subTitle: string): void
  • JMap.Application.Print.setPageSubTitle

    Sets the subtitle displayed in the bottom of the print layout.

    throws

    if subTitle is not a string

    example
    
    // set subtitle
    JMap.Application.Print.setPageSubTitle("My custom subtitle")

    Parameters

    • subTitle: string

      The subtitle displayed in the bottom of the print layout

    Returns void

setPageTitle

  • setPageTitle(title: string): void
  • JMap.Application.Print.setPageTitle

    Sets the title displayed in the bottom of the print layout.

    If empty string, will display no title.

    throws

    if title is not a string

    example
    
    // set title
    JMap.Application.Print.setPageTitle("My custom title")

    Parameters

    • title: string

      The title displayed in the bottom of the print layout

    Returns void

setPaperFormat

  • JMap.Application.Print.setPaperFormat

    Sets the paper format of the print layout.

    Technical method, you should not use it.

    deprecated

    will be removed in the futur

    throws

    if format is incorrect

    example
    
    // set the letter paper format
    JMap.Application.Print.setPaperFormat("letter")

    Parameters

    Returns void

setScaleControlVisibility

  • setScaleControlVisibility(isVisible: boolean): void
  • JMap.Application.Print.setScaleControlVisibility

    Displays or hides the scale control widget.

    example
    
    // Display the scale
    JMap.Application.Print.setScaleControlVisibility(true)
    
    // Hide the scale
    JMap.Application.Print.setScaleControlVisibility(false)

    Parameters

    • isVisible: boolean

      true to display, false to hide

    Returns void

takeCapture

  • takeCapture(): void
  • JMap.Application.Print.takeCapture

    Builds print image and launches downwnload of the file

    example
    
    // build print image and launch downwnload of the file
    JMap.Application.Print.takeCapture()

    Returns void