[Users] Migrate from mapfish LayerTree to GeoExt LayerTree

Mark Small m.small at ed.ac.uk
Mon Jul 26 14:14:47 CEST 2010


Hi,

Currently we use mapfish to tie our TreePanel and map together, we generate 
json from a database of layer details such as image, whether the node should 
be checked or not etc.

This json contains a layerNames attribute where we specify the layer and the 
feature code we wish to switch off e.g.


Below is a section of json we use to create the mapfish LayerTree

  return [{
    text: 'Clear/Select all Layers',
    leaf: true,
    layerNames: ['Marine'],
    iconCls: 'no-icon',
    checked: true
  }, {
    text: 'Bathymetry & Elevation',
    leaf: false,
    layerNames: ['Marine:57000'],
    iconCls: 'no-icon',
    expanded: false,
    checked: true,
    children: [{
      text: 'Bathymetry',
      leaf: true,
      layerNames: ['Marine:56500'],
      iconCls: 'no-icon',
      expanded: false,
      checked: true,
      children: [{
        text: 'Depth Area',
        leaf: false,
        layerNames: ['Marine:56000'],
        iconCls: 'no-icon',
        checked: true,
        children: [{
          text: 'Depth Area Text',
          leaf: true,
          layerNames: ['Marine:55701'],
          icon: serverUrl + 
'legend_icons/bgs625k/2010_625k_bed_APP_46165.png',
          checked: true
        }, {
          text: 'Undefined Depth',
          icon: serverUrl + 
'legend_icons/bgs625k/2010_625k_bed_APP_46165.png',
          leaf: true
        }, {
          text: 'Intertidal',
          icon: serverUrl + 
'legend_icons/bgs625k/2010_625k_bed_APP_46165.png',
          leaf: true

....


The numbers in the layerNames section correspond to layers set in the params 
object of a layer e.g.

var params = {
        transparent: true,
        layers: [ 57000, 56500, 56000, 55701 ],
        format: 'image/png',
        srs: 'EPSG:27700'
      };

      var layer = new OpenLayers.Layer.WMS("Marine")", urls, params, options);


This setup currently works, we are able to switch on/off individual layers of 
the map via checkboxes on the LayerTree.

What we would like is to recreate this using GeoExt instead.

1) Is this possible??
2) If so how??


Any help would be appreciated.



MARK

CIAO

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Users mailing list