I am trying to add gridlines to a template by using a !staticlayer attribute with the !addBackgroundLayers processor. I am able to output a PDF map, however, no gridlines are visible.

Here is my config.yaml:


 # Demo Template
 A4 landscape: !template
reportTemplate: template.jrxml
  title: !string {}
  subTitle: !string {}
  mapMain: !map
    maxDpi: 300
    width: 780
    height: 390
  overlayLayers: !staticLayers
        - type: "grid"
          gridType: "lines"
          numberOfLines: [4, 4]
          labelColor: rgba(0,0,0,0)
          haloColor: rgba(0,0,0,0)
  scalebar: !scalebar
    width: 240
    height: 40
      type: line
      unit: m
      orientation: "horizontalLabelsAbove"
      renderAsSvg: true
      backgroundColor: "rgba(0, 0, 0, 0)"
      align: "right"

- !reportBuilder # compile all reports in current directory
  directory: '.'
- !createMap
  inputMapper: {mapMain: map}
  outputMapper: {mapSubReport: map}
- !addBackgroundLayers
  inputMapper: {
                overlayLayers: staticLayers,
                mapMain: map
- !createScalebar {}

All the other items on my map appear as expected (scalebar, title, etc). I have only been successful in applying gridlines to the map by passing the gridlayer in the requestData json.


exchange the "!addBackgroundLayers" with "!addOverlayLayers", that did it for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.