[Chameleon] Legend-Problem

Paul Spencer pspencer at dmsolutions.ca
Tue Aug 2 17:11:34 EDT 2005


There can be a problem with scale-dependent-layers ... essentially, 
Chameleon keeps track of which layers are currently 'visible' through 
the legend template mechanism in mapserver.  Layers that are 
out-of-scale are considered off and so the associated checkbox is not 
checked.  When the checkbox is off, Chameleon explicitly sets the layer 
status to off ... so when it does come into scale, the layer doesn't 
come on as it should.

I don't have a fix for this problem.  However, it someone could figure 
out the right logic for this, it would be a godsend!

Cheers

Paul

Stephan Holl wrote:
> Dear List,
> 
> I have several WMS-Layer depending on the scale in my chameleon app.
> 
> Sometimes I have the problem, that the layer are switched off when
> zooming out, ore to full scale.
> 
> Does anybody had this behaviour sometimes? The problem is I cannot
> really reproduce it...
> 
> Perhaps someone  an point me to the correct location...
> 
> My Mapfile-snippet:
> # Uebersichtskarte 1:5000000
> LAYER
>         NAME "DUEKN5000"
>         TYPE RASTER
>         STATUS DEFAULT
>         CONNECTION
> "http://www.mapserver.niedersachsen.de/freezoneogc/mapserverogc?"
> CONNECTIONTYPE WMS 
> METADATA
>                 "wms_srs"       "EPSG:31467 EPSG:31493"
>                 "wms_name"      "DUEKN5000"
>                 "wms_title"     "Uebersichtskarte 1:5000000"
>                 "wms_server_version"  "1.1.1"
>                 "wms_formatlist"      "image/png,image/jpeg"
>                 "wms_format"          "image/png"
>         END
>         MINSCALE 2000010
>         PROJECTION
>        "init=epsg:31467"
>         END
> END
> 
> So giving no maxscale-statement, the map should be shown always above
> scale 1:2000010. 
> As you see the status of the layer is set to default, so that
> everything is on by default.
> 
> 
> My environment:
> debian3.1
> MS 4.6
> 
> my legend-template:
> [leg_layer_html order=ascending opt_flag=14]
> <tr bgcolor="#ffffff" style="border-width:medium;
> border-color:#FF9999; border-style:dotted; padding:5px;"> 
> <td><input type="radio" name="my_legend"
> onclick="CWCSelectLayer('[leg_layer_name]', true)"
> [if name=selected value=1] CHECKED
> [/if]
> 
>></td>
> 
> <td align="center" width=20>
> <input type="checkbox"
> name="legendlayername[]" value="[leg_layer_name]" 
> [if name=layer_status oper=eq value=1]CHECKED
> [/if] 
> [if name=layer_status oper=eq value=2]CHECKED
> [/if]></td>
> [if name=wms_name oper=isnull] <td>
> <a href="#"
> onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');">
> <span class="label">[leg_layer_name] </span></a></td> </tr> 
> [/if] 
> [if name=wms_name oper=isset] <td><a href="#"
> onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');">
> <span class="label">[metadata name=WMS_TITLE]</span>
> </a></td> </tr>
> [/if]
> 
> [/leg_layer_html]
> [leg_class_html]
>    <tr>
>        <td width=15>&nbsp; </td>
>        <td colspan="2" bgcolor="#ebedec" class="label">
>            <img src="[leg_icon width=20 height=10]" width=20 height=10>
> [leg_class_name] </td>
>    </tr>
> [/leg_class_html]
> 
> 
> Thanks
> 
> 	Stephan
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list