Solved

HTMLReportGenerator - Map position

  • 2 November 2018
  • 2 replies
  • 4 views

Badge

Hi All,

Hopefully an easy one. Using the leaflet map option from the HTML report generator. Is there a simple way to position the maps centrally instead of width 100%?

 

Thanks

icon

Best answer by gerhardatsafe 2 November 2018, 17:58

View original

2 replies

Badge

Hi @lemzip,

The HTMLReportGenerator adds an HTML style attribute to the div container of the map. You can easily modify this attribute by replacing it with a StringReplacer. The default HTML attribute looks like this:

style="width:100%;height:500px;"

If you add a StringReplacer searching for this string in the html_content attribute and replace it with, for example, this:

style="position:fixed;
      top: 50%;
      left: 50%;
      width:30em;
      height:18em;
      margin-top: -9em;
      margin-left: -15em;"

you will end up with a map in the center of the window. This is an easy way to change the style of the default map output of the HTMLReportGenerator.

I hope this helps!

Badge

thanks, works as required.

 

cheers

Reply