1

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:

templates:

 #===========================================================================
 # Demo Template
 A4 landscape: !template
 #===========================================================================
reportTemplate: template.jrxml
attributes:
  title: !string {}
  subTitle: !string {}
  mapMain: !map
    maxDpi: 300
    width: 780
    height: 390
  overlayLayers: !staticLayers
    default:
      layers:
        - 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
    default:
      type: line
      unit: m
      orientation: "horizontalLabelsAbove"
      renderAsSvg: true
      backgroundColor: "rgba(0, 0, 0, 0)"
      align: "right"

processors:
- !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.

-1

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.