Skip to main content
Question

Customise map in HTML Report

  • February 2, 2023
  • 4 replies
  • 236 views

marta.podsiad
Supporter
Forum|alt.badge.img+9

Hi,

I am struggling to change the color of polygon, line and point as well as popup and labels on map included in HTML Report. It seems like an easy task but I am struggling to find a solution.

 

I assume my questions are:

  • How to change the colour of polygons, lines and points on the map base on the value of the attributes?
  • How to edit labels and popups so they have different values?

 

I have followed the instructions from Add Conditional Coloring to Map section of How to Customize HTML Reports (safe.com). Unfortunately, suggested method is not what I am looking for.

 

I have attached my workbench.

 

Thank you for all suggestions.

 

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+48

When it comes to map layout the HTMLReportGenerator is rather basic unfortunately. Features can only have one color and the label can only be filled from a single attribute. Fortunately that is relatively easy to change, you can simply use an AttributeCreator before the HTMLReportGenerator and have it create a new attribute, filled with whatever you like and then use that as the label attribute in the HTMLReportGenerator.


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • February 3, 2023

Hi, thank you for your message and suggestion.

 

I am sure there have to be a way of doing it using Python


warrendev
Enthusiast
Forum|alt.badge.img+23
  • Enthusiast
  • February 3, 2023
marta.podsiad wrote:

Hi, thank you for your message and suggestion.

 

I am sure there have to be a way of doing it using Python

The way I've done it might not be the best method, but what I've done is create a separate template file that contains my JavaScript, CSS, and HTML for my custom map and then replace and/or insert the data from the HTMLReportGenerator into the attribute value containing the html_content with python before it gets written.


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • February 3, 2023
warrendev wrote:

The way I've done it might not be the best method, but what I've done is create a separate template file that contains my JavaScript, CSS, and HTML for my custom map and then replace and/or insert the data from the HTMLReportGenerator into the attribute value containing the html_content with python before it gets written.

Hi warrengis,

 

​I think that is the way to go. Could you please share the code? I am a beginner and do not know coding yet.

 

Thank you in advance

 


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