[mapserver-users] User Layer Attributes Enhancement

Daniel Morissette morissette at dmsolutions.ca
Thu Jan 17 22:22:51 EST 2002


Stephen Woodbridge wrote:
> 
> I had a thought along the lines of the Layer Debug attribute. It would
> be nice to have say User1, User2, User3 Attributes on layer objects that
> could be defined in the map file and referenced via mapscript.
> 

This is already avaiable using METADATA tags at the layer and at the web
object level.  Metadata is accessible in MapScript via the getMetaData()
and setMetaData() methods of layerObj and mapObj.  

We use it a lot to store WMS-related information in a MapServer WMS for
instance, and you can create metadata entries with any name you like.

e.g.

 LAYER
   TYPE ...
   ...
   METADATA
    "wms_srs"         "EPSG:4269 EPSG:32182"
    "legend_icon"     "Icons/none.gif"
    "wms_title"       "Water (Lakes) (a)"
    "wms_boundingbox" "EPSG:32182 42708.6 5.27438e+06 5270155.72117e+06"
    "wms_latlonboundingbox" "-59.7807 47.5557 -52.7934 51.6261"
    "wms_connectiontimeout" "60"
   END      
  ...
  END

> One use I had for one of these would be to set a flag as to which layers
> you might want to show on a user interface legend/control table like in
> gmap75. By setting it in the map file you can decide which layers you
> want to generate in the legend/control without having to explicitly list
> the layers in the mapscript code which would lead to a separation of the
> navigation script from the map file being displayed.
> 
> In the case of gmap, you would also have to have all the possible legend
> items generated as images so also having an easy way to generate the
> individual legend images would be great, but I think this can be done
> with a simple mapscript if I think about it a little.
> 

You've got a good point here: there are several things in GMap that can
be done in much more generic ways with today's version of MapServer and
MapScript.  Please keep in mind that GMap was the first application that
was built (a while ago) to test PHP MapScript as we were implementing it
and it's not the best example of good and efficient usage of today's
version of MapScript.  We still distribute it to help new users get
started because it's a relatively simple application and that's the most
complete "free" app that we have to distribute today.

Most of the applications that we build these days take advantage of the
latest MapScript features and thus are much more generic, powerful and
complex... yes, all at once!  ;)  But these apps are built for some of
our clients and for this reason their source code cannot be distributed.

Best Regards,
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list