The MapFishPrintV3Manager.

Hierarchy

  • BaseMapFishPrintManager
    • MapFishPrintV3Manager

Constructors

Properties

Methods

Constructors

Properties

_customMapParams: V3CustomMapParams = {}
_dpi?: number

The currently selected dpi.

_dpis: number[] = []

The supported DPIs by the print service.

_extentFeature?: Feature<Polygon>

Feature representing the page extent.

_initiated: boolean = false

Whether this manger has been initiated or not.

_layout?: Layout

The currently selected layout.

_layouts: Layout[] = []

The supported layouts by the print service.

_outputFormat?: string

The currently selected output format.

_outputFormats: string[] = []

The supported output formats by the print service.

_printApp?: string

The currently selected print application.

_printApps: string[] = []

The supported print applications by the print service.

_printJobReference: null | string = null

ID of currently started print job. Will be used while polling will be performed.

_printMapSize?: PrintMapSize

The currently set map size defined with its width and height.

_scale?: number

The currently selected scale.

_scales: number[] = []

The supported scales by the print service.

capabilities?: any
credentialsMode: RequestCredentials
customParams?: any
customPrintScales?: number[]
events: any = {}

The registered events.

extentLayer?: VectorLayer<VectorSource<Feature<Geometry>>, Feature<Geometry>>
headers?: {
    [key: string]: string;
}
layerFilter: ((layer: Layer<Source, LayerRenderer<any>>) => boolean)
legendFilter: ((layer: Layer<Source, LayerRenderer<any>>) => boolean)
map: Map
maskColor: string
method: "GET" | "POST"
serializers: BaseSerializer[] = []
timeout: number
transformOpts?: OlInteractionTransformOpts
url?: string
APPS_JSON_ENDPOINT: string = 'apps.json'

The capabilities endpoint of the print service.

CAPABILITIES_JSON_ENDPOINT: string = 'capabilities.json'

The capabilities endpoint of the print service.

CUSTOM_PRINT_SERIALIZER_OPTS_KEY: string = 'customPrintSerializerOpts'

The key in the layer properties to lookup for custom serializer options.

EXTENT_LAYER_NAME: string = 'PrintManager Vector Layer'

The name of the vector layer configured and created by the print manager.

TRANSFORM_INTERACTION_NAME: string = 'PrintManager Transform Interaction'

The name of the transform interaction configured and created by the print manager.

Methods

  • Append (partial) map parameters

    Parameters

    • params: Partial<V3CustomMapParams>

      The parameters to append

    Returns void

  • Calculates the extent based on a scale.

    Parameters

    • Optionalscale: number

      The scale to calculate the extent for. If not given, the current scale of the provider will be used.

    Returns undefined | number[]

    The extent.

  • Calculates the current rotation of the print extent feature.

    Returns undefined | number

  • Dispatches the given event with the provided data.

    Parameters

    • name: string

      The name of the event to dispatch.

    • data: any

      The data to apply to the event callback.

    Returns void

  • Opens the given URL in a new browser tab to download the given response (if header are set correctly).

    Parameters

    • url: string

      The url to open.

    Returns void

  • Checks if a given layer should be printed.

    Parameters

    • layer: Layer<Source, LayerRenderer<any>>

      The layer to check.

    Returns boolean

    Whether the layer should be printed or not.

  • Checks if the legend of a given legend should be printed.

    Parameters

    • layer: Layer<Source, LayerRenderer<any>>

      The layer to check.

    Returns boolean

    Whether the legend of the layer should be printed or not.

  • Returns attribute value contained in currently chosen layout by its name.

    Parameters

    • attributeName: string

      The attribute name (key) to be searched.

    Returns any

    Obtained attribute value.

  • Returns the closest scale to current print feature's extent.

    Returns undefined | number

  • Returns the closest scale to fit the print feature's extent into the current extent of the map.

    Returns number

  • Returns an individual custom param.

    Parameters

    • key: string

      The custom param to get.

    Returns any

    The custom param

  • Returns the currently selected dpi.

    Returns undefined | number

    The currently selected dpi.

  • Returns the extent layer.

    Returns undefined | VectorLayer<VectorSource<Feature<Geometry>>, Feature<Geometry>>

    The extent layer.

  • Returns the currently selected layout.

    Returns undefined | Layout

    The currently selected layout.

  • Returns an object containing configuration for layout based on its name

    Parameters

    • layoutName: string

      Layout name.

    Returns undefined | Layout

    Layout configuration object.

  • Returns all supported layouts.

    Returns Layout[]

    The supported layouts.

  • Returns the currently selected output format.

    Returns undefined | string

    The currently selected output format.

  • Returns all supported output formats.

    Returns string[]

    The supported output formats.

  • Returns the currently selected print application.

    Returns undefined | string

    The currently selected print application.

  • Computes size of print extent in pixel depending on dimensions of print map and print scale.

    Parameters

    • printMapSize: PrintMapSize

      Print map size containing its width and height.

    • printScale: number

      Print scale.

    Returns PrintMapSize

    Print extent size.

  • Returns print map size for chosen layout.

    Returns undefined | PrintMapSize

    The map size.

  • Collects the payload that is required for the print call to the print servlet.

    Returns {
        attributes: any;
        layout: undefined | string;
    }

    The print payload.

    • attributes: any
    • layout: undefined | string
  • Returns the currently selected scale.

    Returns undefined | number

    The currently selected scale.

  • Initializes the print extent feature.

    Returns undefined | Feature<Polygon>

    The extent feature.

  • Initializes the transform interaction.

    Returns void

  • Whether this manager has been initiated or not.

    Returns boolean

    Whether this manager has been initiated or not.

  • Loads the print capabilities from the provided remote source.

    Parameters

    • printApp: string

    Returns Promise<any>

  • Returns all available print applications.

    Returns Promise<string[]>

    Promise containing available print apps.

  • Registers an event.

    Parameters

    • name: string

      The name of the event to register.

    • callback: Function

      The callback function to register.

    Returns void

  • Called on the extentLayer's postrender event.

    Parameters

    • olEvt: RenderEvent

      The ol render event.

    Returns void

  • Called on the extentLayer's prerender event.

    Parameters

    • olEvt: RenderEvent

      The ol render event.

    Returns void

  • Called on translate interaction's scaling event.

    Returns void

  • Type Parameters

    • T = any

    Parameters

    • fn: (() => Promise<T>)
        • (): Promise<T>
        • Returns Promise<T>

    • fnCondition: ((res?: T) => boolean)
        • (res?): boolean
        • Parameters

          • Optionalres: T

          Returns boolean

    • interval: number = 1000
    • timeout: number = 30000

    Returns Promise<T>

  • Serializes/encodes the given layer.

    Parameters

    • layer: Layer<Source, LayerRenderer<any>>

      The layer to serialize/encode.

    Returns any

    The serialized/encoded layer.

  • Serializes/encodes the legend payload for the given layer.

    Parameters

    • layer: Layer<Source, LayerRenderer<any>>

      The layer to serialize/encode the legend for.

    Returns undefined | {
        icons: any[];
        name: any;
    }

    The serialized/encoded legend.

  • Sets an individual custom param.

    Parameters

    • key: string

      The key of the param.

    • value: any

      The value of the param.

    Returns void

  • Sets the custom params.

    Parameters

    • params: any

      The params to set.

    Returns void

  • Sets the dpi to use.

    Parameters

    • value: number

      The value of the dpi to use.

    Returns void

  • Sets the layout to use. Updates the print extent accordingly.

    Parameters

    • name: string

      The name of the layout to use.

    Returns void

  • Setter for legend filter

    Parameters

    • filterFn: ((layer: Layer<Source, LayerRenderer<any>>) => boolean)

      The new legend filter function

        • (layer): boolean
        • Parameters

          • layer: Layer<Source, LayerRenderer<any>>

          Returns boolean

    Returns void

  • Sets the output format to use.

    Parameters

    • name: string

      The name of the output format to use.

    Returns void

  • Sets the print application to use. For each print app the appropriate capabilities will be load and the manager will be initialized afterwards.

    Parameters

    • printAppName: string

      The name of the application to use.

    Returns Promise<void>

  • Sets the supported print applications.

    Parameters

    • printApps: string[]

      The supported print applications to set.

    Returns void

  • Sets the map size to use while printing.

    Parameters

    • printMapSize: PrintMapSize

      The object containing width and height of printed map.

    Returns void

  • Rotates the print extent by the amount of the given rotation.

    Parameters

    • rotation: number

      The amount to rotate.

    Returns void

  • Sets the scale to use. Updates the print extent accordingly.

    Parameters

    • value: number

      The value of the scale to use.

    Returns void

  • Unregisters an event.

    Parameters

    • name: string

      The name of the event to unregister.

    • callback: Function

      The callback function to unregister.

    Returns void

  • Updates the geometry of the print extent feature to match the current scale.

    Returns void

  • Validates the given HTTP fetch response.

    Parameters

    • response: Response

      The response to validate.

    Returns void