[Cartoweb-users] legend icons

Oliver Christen oliver.christen at camptocamp.com
Thu May 15 02:34:22 EDT 2008


Or you could make one layer from each of your existing class and group all 
these layers in a layerGroup.
To hide the checkbox, simply use define a metadata for these layers in the 
layers.ini :

layers.****.metadata.nocheckbox = true

and add a check in layers.tpl :

{if !$element.layerMeta.nocheckbox}
<input
{if $element.layerRendering == 'radio'}type="radio" 
name="layers_{$element.parentId}"
{else}type="checkbox" name="layers[]" {/if}
value="{$element.layerId}" id="in{$element.nodeId}"
  onclick="javascript:updateChecked('{$element.nodeId}');
    CartoWeb.trigger('Layers.LayerShowHide');" {if 
$element.layerChecked}checked="checked"{/if} />
{/if}

That way you can define the icon via the existing .icon property in the 
layers.ini and still be able to use vector symbol on the map.

regards
Oliver


> Hi
>
> Thats a limitation of the current version.
> You can define an image for a class, but it means that image will also be 
> used on the map.
> For example:
>
>  CLASS
>    KEYIMAGE "icons/eboulement.gif"
>    EXPRESSION  "7"
>    NAME "eboulement"
>    STYLE
>      COLOR 0 0 0
>    END
>  END
>
> It would be certainly possible to modify the application to be able to set 
> the dimension of the auto generated icons but it would mean extend/rewrite 
> some part of the code.
>
> regards
> Oliver
>
>>
>> Hi,
>>
>> It seems that I can only define my icon for a layer instead of a class of
>> the layer?  I have some symbols which are too big to be shown entirely in
>> the layer legend, some of them belong to the classes of certain layers.
>> Could I use my own image for the classes? or could I set the dimension of
>> the auto generated icons bigger?
>>
>> Thanks very much,
>> Jady
>>
>>
>>
>> Oliver Christen wrote:
>>>
>>> if im not wrong, you simply give a name to the class which need to used
>>> for
>>> the icon rendering.
>>>
>>> if the icon is not to your likeing, you can always make a image and 
>>> define
>>> in the layers.ini the layer or layerGroup must use this image:
>>> http://www.cartoweb.org/doc/cw3.4/xhtml/user.layers.html
>>>  layers.layerId.icon = filename
>>> and also
>>> http://www.cartoweb.org/doc/cw3.4/xhtml/user.layers.html#user.layers.legend
>>>
>>>
>>>> Hi,
>>>> I use autoClassLegend = true and I need to change class icon of any
>>>> layer.
>>>> This layer is named and classed in mapfile.map and I don't know how to
>>>> set legend icon for its classes.
>>>>
>>>> I have layers with five and more classes.
>>>> Could I change this icons please?
>>>> thanks
>>>>
>>>> wochter
>>>> _______________________________________________
>>>> Cartoweb-users mailing list
>>>> Cartoweb-users at lists.maptools.org
>>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>>
>>>
>>> _______________________________________________
>>> Cartoweb-users mailing list
>>> Cartoweb-users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>
>>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/legend-icons-tp16275244p17245157.html
>> Sent from the cartoweb-users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Cartoweb-users mailing list
>> Cartoweb-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>
> 



More information about the Cartoweb-users mailing list