Skip to main content
Solved

HTMLReportGenerator - Map position


Forum|alt.badge.img

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

Best answer by gerhardatsafe

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!

View original
Did this help you find an answer to your question?

2 replies

Forum|alt.badge.img

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!


Forum|alt.badge.img
  • Author
  • November 7, 2018

thanks, works as required.

 

cheers


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings