Changeset 2247

Show
Ignore:
Timestamp:
07/30/10 14:32:45 (1 month ago)
Author:
pgiraud
Message:

OpenGeo workshop update, more work to come

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/foss4g2010/src/doc/basics/dissect.rst

    r2235 r2247  
    114114        items: [{ 
    115115            xtype: "gx_mappanel", 
    116             layers: [new OpenLayers.Layer.WMS( 
    117                 "Imagery", 
    118                 "/geoserver/ows?", 
    119                 {layers: "bluemarble"} 
    120             )] 
     116            layers: [new OpenLayers.Layer.WMS("Global Imagery", 
     117                "http://maps.opengeo.org/geowebcache/service/wms", { 
     118                    layers: "bluemarble" 
     119                }, { 
     120                    buffer: 0, 
     121                    visibility: false 
     122                } 
     123            )], 
     124            extent: new OpenLayers.Bounds( 
     125                143.83482400000003, -43.648056, 
     126                148.47914100000003, -39.573891 
     127            ) 
    121128        } 
    122129    } 
     
    141148nothing else we need to configure. 
    142149 
     150The last property ``extent`` is here to tell the OpenLayers map to zoom to the 
     151given extent when initialized. 
     152 
    143153.. note:: 
    144154 
  • sandbox/foss4g2010/src/doc/basics/map.rst

    r2235 r2247  
    3333        <head> 
    3434            <title>GeoExt Map Window</title> 
    35      
     35 
    3636            <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> 
    3737            <script type="text/javascript" src="ext/ext-all.js"></script> 
    3838            <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" /> 
    3939            <script src="openlayers/lib/OpenLayers.js"></script> 
    40      
     40 
    4141            <script type="text/javascript" src="geoext/lib/GeoExt.js"></script> 
    42              
     42 
    4343            <script type="text/javascript"> 
    4444            Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif"; 
    45              
     45 
    4646            Ext.onReady(function() { 
    4747                new Ext.Window({ 
     
    5353                        xtype: "gx_mappanel", 
    5454                        layers: [new OpenLayers.Layer.WMS( 
    55                             "Imagery", 
    56                             "/geoserver/ows?", 
    57                             {layers: "bluemarble"} 
    58                         )] 
     55                            "Tasmania", 
     56                            "/geoserver/wms?", 
     57                            {layers: "tasmania"} 
     58                        )], 
     59                        extent: new OpenLayers.Bounds( 
     60                            143.83482400000003, -43.648056, 
     61                            148.47914100000003, -39.573891 
     62                        ) 
    5963                    }] 
    6064                }).show(); 
  • sandbox/foss4g2010/src/doc/index.rst

    r2235 r2247  
    2222    as User Extension such as WMSBrowser. 
    2323    Put them all in a well organized interface using a ViewPort. 
    24      
    25 :ref:`geoext.features` 
    26     Learn how to load features from a WFS service, display them in a grid and 
    27     in the map, then synchronize feature selection between grid and map. 
     24 
     25:ref:`geoext.wfs` 
     26    Create a WFS-T editor with a synchronized map and table view. 
    2827     
    2928:ref:`geoext.editing` 
     
    3534    basics/index 
    3635    layout/index 
    37     features/index 
     36    wfs/index 
    3837    editing/index 
  • sandbox/foss4g2010/src/doc/layout/index.rst

    r2235 r2247  
    1919    Add a Tree to Manage the Map Layers <tree> 
    2020    Create a LegendPanel <legend> 
     21    Organize the Application Interface Using a ViewPort <layout> 
    2122    Plug a WMSBrowser <wmsbrowser> 
    22     Organize the Application Interface Using a ViewPort <layout> 
    23     Add a Toolbar to the MapPanel <toolbar> 
  • sandbox/foss4g2010/src/doc/layout/layout.rst

    r2235 r2247  
    44=================================================== 
    55 
     6.. code-block:: javascript 
     7 
     8        Ext.onReady(function() { 
     9            var layers = [ 
     10                new OpenLayers.Layer.WMS("Global Imagery", 
     11                    "http://maps.opengeo.org/geowebcache/service/wms", { 
     12                        layers: "bluemarble" 
     13                    }, { 
     14                        buffer: 0, 
     15                        visibility: false 
     16                    } 
     17                ), 
     18                new OpenLayers.Layer.WMS("Tasmania State Boundaries", 
     19                    "/geoserver/wms", { 
     20                        layers: "topp:tasmania_state_boundaries" 
     21                    }, { 
     22                        buffer: 0 
     23                    } 
     24                ), 
     25                new OpenLayers.Layer.WMS("Water", 
     26                    "/geoserver/wms", { 
     27                        layers: "topp:tasmania_water_bodies", 
     28                        transparent: true, 
     29                        format: "image/gif" 
     30                    }, { 
     31                        isBaseLayer: false, 
     32                        buffer: 0 
     33                    } 
     34                ), 
     35                new OpenLayers.Layer.WMS("Cities", 
     36                    "/geoserver/wms", { 
     37                        layers: "topp:tasmania_cities", 
     38                        transparent: true, 
     39                        format: "image/gif" 
     40                    }, { 
     41                        isBaseLayer: false, 
     42                        buffer: 0 
     43                    } 
     44                ), 
     45                new OpenLayers.Layer.WMS("Tasmania Roads", 
     46                    "/geoserver/wms", { 
     47                        layers: "topp:tasmania_roads", 
     48                        transparent: true, 
     49                        format: "image/gif" 
     50                    }, { 
     51                        isBaseLayer: false, 
     52                        buffer: 0 
     53                    } 
     54                ), 
     55                // create a group layer (with several layers in the "layers" param) 
     56                // to show how the LayerParamLoader works 
     57                new OpenLayers.Layer.WMS("Tasmania (Group Layer)", 
     58                    "/geoserver/wms", { 
     59                        layers: [ 
     60                            "topp:tasmania_state_boundaries", 
     61                            "topp:tasmania_water_bodies", 
     62                            "topp:tasmania_cities", 
     63                            "topp:tasmania_roads" 
     64                        ], 
     65                        transparent: true, 
     66                        format: "image/gif" 
     67                    }, { 
     68                        isBaseLayer: false, 
     69                        buffer: 0, 
     70                        // exclude this layer from layer container nodes 
     71                        displayInLayerSwitcher: false, 
     72                        visibility: false 
     73                    } 
     74                ) 
     75            ]; 
     76 
     77            var mappanel = new GeoExt.MapPanel({ 
     78                extent: new OpenLayers.Bounds( 
     79                    143.83482400000003, -43.648056, 
     80                    148.47914100000003, -39.573891 
     81                ), 
     82                map: new OpenLayers.Map({allOverlays: false}), 
     83                layers: layers, 
     84                region: 'center' 
     85            }); 
     86 
     87            new Ext.Viewport({ 
     88                layout: 'border', 
     89                items: [mappanel] 
     90            }); 
     91        }); 
     92 
     93.. code-block:: javascript 
     94 
     95    { 
     96        xtype: 'tabpanel', 
     97        region: 'west', 
     98        width: 250 
     99    } 
     100 
     101 
     102.. code-block:: javascript 
     103 
     104    activeTab: 0, 
     105    items: [tree] 
     106 
     107.. note:: 
     108 
     109    Don't forget to add a title to the tree panel. 
     110    Also no need to render the panel, the rendering will be done by Ext while doing the layout. 
     111 
     112Repeat the same operation for legendPanel. You should now have a column on the left with two tabs. 
     113 
     114.. code-block:: javascript 
     115 
  • sandbox/foss4g2010/src/doc/layout/legend.rst

    r2235 r2247  
    33Create a LegendPanel 
    44==================== 
     5 
     6.. code-block:: javascript 
     7 
     8    var legendPanel = new GeoExt.LegendPanel({ 
     9        defaults: { 
     10            labelCls: 'mylabel', 
     11            style: 'padding:5px' 
     12        }, 
     13        bodyStyle: 'padding:5px' 
     14    }); 
     15    legendPanel.render(document.body); 
  • sandbox/foss4g2010/src/doc/layout/tree.rst

    r2235 r2247  
    33Add a Tree to Manage the Map Layers 
    44=================================== 
     5 
     6We want several layers: base and overlay layers. 
     7Modify the ``layers`` array to match the following. 
     8 
     9.. code-block:: javascript 
     10 
     11    var layers = [ 
     12        new OpenLayers.Layer.WMS("Global Imagery", 
     13            "http://maps.opengeo.org/geowebcache/service/wms", { 
     14                layers: "bluemarble" 
     15            }, { 
     16                buffer: 0, 
     17                visibility: false 
     18            } 
     19        ), 
     20        new OpenLayers.Layer.WMS("Tasmania State Boundaries", 
     21            "/geoserver/wms", { 
     22                layers: "topp:tasmania_state_boundaries" 
     23            }, { 
     24                buffer: 0 
     25            } 
     26        ), 
     27        new OpenLayers.Layer.WMS("Water", 
     28            "/geoserver/wms", { 
     29                layers: "topp:tasmania_water_bodies", 
     30                transparent: true, 
     31                format: "image/gif" 
     32            }, { 
     33                isBaseLayer: false, 
     34                buffer: 0 
     35            } 
     36        ), 
     37        new OpenLayers.Layer.WMS("Cities", 
     38            "/geoserver/wms", { 
     39                layers: "topp:tasmania_cities", 
     40                transparent: true, 
     41                format: "image/gif" 
     42            }, { 
     43                isBaseLayer: false, 
     44                buffer: 0 
     45            } 
     46        ), 
     47        new OpenLayers.Layer.WMS("Tasmania Roads", 
     48            "/geoserver/wms", { 
     49                layers: "topp:tasmania_roads", 
     50                transparent: true, 
     51                format: "image/gif" 
     52            }, { 
     53                isBaseLayer: false, 
     54                buffer: 0 
     55            } 
     56        ), 
     57        // create a group layer (with several layers in the "layers" param) 
     58        // to show how the LayerParamLoader works 
     59        new OpenLayers.Layer.WMS("Tasmania (Group Layer)", 
     60            "/geoserver/wms", { 
     61                layers: [ 
     62                    "topp:tasmania_state_boundaries", 
     63                    "topp:tasmania_water_bodies", 
     64                    "topp:tasmania_cities", 
     65                    "topp:tasmania_roads" 
     66                ], 
     67                transparent: true, 
     68                format: "image/gif" 
     69            }, { 
     70                isBaseLayer: false, 
     71                buffer: 0, 
     72                // exclude this layer from layer container nodes 
     73                displayInLayerSwitcher: false, 
     74                visibility: false 
     75            } 
     76        ) 
     77    ]; 
     78 
     79Also, since we don't want all layers to be considered as overlays we need to set 
     80options for our map. 
     81Add the following to your `GeoExt.MapPanel` configuration object: 
     82 
     83.. code-block:: javascript 
     84 
     85    map: new OpenLayers.Map({allOverlays: false}) 
     86 
     87.. code-block:: javascript 
     88 
     89    var treeConfig = [{ 
     90        nodeType: "gx_baselayercontainer" 
     91    }, { 
     92        nodeType: "gx_overlaylayercontainer", 
     93        expanded: true 
     94    }, { 
     95        nodeType: "gx_layer", 
     96        layer: "Tasmania (Group Layer)", 
     97        isLeaf: false, 
     98        // create subnodes for the layers in the LAYERS param. If we assign 
     99        // a loader to a LayerNode and do not provide a loader class, a 
     100        // LayerParamLoader will be assumed. 
     101        loader: { 
     102            param: "LAYERS" 
     103        } 
     104    }]; 
     105    var tree = new Ext.tree.TreePanel({ 
     106        border: false, 
     107        loader: new Ext.tree.TreeLoader({ 
     108            applyLoader: false 
     109        }), 
     110        root: { 
     111            nodeType: "async", 
     112            children: treeConfig 
     113        }, 
     114        rootVisible: false 
     115    }); 
     116    tree.render(document.body); 
     117 
     118Don't forget to add a title to the tree panel 
     119 
     120 
     121 
  • sandbox/foss4g2010/src/doc/layout/wmsbrowser.rst

    r2235 r2247  
    44================= 
    55 
     6 
     7 
     8.. code-block:: javascript 
     9 
     10 
     11