MapGuide Tooltip Tool

A small 2009 tool that turned HTML into the nested Concat() strings MapGuide Maestro tooltips needed.

From the archive. First published on the Geographic Information Systems blog on 7 September 2009. Kept as it was written, so details may have moved on since.

OriginalArchived copy

MapGuide Tooltips

One feature in MapGuide that some people may overlook (in terms of utility) is tooltips.

They look simple enough, you use them to display certain attributes when your mouse pointer is over a feature. But what some may not realise is how these tooltips are implemented in the AJAX (or Fusion) viewer.

These tooltips are implemented in the viewer as HTML div containers. What this means is that given some knowledge of basic HTML, you can create some really cool and powerful tooltips.

Read More

This is very good and all but you must use nested concat() functions to string together the Html to display correctly in a browser.
Well I’ve created a little tool (Download here) to help convert html to the more complex concat() string used in mapguide maestro.

All you have to do is create the html is your favorite html editor and paste the result in this tool to generate the concat string. The column names must be enclosed in brackets[].
Sample:

<strong>Customer</strong>
<div style="border:none ; padding:8px;">
Name: [CustName]<br/>
Surname: [CustSurname]<br/>
Phone: [CustContact]<br/>
E-Mail: [CustMail]
</div>

This will generate a Concat string:

Concat(' <strong>Customer</strong>
<div style="border:none ; padding:8px;">
Name: ',Concat(CustName,Concat('<br/>
Surname: ',Concat(CustSurname,Concat('<br/>
Phone: ',Concat(CustContact,Concat('<br/>
E-Mail: ',Concat(CustMail,'
</div>'))))))))

Which in turn gets pasted in mapguide maestro tooltip and generates the appropriate tooltip.

Hope it helps.