Hi Travis: I don’t think there is an “easy” way. I mean you could script 
template creation so that process does the tedious work for you by looking at 
the map. You would create a new-style template (see RFC 36) so everything is in 
one file and then you’d create a single output format reference to that table.

If we wanted to support this via MapServer templates I think we’d need to do 3 
things:


·         Extend the [resultset] tag to support “layer_pattern” attribute so 
that it (a regex) could apply to multiple layers (like any/all of them).

·         Enhance the [items] and [values] tags to control formatting. 
Currently those just slam the column names and values together in a delimited 
string.

·         Enhance the [values] tag processing to allow referencing the 
associated item/column name in the context of formatting.

I’d probably also propose compliance with the item-related metadata that is 
typically used with OGC service outputs to control which items are output…

With those changes you could write a template like so:

// MapServer Template
[resultset layer_pattern="."]
[feature]
<table>
[values format=”<tr><td>$item</td><td>$value</td></tr>]
</table>
[/feature]
[resultset]

This would give you an item/value table for any feature for any layer. You 
could also to more horizontal tables using the [items] tag to output one header 
row…

--Steve


From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of Travis Kirstine
Sent: Tuesday, October 15, 2019 9:06 AM
To: mapserver-users <mapserver-users@lists.osgeo.org>
Subject: [mapserver-users] wms servers html template output

This message may be from an external email source.
Do not select links or open attachments unless verified. Report all suspicious 
emails to Minnesota IT Services Security Operations Center.

________________________________
Hi all,

I'm struggling a bit with using a generic template for html getfeatureinfo 
requests.  Is there a easy way to create a simple html table containing the 
attribute field names and values for any layer.  I don't want to create a 
separate template for each layer.  Thanks

There was some mention of this here:
http://osgeo-org.1560.x6.nabble.com/Generic-template-for-WMS-GetFeatureInfo-td4227865.html<https://gcc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fosgeo-org.1560.x6.nabble.com%2FGeneric-template-for-WMS-GetFeatureInfo-td4227865.html&data=02%7C01%7Csteve.lime%40state.mn.us%7Caa1eb890540341ecbbab08d75178d454%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C637067451709877574&sdata=Dl5OEEEfUDw9q020aW453wCbHjNt9pOSMYDzQrW5QXo%3D&reserved=0>

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to