M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 310
Registered: ‎03-10-2016
Accepted Solution

Fontsize for Tooltips

Hi there!

 

What is the best way to define the fontsize and font for tooltips?

Afaik in Studio there is no setting for this.

 

E.g. I want to change size to "12" and font to "Arial". Must I define this in Browser?

 

Thanks and regards

Stefan

 

 

BB_Tooltips.PNG

GAUSS Ingenieurtechnik GmbH | Germany
Highlighted
Technical Evangelist
Posts: 1,307
Registered: ‎09-11-2015

Re: Fontsize for Tooltips

It seems to me, like the easiest and safest way is to define the HTML tooltip code directly in DB table MAPP_VECTOR > column TOOLTIP. You can apply CSS directly there e.g. using <span> element. For example:

<p>
   <span style="text-decoration: underline;">
      <strong>Crime Details</strong>
   </span>
</p>
<p>
   <strong>Type</strong>: {ENTITY.RUCR_EXT_D}
<br />
   <strong>ID: </strong>{ENTITY.ID1}
</p>
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Regular Contributor
Posts: 310
Registered: ‎03-10-2016

Re: Fontsize for Tooltips

Hey Jan,

 

thanks for the hint, nice options for customizing the tooltips!

 

Here is my testconfig and follwing the output:

 

<div style="background-color: #8EC11A;">
       <table style="border-collapse: collapse; width: 100%;" border="1">
		<tbody>
			<tr>
				<td style="width: 50%;"><strong>Zonenname:</strong></td>
				<td style="width: 50%;">{ENTITY.zonenname}&nbsp;</td>
			</tr>
			<tr>
				<td style="width: 50%;"><strong>Gewann:</strong></td>
				<td style="width: 50%;">{ENTITY.gewann}&nbsp;</td>
			</tr>
			<tr>
				<td style="width: 50%;"><strong>Nutzungsart:</strong></td>
				<td style="width: 50%;">{ENTITY.nutzungsart}&nbsp;</td>
			</tr>
			<tr>
				<td style="width: 50%;"><strong>Richtwert in &euro;:</strong></td>
				<td style="width: 50%;">{ENTITY.richtwert_in_euro_je_qm}&nbsp;</td>
			</tr>
		</tbody>
	</table>
</div>

 

brw_tooltip_weil.PNG

GAUSS Ingenieurtechnik GmbH | Germany
Highlighted
Valued Contributor
Posts: 669
Registered: ‎10-27-2015

Re: Fontsize for Tooltips

[ Edited ]

This works only for a SIMPLE MAP panel, is it true?

Not for Feature Analyzer

Highlighted
Technical Evangelist
Posts: 1,307
Registered: ‎09-11-2015

Re: Fontsize for Tooltips

Yes, Feature Analyzer has its own tooltipping feature.

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Occasional Contributor
Posts: 15
Registered: ‎03-09-2018

Re: Fontsize for Tooltips

Is there a way to control the font attributes in a Feature Analyzer Tooltip?

 

Thanks,

-Chad

Highlighted
Technical Evangelist
Posts: 1,307
Registered: ‎09-11-2015

Re: Fontsize for Tooltips

[ Edited ]

You can use functional attribute(s) to inject a script or CSS content into Feature Analyzer. I've tried with the following sample code and it changed the tooltip font styling. However, I am not fully sure now whether the related CSS class (leaflet-popup-content) is used elsewhere.

if (rowId === 0) {
  var style = document.createElement('style');
  style.type = 'text/css'; 
  style.innerHTML += '.leaflet-popup-content { font-size: 16px !important; font-family: "Times New Roman" } \n';  
style.id = 'TooltipFontStyle'; // remove existing style if present var headElement = document.getElementsByTagName('head')[0]; var existingClusterStyle = document.getElementById('TooltipFontStyle'); if (existingClusterStyle) headElement.removeChild(existingClusterStyle); headElement.appendChild(style); }
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Occasional Contributor
Posts: 15
Registered: ‎03-09-2018

Re: Fontsize for Tooltips

Thanks Jan, this seems to work fine!  I'll let you know if I notice it affecting anything else.

 

-Chad