Skip to content

Current size not working with programmatically print #4

@nagolli

Description

@nagolli

Current size is not working with programmatically print.

Call function invokes:

{
  key: 'printMap',
  value: function (t, e) {
      this.leafletElement.printMap(t + ' page', e); //Being t+' page' = n
   },
},

Afterwards, it evals:
if ('CurrentSize' === n) return this._printOpertion(n);

If it does not match, which will never do, it invokes:

(i.style.width = e.originalState.mapWidth),
(i.style.height = e.originalState.mapHeight), 

where i.style.width (nor height) is not defined for Current Size.

My workaround from outside of the module, (due to my code: printControl.current is a react reference):

if (!printControl.current.printCurrentMap) {
      printControl.current.printCurrentMap = function printMap(filename: string) {
        this.leafletElement.printMap('CurrentSize', filename);
      };
    }
    printControl.current.printCurrentMap('MyFileName');

My suggestion to solve it within the module:
if ('Current page' === n) return this._printOpertion(n);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions