Changeset 3635 for framework

Show
Ignore:
Timestamp:
09/08/10 09:43:31 (21 months ago)
Author:
elemoine
Message:

fix quickstart, no functional change

Location:
framework/server/trunk/docs
Files:
2 modified
1 moved

Legend:

Unmodified
Added
Removed
  • framework/server/trunk/docs/_static/layout.js

    r3569 r3635  
    55 * @include OpenLayers/Layer/XYZ.js 
    66 * @include OpenLayers/Tile/Image.js 
     7 * @include OpenLayers/Protocol/HTTP.js 
     8 * @include OpenLayers/Request/XMLHttpRequest.js 
    79 * @include OpenLayers/Control/Navigation.js 
    810 * @include OpenLayers/Control/ZoomBox.js 
    911 * @include OpenLayers/Control/NavigationHistory.js 
     12 * @include OpenLayers/Control/GetFeature.js 
     13 * @include OpenLayers/Format/GeoJSON.js 
    1014 * @include GeoExt/data/LayerStore.js 
    1115 * @include GeoExt/widgets/MapPanel.js 
     
    1418 * @include GeoExt/widgets/tips/ZoomSliderTip.js 
    1519 * @include GeoExt/widgets/tree/LayerContainer.js 
     20 * @include GeoExt/widgets/Popup.js 
    1621 */ 
    1722 
    18 Ext.namespace("mapfishapp"); 
    19  
    20 mapfishapp.layout = (function() { 
     23Ext.namespace("App"); 
     24 
     25App.layout = (function() { 
    2126    /* 
    2227     * Private 
     
    4045                                             20037508, 20037508.34), 
    4146            allOverlays: false, 
     47            theme: null, 
    4248            controls: [] 
    4349        }); 
     
    109115        })); 
    110116        actions.push(new GeoExt.Action({ 
    111             iconCls: "info", 
     117            text: "Query", 
    112118            map: map, 
    113119            toggleGroup: "tools", 
    114120            allowDepress: false, 
    115             tooltip: "Query", 
    116             control: new mapfish.Searcher.Map({ 
    117                 url: "countries", 
    118                 protocol: { 
     121            control: new OpenLayers.Control.GetFeature({ 
     122                protocol: new OpenLayers.Protocol.HTTP({ 
     123                    url: "countries", 
    119124                    params: { 
    120125                        epsg: "900913", 
    121126                        attrs: "pays,continent" 
     127                    }, 
     128                    format: new OpenLayers.Format.GeoJSON() 
     129                }), 
     130                eventListeners: { 
     131                    featureselected: function(e) { 
     132                        var f = e.feature; 
     133                        var html = "<p>Country: "+f.attributes.pays+"</p>" + 
     134                            "<p>Continent: "+f.attributes.continent+"</p>"; 
     135                        f.geometry.transform( 
     136                            map.displayProjection, map.projection); 
     137                        if (!this._popup) { 
     138                            this._popup = new GeoExt.Popup({ 
     139                                html: html, 
     140                                map: map, 
     141                                closeAction: 'hide', 
     142                                unpinnable: false 
     143                            }); 
     144                        } 
     145                        else { 
     146                            this._popup.body.update(html); 
     147                            this._popup.doLayout(); 
     148                        } 
     149                        this._popup.feature = f; 
     150                        this._popup.show(); 
    122151                    } 
    123                 }, 
    124                 displayDefaultPopup: true 
     152                } 
    125153            }) 
    126154        })); 
     
    152180         */ 
    153181        init: function() { 
    154             Ext.QuickTips.init(); 
    155182 
    156183            var map = createMap(); 
     
    187214                    width: 150, 
    188215                    xtype: "treepanel", 
     216                    loader: new Ext.tree.TreeLoader({ 
     217                        applyLoader: false 
     218                    }), 
    189219                    root: { 
    190220                        nodeType: "gx_layercontainer", 
  • framework/server/trunk/docs/quickstart.txt

    r3569 r3635  
    168168 
    1691693. configure a route to the ``countries`` controller, this is done by adding 
    170    the following statement after the "CUSTOM ROUTES HERE" comment in the 
     170   the following lines after the "CUSTOM ROUTES HERE" comment in the 
    171171   ``mapfishapp/config/routing.py`` file:: 
    172172 
     173    map.connect("/countries/count", controller="countries", action="count") 
    173174    map.resource("country", "countries") 
    174175 
     
    196197the user. 
    197198 
    198 Edit the ``mapfishapp/public/app/js/mapfishapp_layout.js`` file, look up the 
     199Edit the ``mapfishapp/public/app/lib/App/layout.js`` file, look up the 
    199200``createTbarItems()`` function, and insert a new ``GeoExt.Action`` to the array 
    200201returned by the function by adding the following code to the function (If 
    201 unsure, see this :download:`file <_static/mapfishapp_layout.js>`): 
     202unsure, see this :download:`file <_static/layout.js>`): 
    202203 
    203204.. code-block:: javascript 
    204205 
    205206    actions.push(new GeoExt.Action({ 
    206         iconCls: "info", 
     207        text: "Query", 
    207208        map: map, 
    208209        toggleGroup: "tools", 
    209210        allowDepress: false, 
    210         tooltip: "Query", 
    211         control: new mapfish.Searcher.Map({ 
    212             url: "countries", 
    213             protocol: { 
    214                 params: { 
    215                     epsg: "900913", 
    216                     attrs: "pays,continent", 
    217                     no_geom: true 
    218                 } 
    219             }, 
    220             displayDefaultPopup: true 
     211        control: new OpenLayers.Control.GetFeature({ 
     212        protocol: new OpenLayers.Protocol.HTTP({ 
     213            url: "countries", 
     214            params: { 
     215                epsg: "900913", 
     216                attrs: "pays,continent" 
     217            }, 
     218            format: new OpenLayers.Format.GeoJSON() 
     219        }), 
     220        eventListeners: { 
     221            featureselected: function(e) { 
     222                var f = e.feature; 
     223                var html = "<p>Country: "+f.attributes.pays+"</p>" + 
     224                    "<p>Continent: "+f.attributes.continent+"</p>"; 
     225                f.geometry.transform( 
     226                    map.displayProjection, map.projection); 
     227                if (!this._popup) { 
     228                    this._popup = new GeoExt.Popup({ 
     229                        html: html, 
     230                        map: map, 
     231                        closeAction: 'hide', 
     232                        unpinnable: false 
     233                    }); 
     234                } 
     235                else { 
     236                    this._popup.body.update(html); 
     237                    this._popup.doLayout(); 
     238                } 
     239                this._popup.feature = f; 
     240                this._popup.show(); 
     241            } 
     242        } 
    221243        }) 
    222244    })); 
    223245 
    224 In the above code a ``GeoExt.Action`` configured with ``mapfish.Searcher.Map`` 
    225 is added to the array of actions. The ``mapfish.Searcher.Map`` object is 
    226 connected to the ``countries`` web service through the ``url`` option. In this 
    227 example the ``mapfish.Searcher.Map`` object displays a default popup containing 
    228 the name of the clicked country, and the name of is continent. 
     246In the above code a ``GeoExt.Action`` configured with an 
     247``OpenLayers.Control.GetFeature`` is added to the array of actions. The 
     248``OpenLayers.Control.GetFeature`` object is connected to the ``countries`` web 
     249service through an ``OpenLayers.Protocol.HTTP`` object. In this example a 
     250``GeoExt.Popup`` containing the name of the clicked country, and the name of 
     251the continent, is displayed. 
    229252 
    230253.. image:: _static/query.png