Skip to main content

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.

 

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.


Hi, thank you for your message and suggestion.

 

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


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.


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

 


Reply