[Mapserver-users] unable to affect HTML legend via URL arguments to map file elements

Emilio Mayorga emiliom at u.washington.edu
Tue Jun 22 20:23:18 PDT 2004


Daniel Morissette wrote:

> Emilio Mayorga wrote:
> 
>> I'm trying to impact the output of an HTML legend by using URL CGI 
>> arguments. For example, if in my map file there is a layer with these 
>> elements:
>> NAME  "countries"
>> GROUP "political"
>> I want to change the group to "admin" on the fly using this URL CGI 
>> snippet:
>> &mode=legend&map_countries_group=admin
>>
>> However, the HTML legend seems to be completely unresponsive to 
>> changes passed via the map_<layer name>_<layer subelement> syntax 
>> (I've tried various changes). Is that so, or am I doing something wrong?
>>
> 
> I had a quick look at the code and I see no reason why the HTML legend 
> would react differently to those layer changes than the other modes. Are 
> you able to change the group value when using browse mode? Which version 
> of MapServer are you using? Maybe that's a bug from an older version?

Thanks for looking into it. I'm using Mapserver 4.0, on RedHat 8 (sorry, 
I forgot to mention that). I've tried changing different layer elements 
(not just group), with no success. I just tried making a layer change 
while on map mode (map_countries_class_size=10). Here's the URL:
http://basin.ocean.washington.edu/cgi-bin/mapserv?mode=map&map=/var/www/html/mapserv/mapache/eng/mapache.map&mapext=-89.7117+14.0558+-85.834+16.9558&mapsize=600+449&layers=countries+departam_ln&map_countries_class_size=10

The change works. When I try the same change using legend mode with HTML 
legend, it doesn't change the legend symbol for the "countries" layer. 
Here's the URL:
http://basin.ocean.washington.edu/cgi-bin/mapserv?map=/var/www/html/mapserv/mapache/eng/mapache.map&mode=legend&mapext=0+0+1.134+0.85&mapsize=600+449&layers=countries+departam_ln&map_countries_class_size=10

Here's the layer definition, though I've also tried this on other layers:
LAYER # paises
   NAME         countries
   DATA         countries
   GROUP        "political"
   STATUS       OFF
   TYPE         LINE

   CLASS
     NAME       "Paises"
     SYMBOL     "line5"
     COLOR      0 0 0
     SIZE       2
   END

   METADATA
     wmstitle    "Paises"
     wms_order   "1"
     meta_href   "/mapserv/mapache/data/ciatadm.html"
   END

   PROJECTION
     "proj=latlong"
     "ellps=intl"
     "no_defs"
   END
END

I tried it using browse mode, but I got an error: "mapserv(): Web 
application error. No template provided". I don't have a template file 
because I'm using the Landview/javascript framework.

Thanks!

-Emilio

PS. My unofficial ("pre-release") MapServer application is here:
http://geo.garrobo.org/mapache/eng/ecosist_ind.html



More information about the MapServer-users mailing list