[mapserver-users] How to get layer name in an identify template?

Donald Kerr donald.kerr at dkerr.co.uk
Fri Jul 6 08:19:09 PDT 2012


Thank you for the references, Steve.
 
I'm sure I've used "[bbox]" in a template which is not listed in the first
link. I think I also had some issues regarding where tags like "[shpext]"
can be used within or outwith the "[resultset layer=LayerName]" and
"[feature]" tags. I will need to revisit the work that I was doing since
I've put it on the back burner just now. I don't want to hi-jack this thread
which is now resolved. 
 
Regards,
 
Donald
 
 

-----Original Message-----
From: Lime, Steve D (DNR) [mailto:Steve.Lime at state.mn.us] 
Sent: 06 July 2012 16:03
To: Donald Kerr; 'Bistrais, Bob'; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] How to get layer name in an identify
template?



There are two references:



1)      http://mapserver.org/mapfile/template.html has all the substitution
tag references.

2)      http://mapserver.org/output/template_output.html documents templated
output formats.



Steve



From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Donald Kerr
Sent: Friday, July 06, 2012 9:41 AM
To: 'Bistrais, Bob'; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] How to get layer name in an identify
template?



It would be handy to have a reference to all tags that are available for
templating their limitations in terms of where they can be placed in the
template. I've just started looking at templating for a WFS response and
there's not a lot of out there; at least, I'm finding difficulty in
gathering the info that I need.



Regards,



Donald

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: 06 July 2012 15:34
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] How to get layer name in an identify
template?

Thanks to Steve Lime for finding the solution:

Use the [cl] (current layer name) tag in my template.  This does the trick.
So, my template now looks like this:

<!-- MapServer Template -->

<hr/>

<tr>

<td colspan="2"><b>[cl]</b>

</tr> 

<tr>

<td align="left"><b>Tile:</b> &nbsp [tilename]</td>

</tr>

<tr>

<td align="left"><b>Download Image:</b> &nbsp <a href=[LINK]>[LINK]</a></td>

</tr>

<tr><td colspan="2"><hr></td></tr>


Thanks again Steve!


  _____  


From: mapserver-users-bounces at lists.osgeo.org
[mapserver-users-bounces at lists.osgeo.org] on behalf of Bistrais, Bob
[Bob.Bistrais at maine.gov]
Sent: Thursday, July 05, 2012 2:01 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] How to get layer name in an identify template?

I am trying to set up a single template, which will format the results of an
identify (query by point).  Many of the layers have the same item names, so
I’d like to use the same template for those layers.   I have this working
well, except that I’d like the layer name to appear at the top of each query
result.  How can I put this in as a variable that MapServer can interpret?

Below is my sample code of the template.  I put [wms_title] in as the
variable for the layer name, but this doesn’t work:

<!-- MapServer Template -->

<hr/>

<tr>

<td colspan="2"><b>[wms_title]</b></td>        ß-I want to replace
[wms_title] with something that will return the layer name

</tr>

<tr>

<td align="left"><b>Tile:</b> &nbsp [tilename]</td>

</tr>

<tr>

<td align="left"><b>Download Image:</b> &nbsp <a href=[LINK]>[LINK]</a></td>

</tr>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120706/8c7b323c/attachment-0001.html>


More information about the mapserver-users mailing list