I haven't worked with the new MapViewer, yet.
When I tested right now, it did seem to delete unwanted components in the style attributes of HTML tags, and I couldn't get a plain "display: none;" to work.
I got it to work with "display: {expression/expr1};", though. I'd have to test more to get an idea of what is and isn't allowed.
In the meantime, something like this works (switches between showing a google search link or plain text depending on whether the discharge is maintained by a public authority/company or a private citizen):
![JohannesLindner_0-1646637834090.png JohannesLindner_0-1646637834090.png](https://community.esri.com/t5/image/serverpage/image-id/35725iD29123747FD25F70/image-size/medium?v=v2&px=400)
![JohannesLindner_1-1646637848643.png JohannesLindner_1-1646637848643.png](https://community.esri.com/t5/image/serverpage/image-id/35726i68A97AA00FF8AD67/image-size/medium?v=v2&px=400)
// show_maintainer
// returns "none" if the maintainer field is empty or set to "privat", else "inline"
if(Includes([null, "privat"], $feature.Unterhaltungsträger)) {
return "none"
}
return "inline"
// show_private
// same as show_maintainer, only the other way around
if(Includes([null, "privat"], $feature.Unterhaltungsträger)) {
return "inline"
}
return "none"
HTML source of the popup's text element:
<figure class="table">
<table>
<tbody>
<tr>
<td style="width:50%;">
Maintained by
</td>
<td>
<div style="display:{expression/show_maintainer};">
<a href="www.google.de/search?q={Unterhaltungsträger}" target="_blank">{Unterhaltungsträger}</a>
</div>
<div style="display:{expression/show_private};">
private or unknown
</div>
</td>
</tr>
<tr>
<td>
Discharge Rate
</td>
<td>
{expression/expr4}
</td>
</tr>
</tbody>
</table>
</figure>
Have a great day!
Johannes