Skip to main content
Question

Symbolise Layers in HTML Report Generator / HTML Layouter


deanhowell
Influencer
Forum|alt.badge.img+23

I have a map that has 5 layers in it and want to have them all displayed using different symbology in the HTML Layouter but I can only define a single colour for the layer.

Is it possible to generate HTML output with a little more cartographic input for each incoming layer?

 

image 

image 

 

3 replies

ctredinnick
Supporter
Forum|alt.badge.img+18
  • Supporter
  • April 13, 2022

You'll probably have to do it yourself in the code. Thankfully it's not too complicated. Some style information is here: https://developers.arcgis.com/esri-leaflet/styles-and-visualization/style-a-feature-layer/

But you can use a StringReplacer to replace the line controlling how FME styles it

style:{"color""rgb(200,0,255)"}

with something like this, basically copying from esri's example

style(feature) => {
	let style = {
	  colornull // no outline color
	};
	if (feature.properties.name === "73980") {style.color = "rgb(200,0,255)";}
	else {style.color = "rgb(0,0,0)";}
return style;
}

Just using If statements to colour features differently. The feature.properties.name refers to the "name" attribute on the features, whatever that happens to be for your case.

 


deanhowell
Influencer
Forum|alt.badge.img+23
  • Author
  • Influencer
  • April 14, 2022

Thanks @ctredinnick​ that is certainly a great option.


j.botterill
Influencer
Forum|alt.badge.img+40
  • Influencer
  • November 29, 2023

For those following this question, please vote up these ideas

AC Idea: HTMLReportGenerator Table Styling (safe.com)

AC Idea: htmlreportgenerator - allow for layer colour to be linked to attributes (safe.com)

AC Idea: HTMLReportGenerator improvement suggestions (safe.com)

Ideally the htmlreportgenerator content settings would allow the "Color Layer" to make use of conditional values so you can style different fme_feature_types for exampletransformers_with_color_conditional


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