[mapserver-users] HTM Legend: How to force "click thru" to new page?

Ed McNierney ed at topozone.com
Fri Nov 15 08:11:18 PST 2002


Thomas -

Just use the "target" property of the <A> tag.  You can name a new window "legendwin", for example, and have all the legend links open into that (one) window that's not the parent map window:

<a target="legendwin" href="[leg_layer_name]">

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----
From: Thomas P. Colson [mailto:tpcolson at nexussoft.com]
Sent: Friday, November 15, 2002 10:27 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [mapserver-users] HTM Legend: How to force "click thru" to new
page?


I've implemented a nifty HTML legend IAW http://mapserver.gis.umn.edu/doc36/html-legend-howto.html
And it works GREAT!. Thing is, I'm trying to make it so when the legend url is clicked, it opens up a new browser page as opposed to reloading the mapserver page with the url that is in the legend. Any ideas? 


Here's my Legend.html

[leg_layer_html order_metadata=WMS_ORDER opt_flag=15]
      <tr>
           <td><input type=checkbox name=layer value=[leg_layer_name]
             [if name=layer_status value=1]CHECKED[/if]>
              [if name=layer_type value=4]
                  <img src=[leg_icon width=22 height=18]>
              [/if]
              [if name=layer_type oper=neq value=4]<img src=[leg_icon]>[/if]
           </td>
           <td>
              <a href="[leg_layer_name]">[metadata name=description]</a>
           </td>
      </tr>
[/leg_layer_html]


and in my .map file...



  LEGEND
    STATUS ON
    OUTLINECOLOR 195 195 195
    IMAGECOLOR 195 195 195
    TRANSPARENT ON
    INTERLACE OFF
    POSITION UR
    KEYSIZE 20 10 
    KEYSPACING 5 5 
    TEMPLATE "/var/www/html/maplab-2.0rc3/htdocs/mapbrowser/legend_template.html"
    POSTLABELCACHE TRUE
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      OFFSET 0 0 
      BUFFER 0
      MINDISTANCE -1
      MINFEATURESIZE -1
      COLOR 195 195 195
      OUTLINECOLOR 195 195 195
      SHADOWCOLOR 195 195 195
      SHADOWSIZE 1 1 
      BACKGROUNDCOLOR 195 195 195
      BACKGROUNDSHADOWCOLOR 195 195 195
      BACKGROUNDSHADOWSIZE 1 1 
      PARTIALS TRUE
      FORCE FALSE
    END
  END





More information about the MapServer-users mailing list