[OpenLayers-Dev] Layers into Groups

Steven M. Ottens steven at minst.net
Wed Oct 17 06:16:55 EDT 2007


Hi,

In mapbuilder we use (OWS)Context to store our layer information, there 
the group information is stored in a XML format like this
<group 'groupname'>
    <layer 'layername'/>
    <layer 'otherlayer'/>
</group>

So I believe that your approach of using
group name
     group: "Group"
and using Group hierarchy
     group: "Parent/Child"
Should be compatible with the OWSContext approach. So it was a heads up 
from me :)

Although I wonder now if Openlayers knows about the groups apart from 
the display in the LayerSwitcher. Because if it implements layer 
management (moving layers) you want to move the entire group upif the 
parent is moved; eg:
if you move parent 2 up it should bring its children along

before:
   parent 1
       -child 1
       -child 2
    normal layer
    parent 2
       -child 3
       -child 4

after:
    parent 1
       -child 1
       -child 2
    parent 2
       -child 3
       -child 4
    normal layer

And to make things more complicated what happens if you move any of the 
childs? (I don't know if the specs require children to stay in their 
groups or not, if not it should be possible to drag them out of a group)

Steven

Jachym Cepicky wrote:
> Hi,
>
> sorry, I do not see your point: I want the layers grouped in
> LayerSwitcher. The simplest way how to do it, is to specify the group
> name
>   group: "Group"
> and using Group hierarchy
>   group: "Parent/Child"
>
> everything happens while new OpenLayers.Layer.* is defined
>
> jachym
>
> Steven M. Ottens píše v St 17. 10. 2007 v 11:23 +0200:
>   
>> The mapbuilder code uses
>> //wmc:ResourceList/wmc:Layer[wmc:Extension/wmc:Group/@name=$GroupName]
>> So this means that it selects the layers which have a group-extension. I 
>> believe the structure is hierarchical, so using group/layer approach 
>> should be consistent with the OWS spec.
>> But I'm not the real expert, I though gertjan did the grouping code, but 
>> could be wrong.
>>
>> Steven
>>
>> Cameron Shorter wrote:
>>     
>>> Grouping layers has been discussed a few time on the Mapbuilder list, in 
>>> particular including Grouping in the OWS Spec.
>>> It would be good to confirm that your grouping code is consistent with 
>>> Mapbuilder and OWS Context to ease future integration issues.
>>> I think Steven is probably the expert in this area.
>>>
>>> Lorenzo Becchi wrote:
>>>   
>>>       
>>>> Cool Jachym.
>>>>
>>>> that's a good idea.
>>>> It can even represent the complete structure of a WMS GetCapabilites 
>>>> (read: WMS Manager [1]).
>>>>
>>>> At the code sprint in Victoria, we where talking with Chris about the 
>>>> possibility to add few features to LayerSwticher. This could be one.
>>>> other possible attribute wired features:
>>>> - "buttonDropLayer" : true //activate a button to let the user drop the 
>>>> layer from map and layerSwitcher
>>>> - "buttonZoom2Extent" : true //show a button to zoom to layer extent
>>>> - "buttonOpacity" : true //show two buttons change layer opacity
>>>> - "buttonMoveLayer" : true //show two buttons to move layers up or down 
>>>> in the overlay list (this could collide with your structure)
>>>>
>>>> this are the buttons that could apply to all type of layers.
>>>> button could be just a div where all styles are defined inside the CSS.
>>>>
>>>> if you and others agree we can expand your Ticket or make another that 
>>>> can manage all points. Or make a lots of tickets...
>>>> ciao
>>>> Lorenzo
>>>>
>>>> ps: btw, your patch doesn't work on Safari 2.
>>>>
>>>> [1] *http://tinyurl.com/2fjbr7*
>>>>
>>>>
>>>>
>>>> Jachym Cepicky wrote:
>>>>   
>>>>     
>>>>         
>>>>> Hi developers,
>>>>> I have implemented ordering map layers into groups [1]. You have to
>>>>> specify new layer attribute group:"Group Name", e.g.:
>>>>>
>>>>>  var dm = new OpenLayers.Layer.WMS( "DM Solutions Transit",
>>>>>                 "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
>>>>>                 {layers: "rail,road",
>>>>>                  transparent: "true", format: "image/png"
>>>>>                 },
>>>>>                 {                 
>>>>>                   group:"Transit"
>>>>>                 });
>>>>>
>>>>> You can define group hierarchy using "/" mark:
>>>>>
>>>>> ....
>>>>> group: "Transit/Roads"
>>>>> ....
>>>>>
>>>>> Only changed file is LayerSwitcher.js
>>>>>
>>>>> For example see [2]
>>>>>
>>>>> Hope, you'll like it
>>>>>
>>>>> Jachym
>>>>>
>>>>> [1] http://trac.openlayers.org/ticket/1086
>>>>> [2]
>>>>> http://dev.openlayers.org/sandbox/jachym/openlayers/examples/layer-groups.html
>>>>>   
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> Dev at openlayers.org
>>>>> http://openlayers.org/mailman/listinfo/dev
>>>>>   
>>>>>     
>>>>>       
>>>>>           
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev at openlayers.org
>>>> http://openlayers.org/mailman/listinfo/dev
>>>>
>>>>   
>>>>     
>>>>         
>>>   
>>>       
>>
>>     






More information about the Dev mailing list