[Geomoose-users] Legend for raster layers

Bob Basques Bob.Basques at ci.stpaul.mn.us
Wed Sep 16 11:22:42 EDT 2009


Vojko, 

I don't believe that Raster layers have a Legend output option from MapServer, designated by the TYPE RASTER line in the mapfile.   You can however make a dummy layer explicitly for generating a Legend entry.  This dummy layer can be of some other type besides RASTER for example.   

The next issue would be how to insert the legend graphic that you have predefined into the legend request. Since GEOMoose uses the mode=<something> parameter to request thing from mapserver, the typical legend is requested via the mode=legend process.   This only works with the legend being defined in the same mapfile as the one that is used to generate the map image for the same layer. 

I do see in the doc for MapServer CGI http://mapserver.org/cgi/controls.html, ( http://mapserver.org/cgi/controls.html, ) that there is a LEGENDICON value option for the MODE parameter, but I don't think this is being used by GeoMoose currently.  But it might be a good approach to follow moving forward on this.  I've never used this myself. 

There is no way that I know of currently to specify a predefined image in the LEGEND block in the mapfile.   I did find a KEYIMAGE option in the CLASS help docs on the mapserver site. http://mapserver.org/mapfile/class.html?highlight=icon ( http://mapserver.org/mapfile/class.html?highlight=icon )  This might be a way forward too.  But I don't know that it will get around the TYPE RASTER thing for sure either. 

bobb 




>>> "Vojko Daneu" <vojko.daneu at mail.telepac.pt> wrote:

Hallo, 

showing the legend of vector layers works without any problems in GeoMoose 1.6. 

In my application I have a raster layer for which I want also to show a legend in the side panel. To do so I have created a html-template with a legend image and some legend text. How do I show the template in the side panel? 

  

Here is my map-file, but it does not show the template ... 

  

MAP
    NAME 'mn_wind'
    SIZE 800 650
    STATUS ON
    EXTENT 391510 5935905 391710 5936205
    UNITS METERS
    IMAGETYPE PNG
    TRANSPARENT TRUE 


    LEGEND
        STATUS ON
    END 


    LAYER
        NAME 'Wind Velocity'
        DATA '00008_wind.png'
        TYPE RASTER
        STATUS DEFAULT
        CLASS
            NAME 'Wind Velocity'
            TEMPLATE 'test.html'
        END
    END 

END

Thanks, 

Vojko 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20090916/22141c56/attachment.html


More information about the Geomoose-users mailing list