Changeset 3671
- Timestamp:
- 12/01/10 15:26:35 (3 years ago)
- Location:
- sandbox/cmoullet/2010_mapfish_workshop_fhnw
- Files:
-
- 30 added
- 12 modified
-
build/doctrees/environment.pickle (modified) (previous)
-
build/doctrees/getting_started.doctree (added)
-
build/doctrees/introduction.doctree (modified) (previous)
-
build/doctrees/mapfish.doctree (modified) (previous)
-
build/html/_downloads (added)
-
build/html/_downloads/extjs_hello_world.html (added)
-
build/html/_downloads/extjs_viewport.html (added)
-
build/html/_downloads/geoext_action.html (added)
-
build/html/_downloads/geoext_mappanel.html (added)
-
build/html/_downloads/openlayers_editing_toolbar.html (added)
-
build/html/_downloads/openlayers_map.html (added)
-
build/html/_images (added)
-
build/html/_images/mapfish_globe.png (added)
-
build/html/_images/mapfish_swissrivers.png (added)
-
build/html/_sources/getting_started.txt (added)
-
build/html/_sources/introduction.txt (modified) (1 diff)
-
build/html/_sources/mapfish.txt (modified) (1 diff)
-
build/html/_static/extjs_hello_world.html (added)
-
build/html/_static/extjs_viewport.html (added)
-
build/html/_static/geoext_action.html (added)
-
build/html/_static/geoext_mappanel.html (added)
-
build/html/_static/mapfish_globe.png (added)
-
build/html/_static/mapfish_swissrivers.png (added)
-
build/html/_static/openlayers_editing_toolbar.html (added)
-
build/html/_static/openlayers_map.html (added)
-
build/html/getting_started.html (added)
-
build/html/index.html (modified) (1 diff)
-
build/html/introduction.html (modified) (5 diffs)
-
build/html/mapfish.html (modified) (5 diffs)
-
build/html/objects.inv (modified) (previous)
-
build/html/searchindex.js (modified) (1 diff)
-
source/_static/extjs_hello_world.html (added)
-
source/_static/extjs_viewport.html (added)
-
source/_static/geoext_action.html (added)
-
source/_static/geoext_mappanel.html (added)
-
source/_static/mapfish_globe.png (added)
-
source/_static/mapfish_swissrivers.png (added)
-
source/_static/openlayers_editing_toolbar.html (added)
-
source/_static/openlayers_map.html (added)
-
source/getting_started.rst (added)
-
source/introduction.rst (modified) (2 diffs)
-
source/mapfish.rst (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sandbox/cmoullet/2010_mapfish_workshop_fhnw/build/html/_sources/introduction.txt
r3670 r3671 1 1 Introduction 2 2 ************ 3 4 .. raw:: html 5 6 <script language=javascript type='text/javascript'> 7 8 function hidediv(div, showDiv, hideDiv) { 9 document.getElementById(div).style.visibility = 'hidden'; 10 document.getElementById(div).style.display = 'none'; 11 document.getElementById(hideDiv).style.visibility = 'hidden'; 12 document.getElementById(hideDiv).style.display = 'none'; 13 document.getElementById(showDiv).style.visibility = 'visible'; 14 document.getElementById(showDiv).style.display = 'block'; 15 } 16 17 function showdiv(div, showDiv, hideDiv) { 18 document.getElementById(div).style.visibility = 'visible'; 19 document.getElementById(div).style.display = 'block'; 20 document.getElementById(showDiv).style.visibility = 'hidden'; 21 document.getElementById(showDiv).style.display = 'none'; 22 document.getElementById(hideDiv).style.visibility = 'visible'; 23 document.getElementById(hideDiv).style.display = 'block'; 24 } 25 </script> 26 27 28 Computer Setup 29 -------------- 30 31 Several pieces of software have been installed on your computer: 32 33 * PostGres / PostGIS 34 * Ultraedit 35 * `Python 2.5 <http://www.python.org/download/releases/2.5.4/>`_ 36 * `Python for Windows extensions <http://sourceforge.net/projects/pywin32/>`_ 37 38 MapFish Framework 39 ----------------- 40 41 What is a framework ? 42 ^^^^^^^^^^^^^^^^^^^^^ 43 44 MapFish is a flexible and complete framework for building rich web-mapping 45 applications. It emphasizes high productivity, and high-quality development. 46 But, what is a framework ? From `wikipedia <http://en.wikipedia.org/wiki/Framework>`_ : 47 "A framework is a basic conceptual structure used to solve or address complex issues.". 48 The framework aims to alleviate the overhead associated with common activities performed in Web mapping development. 49 50 In that sense, MapFish Framework provides the technology for building web mapping applications. 51 With client technologies, the developer can create user interfaces and with server technologies, it is possible to develop the necessary web services. 52 53 On the client side, JavaScript libraries are mainly used, on the server side, several languages can be used. 54 Originally, Python components were used, but with the time, Java, Ruby and PHP components have also been developped. 55 This shows the flexibility and openness of the framework. 56 57 .. note:: 58 59 MapFish is cartographic server agnostic. It can be used with `MapServer <http://www.mapserver.org>`_, `GeoServer <http://www.geoserver.org>`_, `MapGuide <http://www.mapguide.org>`_ 60 or whatever cartographic server that is able to communicate with open protocols like WMS or WFS. 61 62 Components of MapFish framework 63 ::::::::::::::::::::::::::::::: 64 65 Several Open Source technologies are used in MapFish Framework. 66 67 Client side: 68 69 * `GeoExt <http://www.geoext.org>`_: GeoExt is a JavaScript library providing the groundwork for creating web-mapping applications based on OpenLayers and ExtJS. 70 * `OpenLayers <http://www.openlayers.org>`_: OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source. 71 * `ExtJS <http://extjs.com/>`_: Ext JS is a cross-browser JavaScript library for building rich internet applications. 72 73 Server side: 74 75 * `Shapely <http://pypi.python.org/pypi/Shapely>`_: Shapely is a Python package for manipulation and analysis of 2D geospatial geometries. 76 * `SqlAlchemy <http://www.sqlalchemy.org/>`_: SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. 77 * `GeoAlchemy <http://www.geoalchemy.org/>`_: GeoAlchemy is an extension of SQLAlchemy allowing the access to Oracle Spatial, PostGis and MySQL. 78 * `Pylons <http://pylonshq.com/>`_: Pylons is a lightweight web framework emphasizing flexibility and rapid development. 79 80 MapFish Examples 81 ---------------- 82 83 MapFish JavaScript Toolbox 84 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 85 86 MapFish JavaScript Toolbox is composed of three JavaScript libraries: ExtJS, OpenLayers and GeoExt. The functionality of all these libraries will be highlighted with some example code. 87 88 .. _mapfish_client_extjs: 89 90 ExtJS 91 ^^^^^ 92 93 Ext JS is a cross-browser JavaScript library for building rich internet applications. It provides a `very large list of UI components <http://www.extjs.com/deploy/dev/examples/samples.html>`_. 94 95 .. note:: 96 97 In order to play with ExtJS, it is needed to reference the ExtJS library and the associated css. For simplicity, we have prepared an accessible build with `CacheFly <http://extjs.com/products/extjs/build/index.php>`_. 98 99 Then, simply add the following code in the html page: 100 101 <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script> 102 103 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" /> 104 105 Ext "Hello World" 106 ::::::::::::::::: 107 108 Create your own html page with the following code :download:`extjs_hello_world.html <_static/extjs_hello_world.html>`. 109 If you open it in a browser, you should get a message "Hello World! You have ExtJS configured correctly!" 110 111 .. raw:: html 112 113 <a id="showRef2" href="javascript:showdiv('codeBlock2','showRef2','hideRef2')">Show code</a> 114 <a id="hideRef2" href="javascript:hidediv('codeBlock2','showRef2','hideRef2')" style="display: none; visibility: hidden">Hide code</a> 115 <div id="codeBlock2" style="display: none; visibility: hidden"> 116 117 .. code-block:: html 118 119 <html> 120 <head> 121 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 122 <title id='title'>ExtJS Hello World</title> 123 124 <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script> 125 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" /> 126 127 <script type="text/javascript"> 128 Ext.onReady(function(){ 129 alert("Hello World! You have ExtJS configured correctly!"); 130 }); //end onReady 131 </script> 132 133 </head> 134 <body> 135 </body> 136 </html> 137 138 .. raw:: html 139 140 </div> 141 142 Ext.Viewport 143 :::::::::::: 144 145 The Viewport renders itself to the document body, and automatically sizes itself to the size of the browser viewport and manages window resizing. There may only be one Viewport created in a page. Let's have a look at the configuration of a `viewport <http://www.extjs.com/deploy/dev/docs/?class=Ext.Viewport>`_: 146 147 To test: :download:`extjs_viewport.html <_static/extjs_viewport.html>` 148 149 .. raw:: html 150 151 <a id="showRef3" href="javascript:showdiv('codeBlock3','showRef3','hideRef3')">Show code</a> 152 <a id="hideRef3" href="javascript:hidediv('codeBlock3','showRef3','hideRef3')" style="display: none; visibility: hidden">Hide code</a> 153 <div id="codeBlock3" style="display: none; visibility: hidden"> 154 155 .. code-block:: html 156 157 <html> 158 <head> 159 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> 160 <title id='title'>ExtJS Viewport</title> 161 162 <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script> 163 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"/> 164 165 <script type="text/javascript"> 166 Ext.onReady(function() { 167 new Ext.Viewport({ 168 layout: 'border', 169 items: [ 170 { 171 region: 'north', 172 html: '<h1 class="x-panel-header">Page Title</h1>', 173 autoHeight: true, 174 border: false, 175 margins: '0 0 5 0' 176 }, 177 { 178 region: 'west', 179 collapsible: true, 180 title: 'Navigation', 181 xtype: 'treepanel', 182 width: 200, 183 autoScroll: true, 184 split: true, 185 loader: new Ext.tree.TreeLoader(), 186 root: new Ext.tree.AsyncTreeNode({ 187 expanded: true, 188 children: [ 189 { 190 text: 'Menu Option 1', 191 leaf: true 192 }, 193 { 194 text: 'Menu Option 2', 195 leaf: true 196 }, 197 { 198 text: 'Menu Option 3', 199 leaf: true 200 } 201 ] 202 }), 203 rootVisible: false, 204 listeners: { 205 click: function(n) { 206 Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.text + '"'); 207 } 208 } 209 }, 210 { 211 region: 'center', 212 xtype: 'tabpanel', 213 items: { 214 title: 'Default Tab', 215 html: 'The first tab\'s content. Others may be added dynamically' 216 } 217 }, 218 { 219 region: 'south', 220 title: 'Information', 221 collapsible: true, 222 html: 'Information goes here', 223 split: true, 224 height: 100, 225 minHeight: 100 226 } 227 ] 228 }); 229 }); //end onReady 230 </script> 231 232 </head> 233 <body> 234 </body> 235 </html> 236 237 .. raw:: html 238 239 </div> 240 241 Ext.grid.GridPanel 242 :::::::::::::::::: 243 244 `Globe application <http://map.globe.admin.ch>`_ uses a `grid panel <http://extjs.com/deploy/dev/docs/?class=Ext.grid.GridPanel>`_: 245 246 .. image:: _static/mapfish_globe.png 247 248 .. _mapfish_client_openlayers: 249 250 OpenLayers 251 ^^^^^^^^^^ 252 253 OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source. 254 255 Have a look at the `OpenLayers examples <http://openlayers.org/dev/examples/>`_ to see the power of this library. 256 257 .. note:: 258 259 In order to play with OpenLayers, it is needed to reference the OpenLayers library. 260 261 Simply add the following code in the html page: 262 263 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 264 265 Map 266 ::: 267 268 Instances of `OpenLayers.Map <http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Map-js.html>`_ are interactive maps embedded in a web page. 269 270 To test: :download:`openlayers_map.html <_static/openlayers_map.html>` 271 272 .. raw:: html 273 274 <a id="showRef4" href="javascript:showdiv('codeBlock4','showRef4','hideRef4')">Show code</a> 275 <a id="hideRef4" href="javascript:hidediv('codeBlock4','showRef4','hideRef4')" style="display: none; visibility: hidden">Hide code</a> 276 <div id="codeBlock4" style="display: none; visibility: hidden"> 277 278 .. code-block:: html 279 280 <html> 281 <head> 282 <title>OpenLayers Map</title> 283 284 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 285 286 <script type="text/javascript"> 287 var map, layer; 288 function init() { 289 map = new OpenLayers.Map('map'); 290 layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 291 "http://labs.metacarta.com/wms/vmap0", 292 {layers: 'basic'} 293 ); 294 map.addLayer(layer); 295 map.zoomToMaxExtent(); 296 } 297 </script> 298 </head> 299 300 <body onload="init()"> 301 302 <div id="map"></div> 303 304 </body> 305 </html> 306 307 .. raw:: html 308 309 </div> 310 311 Editing Toolbar 312 ::::::::::::::: 313 314 `Editing Toolbar <http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/_staticOpenLayers/Control/EditingToolbar-js.html>`_ 315 316 To test: :download:`openlayers_editing_toolbar.html <_static/openlayers_editing_toolbar.html>` 317 318 .. raw:: html 319 320 <a id="showRef5" href="javascript:showdiv('codeBlock5','showRef5','hideRef5')">Show code</a> 321 <a id="hideRef5" href="javascript:hidediv('codeBlock5','showRef5','hideRef5')" style="display: none; visibility: hidden">Hide code</a> 322 <div id="codeBlock5" style="display: none; visibility: hidden"> 323 324 .. code-block:: html 325 326 <html xmlns="http://www.w3.org/1999/xhtml"> 327 <head> 328 <title>OpenLayers Editing Toolbar </title> 329 330 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 331 332 <script type="text/javascript"> 333 var lon = 5; 334 var lat = 40; 335 var zoom = 5; 336 var map, layer; 337 338 function init() { 339 layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 340 "http://labs.metacarta.com/wms/vmap0", 341 {layers: 'basic'} 342 ); 343 344 vlayer = new OpenLayers.Layer.Vector("Editable"); 345 map = new OpenLayers.Map('map', { 346 controls: [ 347 new OpenLayers.Control.PanZoom(), 348 new OpenLayers.Control.EditingToolbar(vlayer) 349 ] 350 }); 351 map.addLayers([layer, vlayer]); 352 353 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 354 } 355 </script> 356 </head> 357 <body onload="init()"> 358 <div id="map"></div> 359 </body> 360 </html> 361 362 .. raw:: html 363 364 </div> 365 366 Popup 367 ::::: 368 369 `Swissrivers.ch application <http://www.swissrivers.ch>`_ uses `OpenLayers popups <http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Popup-js.html>`_ to present hydrogramms. 370 371 .. image:: _static/mapfish_swissrivers.png 372 373 .. _mapfish_client_geoext: 374 375 GeoExt 376 ^^^^^^ 377 378 GeoExt is a JavaScript library providing the groundwork for creating web-mapping applications based on OpenLayers and ExtJS. 379 380 Have a look at the `GeoExt examples <http://dev.geoext.org/trunk/geoext/examples/>`_ to see the power of this library. 381 382 .. note:: 383 384 In order to play with GeoExt, it is needed to reference the OpenLayers, ExtJS and GeoExt library. 385 386 For GeoExt, simply add the following code in the html page: 387 388 <script src="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js"></script> 389 390 GeoExt.MapPanel 391 ::::::::::::::: 392 393 A GeoExt MapPanel is an OpenLayers map integrated into an ExtJS Panel. 394 395 To test: :download:`geoext_mappanel.html <_static/geoext_mappanel.html>` 396 397 .. raw:: html 398 399 <a id="showRef6" href="javascript:showdiv('codeBlock6','showRef6','hideRef6')">Show code</a> 400 <a id="hideRef6" href="javascript:hidediv('codeBlock6','showRef6','hideRef6')" style="display: none; visibility: hidden">Hide code</a> 401 <div id="codeBlock6" style="display: none; visibility: hidden"> 402 403 .. code-block:: html 404 405 <html> 406 <head> 407 408 <title>GeoExt Map Panel</title> 409 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script> 410 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script> 411 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"/> 412 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css"/> 413 414 <script src="http://www.openlayers.org/api/2.10/OpenLayers.js"></script> 415 416 417 <script src="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js" type="text/javascript"></script> 418 419 <script type="text/javascript"> 420 Ext.onReady(function() { 421 var map = new OpenLayers.Map(); 422 var layer = new OpenLayers.Layer.WMS( 423 "Global Imagery", 424 "http://maps.opengeo.org/geowebcache/service/wms", 425 {layers: "bluemarble"} 426 ); 427 map.addLayer(layer); 428 429 new GeoExt.MapPanel({ 430 renderTo: 'gxmap', 431 height: 400, 432 width: 600, 433 map: map, 434 title: 'GeoExt Map Panel' 435 }); 436 }); 437 </script> 438 </head> 439 <body> 440 <div id="gxmap"></div> 441 </body> 442 </html> 443 444 .. raw:: html 445 446 </div> 447 448 GeoExt.Action 449 ::::::::::::: 450 451 GeoExt provides the GeoExt.Action class for adaptating a control to an object that can be inserted in a toolbar or in a menu. 452 453 To test: :download:`geoext_action.html <_static/geoext_action.html>` 454 455 .. raw:: html 456 457 <a id="showRef7" href="javascript:showdiv('codeBlock7','showRef7','hideRef7')">Show code</a> 458 <a id="hideRef7" href="javascript:hidediv('codeBlock7','showRef7','hideRef7')" style="display: none; visibility: hidden">Hide code</a> 459 <div id="codeBlock7" style="display: none; visibility: hidden"> 460 461 .. code-block:: html 462 463 <html> 464 <head> 465 <title>GeoExt Action</title> 466 467 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script> 468 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script> 469 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"/> 470 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css"/> 471 472 <script src="http://www.openlayers.org/api/2.10/OpenLayers.js"></script> 473 474 475 <script type="text/javascript" src="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js"></script> 476 477 <script type="text/javascript"> 478 Ext.onReady(function() { 479 var map = new OpenLayers.Map(); 480 var wms = new OpenLayers.Layer.WMS( 481 "Global Imagery", 482 "http://maps.opengeo.org/geowebcache/service/wms", 483 {layers: "bluemarble"} 484 ); 485 var vector = new OpenLayers.Layer.Vector("vector"); 486 map.addLayers([wms, vector]); 487 488 var ctrl, toolbarItems = [], action, actions = {}; 489 490 // ZoomToMaxExtent control, a "button" control 491 action = new GeoExt.Action({ 492 control: new OpenLayers.Control.ZoomToMaxExtent(), 493 map: map, 494 text: "max extent" 495 }); 496 actions["max_extent"] = action; 497 toolbarItems.push(action); 498 toolbarItems.push("-"); 499 500 // Navigation control and DrawFeature controls 501 // in the same toggle group 502 action = new GeoExt.Action({ 503 text: "nav", 504 control: new OpenLayers.Control.Navigation(), 505 map: map, 506 // button options 507 toggleGroup: "draw", 508 allowDepress: false, 509 pressed: true, 510 // check item options 511 group: "draw", 512 checked: true 513 }); 514 actions["nav"] = action; 515 toolbarItems.push(action); 516 517 action = new GeoExt.Action({ 518 text: "draw poly", 519 control: new OpenLayers.Control.DrawFeature( 520 vector, OpenLayers.Handler.Polygon 521 ), 522 map: map, 523 // button options 524 toggleGroup: "draw", 525 allowDepress: false, 526 // check item options 527 group: "draw" 528 }); 529 actions["draw_poly"] = action; 530 toolbarItems.push(action); 531 532 action = new GeoExt.Action({ 533 text: "draw line", 534 control: new OpenLayers.Control.DrawFeature( 535 vector, OpenLayers.Handler.Path 536 ), 537 map: map, 538 // button options 539 toggleGroup: "draw", 540 allowDepress: false, 541 // check item options 542 group: "draw" 543 }); 544 actions["draw_line"] = action; 545 toolbarItems.push(action); 546 toolbarItems.push("-"); 547 548 // SelectFeature control, a "toggle" control 549 action = new GeoExt.Action({ 550 text: "select", 551 control: new OpenLayers.Control.SelectFeature(vector, { 552 type: OpenLayers.Control.TYPE_TOGGLE, 553 hover: true 554 }), 555 map: map, 556 // button options 557 enableToggle: true 558 }); 559 actions["select"] = action; 560 toolbarItems.push(action); 561 toolbarItems.push("-"); 562 563 // Navigation history - two "button" controls 564 ctrl = new OpenLayers.Control.NavigationHistory(); 565 map.addControl(ctrl); 566 567 action = new GeoExt.Action({ 568 text: "previous", 569 control: ctrl.previous, 570 disabled: true 571 }); 572 actions["previous"] = action; 573 toolbarItems.push(action); 574 575 action = new GeoExt.Action({ 576 text: "next", 577 control: ctrl.next, 578 disabled: true 579 }); 580 actions["next"] = action; 581 toolbarItems.push(action); 582 toolbarItems.push("->"); 583 584 // Reuse the GeoExt.Action objects created above 585 // as menu items 586 toolbarItems.push({ 587 text: "menu", 588 menu: new Ext.menu.Menu({ 589 items: [ 590 // ZoomToMaxExtent 591 actions["max_extent"], 592 // Nav 593 new Ext.menu.CheckItem(actions["nav"]), 594 // Draw poly 595 new Ext.menu.CheckItem(actions["draw_poly"]), 596 // Draw line 597 new Ext.menu.CheckItem(actions["draw_line"]), 598 // Select control 599 new Ext.menu.CheckItem(actions["select"]), 600 // Navigation history control 601 actions["previous"], 602 actions["next"] 603 ] 604 }) 605 }); 606 607 var mapPanel = new GeoExt.MapPanel({ 608 renderTo: "mappanel", 609 height: 400, 610 width: 600, 611 map: map, 612 center: new OpenLayers.LonLat(5, 45), 613 zoom: 4, 614 tbar: toolbarItems 615 }); 616 }); 617 </script> 618 619 <style type="text/css"> 620 /* work around an Ext bug that makes the rendering 621 of menu items not as one would expect */ 622 .ext-ie .x-menu-item-icon { 623 left: -24px; 624 } 625 626 .ext-strict .x-menu-item-icon { 627 left: 3px; 628 } 629 630 .ext-ie6 .x-menu-item-icon { 631 left: -24px; 632 } 633 634 .ext-ie7 .x-menu-item-icon { 635 left: -24px; 636 } 637 </style> 638 </head> 639 <body> 640 <div id="mappanel"></div> 641 </body> 642 643 </html> 644 645 .. raw:: html 646 647 </div> -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/build/html/_sources/mapfish.txt
r3670 r3671 1 1 MapFish 2 2 ******* 3 4 This part of the workshop is adapted from the `workshop <http://dev.mapfish.org/sandbox/camptocamp/mapfish_workshop_fossgis2010/printing_src/_build/html/>`_ workshop provided by Eric Lemoine and François Van der Biest at Foss4G 2010 in Barcelona. 5 6 Contents: 7 8 .. toctree:: 9 :maxdepth: 2 10 11 getting_started 12 -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/build/html/index.html
r3670 r3671 51 51 <ul> 52 52 <li class="toctree-l1"><a class="reference internal" href="agenda.html">Agenda</a></li> 53 <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li> 54 <li class="toctree-l1"><a class="reference internal" href="mapfish.html">MapFish</a></li> 53 <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul> 54 <li class="toctree-l2"><a class="reference internal" href="introduction.html#computer-setup">Computer Setup</a></li> 55 <li class="toctree-l2"><a class="reference internal" href="introduction.html#mapfish-framework">MapFish Framework</a></li> 56 <li class="toctree-l2"><a class="reference internal" href="introduction.html#mapfish-examples">MapFish Examples</a></li> 57 </ul> 58 </li> 59 <li class="toctree-l1"><a class="reference internal" href="mapfish.html">MapFish</a><ul> 60 <li class="toctree-l2"><a class="reference internal" href="getting_started.html">Module 1 - Getting Started</a></li> 61 </ul> 62 </li> 55 63 <li class="toctree-l1"><a class="reference internal" href="geoext.html">GeoExt</a></li> 56 64 <li class="toctree-l1"><a class="reference internal" href="api.html">GeoAdmin API</a></li> -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/build/html/introduction.html
r3670 r3671 24 24 <script type="text/javascript" src="_static/doctools.js"></script> 25 25 <link rel="top" title="2010 FHNW Training v1.0 documentation" href="index.html" /> 26 <link rel="next" title=" <no title>" href="mapfish.html" />27 <link rel="prev" title=" Training agenda" href="agenda.html" />26 <link rel="next" title="MapFish" href="mapfish.html" /> 27 <link rel="prev" title="Agenda" href="agenda.html" /> 28 28 </head> 29 29 <body> … … 35 35 accesskey="I">index</a></li> 36 36 <li class="right" > 37 <a href="mapfish.html" title=" <no title>"37 <a href="mapfish.html" title="MapFish" 38 38 accesskey="N">next</a> |</li> 39 39 <li class="right" > 40 <a href="agenda.html" title=" Training agenda"40 <a href="agenda.html" title="Agenda" 41 41 accesskey="P">previous</a> |</li> 42 42 <li><a href="index.html">2010 FHNW Training v1.0 documentation</a> »</li> … … 51 51 <div class="section" id="introduction"> 52 52 <h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1> 53 <script language=javascript type='text/javascript'> 54 55 function hidediv(div, showDiv, hideDiv) { 56 document.getElementById(div).style.visibility = 'hidden'; 57 document.getElementById(div).style.display = 'none'; 58 document.getElementById(hideDiv).style.visibility = 'hidden'; 59 document.getElementById(hideDiv).style.display = 'none'; 60 document.getElementById(showDiv).style.visibility = 'visible'; 61 document.getElementById(showDiv).style.display = 'block'; 62 } 63 64 function showdiv(div, showDiv, hideDiv) { 65 document.getElementById(div).style.visibility = 'visible'; 66 document.getElementById(div).style.display = 'block'; 67 document.getElementById(showDiv).style.visibility = 'hidden'; 68 document.getElementById(showDiv).style.display = 'none'; 69 document.getElementById(hideDiv).style.visibility = 'visible'; 70 document.getElementById(hideDiv).style.display = 'block'; 71 } 72 </script><div class="section" id="computer-setup"> 73 <h2>Computer Setup<a class="headerlink" href="#computer-setup" title="Permalink to this headline">¶</a></h2> 74 <p>Several pieces of software have been installed on your computer:</p> 75 <blockquote> 76 <ul class="simple"> 77 <li>PostGres / PostGIS</li> 78 <li>Ultraedit</li> 79 <li><a class="reference external" href="http://www.python.org/download/releases/2.5.4/">Python 2.5</a></li> 80 <li><a class="reference external" href="http://sourceforge.net/projects/pywin32/">Python for Windows extensions</a></li> 81 </ul> 82 </blockquote> 83 </div> 84 <div class="section" id="mapfish-framework"> 85 <h2>MapFish Framework<a class="headerlink" href="#mapfish-framework" title="Permalink to this headline">¶</a></h2> 86 <div class="section" id="what-is-a-framework"> 87 <h3>What is a framework ?<a class="headerlink" href="#what-is-a-framework" title="Permalink to this headline">¶</a></h3> 88 <p>MapFish is a flexible and complete framework for building rich web-mapping 89 applications. It emphasizes high productivity, and high-quality development. 90 But, what is a framework ? From <a class="reference external" href="http://en.wikipedia.org/wiki/Framework">wikipedia</a> : 91 “A framework is a basic conceptual structure used to solve or address complex issues.”. 92 The framework aims to alleviate the overhead associated with common activities performed in Web mapping development.</p> 93 <p>In that sense, MapFish Framework provides the technology for building web mapping applications. 94 With client technologies, the developer can create user interfaces and with server technologies, it is possible to develop the necessary web services.</p> 95 <p>On the client side, JavaScript libraries are mainly used, on the server side, several languages can be used. 96 Originally, Python components were used, but with the time, Java, Ruby and PHP components have also been developped. 97 This shows the flexibility and openness of the framework.</p> 98 <div class="admonition note"> 99 <p class="first admonition-title">Note</p> 100 <p class="last">MapFish is cartographic server agnostic. It can be used with <a class="reference external" href="http://www.mapserver.org">MapServer</a>, <a class="reference external" href="http://www.geoserver.org">GeoServer</a>, <a class="reference external" href="http://www.mapguide.org">MapGuide</a> 101 or whatever cartographic server that is able to communicate with open protocols like WMS or WFS.</p> 102 </div> 103 <div class="section" id="components-of-mapfish-framework"> 104 <h4>Components of MapFish framework<a class="headerlink" href="#components-of-mapfish-framework" title="Permalink to this headline">¶</a></h4> 105 <p>Several Open Source technologies are used in MapFish Framework.</p> 106 <p>Client side:</p> 107 <blockquote> 108 <ul class="simple"> 109 <li><a class="reference external" href="http://www.geoext.org">GeoExt</a>: GeoExt is a JavaScript library providing the groundwork for creating web-mapping applications based on OpenLayers and ExtJS.</li> 110 <li><a class="reference external" href="http://www.openlayers.org">OpenLayers</a>: OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source.</li> 111 <li><a class="reference external" href="http://extjs.com/">ExtJS</a>: Ext JS is a cross-browser JavaScript library for building rich internet applications.</li> 112 </ul> 113 </blockquote> 114 <p>Server side:</p> 115 <blockquote> 116 <ul class="simple"> 117 <li><a class="reference external" href="http://pypi.python.org/pypi/Shapely">Shapely</a>: Shapely is a Python package for manipulation and analysis of 2D geospatial geometries.</li> 118 <li><a class="reference external" href="http://www.sqlalchemy.org/">SqlAlchemy</a>: SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.</li> 119 <li><a class="reference external" href="http://www.geoalchemy.org/">GeoAlchemy</a>: GeoAlchemy is an extension of SQLAlchemy allowing the access to Oracle Spatial, PostGis and MySQL.</li> 120 <li><a class="reference external" href="http://pylonshq.com/">Pylons</a>: Pylons is a lightweight web framework emphasizing flexibility and rapid development.</li> 121 </ul> 122 </blockquote> 123 </div> 124 </div> 125 </div> 126 <div class="section" id="mapfish-examples"> 127 <h2>MapFish Examples<a class="headerlink" href="#mapfish-examples" title="Permalink to this headline">¶</a></h2> 128 <div class="section" id="mapfish-javascript-toolbox"> 129 <h3>MapFish JavaScript Toolbox<a class="headerlink" href="#mapfish-javascript-toolbox" title="Permalink to this headline">¶</a></h3> 130 <p>MapFish JavaScript Toolbox is composed of three JavaScript libraries: ExtJS, OpenLayers and GeoExt. The functionality of all these libraries will be highlighted with some example code.</p> 131 </div> 132 <div class="section" id="mapfish-client-extjs"> 133 <span id="id1"></span><h3>ExtJS<a class="headerlink" href="#mapfish-client-extjs" title="Permalink to this headline">¶</a></h3> 134 <p>Ext JS is a cross-browser JavaScript library for building rich internet applications. It provides a <a class="reference external" href="http://www.extjs.com/deploy/dev/examples/samples.html">very large list of UI components</a>.</p> 135 <div class="admonition note"> 136 <p class="first admonition-title">Note</p> 137 <p>In order to play with ExtJS, it is needed to reference the ExtJS library and the associated css. For simplicity, we have prepared an accessible build with <a class="reference external" href="http://extjs.com/products/extjs/build/index.php">CacheFly</a>.</p> 138 <p>Then, simply add the following code in the html page:</p> 139 <p><script type=”text/javascript” src=”<a class="reference external" href="http://extjs.cachefly.net/builds/ext-cdn-771.js">http://extjs.cachefly.net/builds/ext-cdn-771.js</a>“></script></p> 140 <p class="last"><link rel=”stylesheet” type=”text/css” href=”<a class="reference external" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css">http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css</a>” /></p> 141 </div> 142 <div class="section" id="ext-hello-world"> 143 <h4>Ext “Hello World”<a class="headerlink" href="#ext-hello-world" title="Permalink to this headline">¶</a></h4> 144 <p>Create your own html page with the following code <a class="reference download internal" href="_downloads/extjs_hello_world.html"><tt class="xref download docutils literal"><span class="pre">extjs_hello_world.html</span></tt></a>. 145 If you open it in a browser, you should get a message “Hello World! You have ExtJS configured correctly!”</p> 146 <a id="showRef2" href="javascript:showdiv('codeBlock2','showRef2','hideRef2')">Show code</a> 147 <a id="hideRef2" href="javascript:hidediv('codeBlock2','showRef2','hideRef2')" style="display: none; visibility: hidden">Hide code</a> 148 <div id="codeBlock2" style="display: none; visibility: hidden"><div class="highlight-html"><div class="highlight"><pre><span class="nt"><html></span> 149 <span class="nt"><head></span> 150 <span class="nt"><meta</span> <span class="na">http-equiv=</span><span class="s">"Content-Type"</span> <span class="na">content=</span><span class="s">"text/html; charset=iso-8859-1"</span> <span class="nt">/></span> 151 <span class="nt"><title</span> <span class="na">id=</span><span class="s">'title'</span><span class="nt">></span>ExtJS Hello World<span class="nt"></title></span> 152 153 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://extjs.cachefly.net/builds/ext-cdn-771.js"</span><span class="nt">></script></span> 154 <span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">href=</span><span class="s">"http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"</span> <span class="nt">/></span> 155 156 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></span> 157 <span class="nx">Ext</span><span class="p">.</span><span class="nx">onReady</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> 158 <span class="nx">alert</span><span class="p">(</span><span class="s2">"Hello World! You have ExtJS configured correctly!"</span><span class="p">);</span> 159 <span class="p">});</span> <span class="c1">//end onReady</span> 160 <span class="nt"></script></span> 161 162 <span class="nt"></head></span> 163 <span class="nt"><body></span> 164 <span class="nt"></body></span> 165 <span class="nt"></html></span> 166 </pre></div> 167 </div> 168 </div></div> 169 <div class="section" id="ext-viewport"> 170 <h4>Ext.Viewport<a class="headerlink" href="#ext-viewport" title="Permalink to this headline">¶</a></h4> 171 <p>The Viewport renders itself to the document body, and automatically sizes itself to the size of the browser viewport and manages window resizing. There may only be one Viewport created in a page. Let’s have a look at the configuration of a <a class="reference external" href="http://www.extjs.com/deploy/dev/docs/?class=Ext.Viewport">viewport</a>:</p> 172 <p>To test: <a class="reference download internal" href="_downloads/extjs_viewport.html"><tt class="xref download docutils literal"><span class="pre">extjs_viewport.html</span></tt></a></p> 173 <a id="showRef3" href="javascript:showdiv('codeBlock3','showRef3','hideRef3')">Show code</a> 174 <a id="hideRef3" href="javascript:hidediv('codeBlock3','showRef3','hideRef3')" style="display: none; visibility: hidden">Hide code</a> 175 <div id="codeBlock3" style="display: none; visibility: hidden"><div class="highlight-html"><div class="highlight"><pre><span class="nt"><html></span> 176 <span class="nt"><head></span> 177 <span class="nt"><meta</span> <span class="na">http-equiv=</span><span class="s">"Content-Type"</span> <span class="na">content=</span><span class="s">"text/html; charset=iso-8859-1"</span><span class="nt">/></span> 178 <span class="nt"><title</span> <span class="na">id=</span><span class="s">'title'</span><span class="nt">></span>ExtJS Viewport<span class="nt"></title></span> 179 180 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://extjs.cachefly.net/builds/ext-cdn-771.js"</span><span class="nt">></script></span> 181 <span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">href=</span><span class="s">"http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"</span><span class="nt">/></span> 182 183 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></span> 184 <span class="nx">Ext</span><span class="p">.</span><span class="nx">onReady</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> 185 <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">Viewport</span><span class="p">({</span> 186 <span class="nx">layout</span><span class="o">:</span> <span class="s1">'border'</span><span class="p">,</span> 187 <span class="nx">items</span><span class="o">:</span> <span class="p">[</span> 188 <span class="p">{</span> 189 <span class="nx">region</span><span class="o">:</span> <span class="s1">'north'</span><span class="p">,</span> 190 <span class="nx">html</span><span class="o">:</span> <span class="s1">'<h1 class="x-panel-header">Page Title</h1>'</span><span class="p">,</span> 191 <span class="nx">autoHeight</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 192 <span class="nx">border</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> 193 <span class="nx">margins</span><span class="o">:</span> <span class="s1">'0 0 5 0'</span> 194 <span class="p">},</span> 195 <span class="p">{</span> 196 <span class="nx">region</span><span class="o">:</span> <span class="s1">'west'</span><span class="p">,</span> 197 <span class="nx">collapsible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 198 <span class="nx">title</span><span class="o">:</span> <span class="s1">'Navigation'</span><span class="p">,</span> 199 <span class="nx">xtype</span><span class="o">:</span> <span class="s1">'treepanel'</span><span class="p">,</span> 200 <span class="nx">width</span><span class="o">:</span> <span class="mi">200</span><span class="p">,</span> 201 <span class="nx">autoScroll</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 202 <span class="nx">split</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 203 <span class="nx">loader</span><span class="o">:</span> <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">TreeLoader</span><span class="p">(),</span> 204 <span class="nx">root</span><span class="o">:</span> <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">AsyncTreeNode</span><span class="p">({</span> 205 <span class="nx">expanded</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 206 <span class="nx">children</span><span class="o">:</span> <span class="p">[</span> 207 <span class="p">{</span> 208 <span class="nx">text</span><span class="o">:</span> <span class="s1">'Menu Option 1'</span><span class="p">,</span> 209 <span class="nx">leaf</span><span class="o">:</span> <span class="kc">true</span> 210 <span class="p">},</span> 211 <span class="p">{</span> 212 <span class="nx">text</span><span class="o">:</span> <span class="s1">'Menu Option 2'</span><span class="p">,</span> 213 <span class="nx">leaf</span><span class="o">:</span> <span class="kc">true</span> 214 <span class="p">},</span> 215 <span class="p">{</span> 216 <span class="nx">text</span><span class="o">:</span> <span class="s1">'Menu Option 3'</span><span class="p">,</span> 217 <span class="nx">leaf</span><span class="o">:</span> <span class="kc">true</span> 218 <span class="p">}</span> 219 <span class="p">]</span> 220 <span class="p">}),</span> 221 <span class="nx">rootVisible</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> 222 <span class="nx">listeners</span><span class="o">:</span> <span class="p">{</span> 223 <span class="nx">click</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span> <span class="p">{</span> 224 <span class="nx">Ext</span><span class="p">.</span><span class="nx">Msg</span><span class="p">.</span><span class="nx">alert</span><span class="p">(</span><span class="s1">'Navigation Tree Click'</span><span class="p">,</span> <span class="s1">'You clicked: "'</span> <span class="o">+</span> <span class="nx">n</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">text</span> <span class="o">+</span> <span class="s1">'"'</span><span class="p">);</span> 225 <span class="p">}</span> 226 <span class="p">}</span> 227 <span class="p">},</span> 228 <span class="p">{</span> 229 <span class="nx">region</span><span class="o">:</span> <span class="s1">'center'</span><span class="p">,</span> 230 <span class="nx">xtype</span><span class="o">:</span> <span class="s1">'tabpanel'</span><span class="p">,</span> 231 <span class="nx">items</span><span class="o">:</span> <span class="p">{</span> 232 <span class="nx">title</span><span class="o">:</span> <span class="s1">'Default Tab'</span><span class="p">,</span> 233 <span class="nx">html</span><span class="o">:</span> <span class="s1">'The first tab\'s content. Others may be added dynamically'</span> 234 <span class="p">}</span> 235 <span class="p">},</span> 236 <span class="p">{</span> 237 <span class="nx">region</span><span class="o">:</span> <span class="s1">'south'</span><span class="p">,</span> 238 <span class="nx">title</span><span class="o">:</span> <span class="s1">'Information'</span><span class="p">,</span> 239 <span class="nx">collapsible</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 240 <span class="nx">html</span><span class="o">:</span> <span class="s1">'Information goes here'</span><span class="p">,</span> 241 <span class="nx">split</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 242 <span class="nx">height</span><span class="o">:</span> <span class="mi">100</span><span class="p">,</span> 243 <span class="nx">minHeight</span><span class="o">:</span> <span class="mi">100</span> 244 <span class="p">}</span> 245 <span class="p">]</span> 246 <span class="p">});</span> 247 <span class="p">});</span> <span class="c1">//end onReady</span> 248 <span class="nt"></script></span> 249 250 <span class="nt"></head></span> 251 <span class="nt"><body></span> 252 <span class="nt"></body></span> 253 <span class="nt"></html></span> 254 </pre></div> 255 </div> 256 </div></div> 257 <div class="section" id="ext-grid-gridpanel"> 258 <h4>Ext.grid.GridPanel<a class="headerlink" href="#ext-grid-gridpanel" title="Permalink to this headline">¶</a></h4> 259 <p><a class="reference external" href="http://map.globe.admin.ch">Globe application</a> uses a <a class="reference external" href="http://extjs.com/deploy/dev/docs/?class=Ext.grid.GridPanel">grid panel</a>:</p> 260 <blockquote> 261 <img alt="_images/mapfish_globe.png" src="_images/mapfish_globe.png" /> 262 </blockquote> 263 </div> 264 </div> 265 <div class="section" id="mapfish-client-openlayers"> 266 <span id="id2"></span><h3>OpenLayers<a class="headerlink" href="#mapfish-client-openlayers" title="Permalink to this headline">¶</a></h3> 267 <p>OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source.</p> 268 <p>Have a look at the <a class="reference external" href="http://openlayers.org/dev/examples/">OpenLayers examples</a> to see the power of this library.</p> 269 <div class="admonition note"> 270 <p class="first admonition-title">Note</p> 271 <p>In order to play with OpenLayers, it is needed to reference the OpenLayers library.</p> 272 <p>Simply add the following code in the html page:</p> 273 <p class="last"><script src=”<a class="reference external" href="http://www.openlayers.org/api/OpenLayers.js">http://www.openlayers.org/api/OpenLayers.js</a>“></script></p> 274 </div> 275 <div class="section" id="map"> 276 <h4>Map<a class="headerlink" href="#map" title="Permalink to this headline">¶</a></h4> 277 <p>Instances of <a class="reference external" href="http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Map-js.html">OpenLayers.Map</a> are interactive maps embedded in a web page.</p> 278 <p>To test: <a class="reference download internal" href="_downloads/openlayers_map.html"><tt class="xref download docutils literal"><span class="pre">openlayers_map.html</span></tt></a></p> 279 <a id="showRef4" href="javascript:showdiv('codeBlock4','showRef4','hideRef4')">Show code</a> 280 <a id="hideRef4" href="javascript:hidediv('codeBlock4','showRef4','hideRef4')" style="display: none; visibility: hidden">Hide code</a> 281 <div id="codeBlock4" style="display: none; visibility: hidden"><div class="highlight-html"><div class="highlight"><pre><span class="nt"><html></span> 282 <span class="nt"><head></span> 283 <span class="nt"><title></span>OpenLayers Map<span class="nt"></title></span> 284 285 <span class="nt"><script </span><span class="na">src=</span><span class="s">"http://www.openlayers.org/api/OpenLayers.js"</span><span class="nt">></script></span> 286 287 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></span> 288 <span class="kd">var</span> <span class="nx">map</span><span class="p">,</span> <span class="nx">layer</span><span class="p">;</span> 289 <span class="kd">function</span> <span class="nx">init</span><span class="p">()</span> <span class="p">{</span> 290 <span class="nx">map</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Map</span><span class="p">(</span><span class="s1">'map'</span><span class="p">);</span> 291 <span class="nx">layer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span><span class="s2">"OpenLayers WMS"</span><span class="p">,</span> 292 <span class="s2">"http://labs.metacarta.com/wms/vmap0"</span><span class="p">,</span> 293 <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s1">'basic'</span><span class="p">}</span> 294 <span class="p">);</span> 295 <span class="nx">map</span><span class="p">.</span><span class="nx">addLayer</span><span class="p">(</span><span class="nx">layer</span><span class="p">);</span> 296 <span class="nx">map</span><span class="p">.</span><span class="nx">zoomToMaxExtent</span><span class="p">();</span> 297 <span class="p">}</span> 298 <span class="nt"></script></span> 299 <span class="nt"></head></span> 300 301 <span class="nt"><body</span> <span class="na">onload=</span><span class="s">"init()"</span><span class="nt">></span> 302 303 <span class="nt"><div</span> <span class="na">id=</span><span class="s">"map"</span><span class="nt">></div></span> 304 305 <span class="nt"></body></span> 306 <span class="nt"></html></span> 307 </pre></div> 308 </div> 309 </div></div> 310 <div class="section" id="editing-toolbar"> 311 <h4>Editing Toolbar<a class="headerlink" href="#editing-toolbar" title="Permalink to this headline">¶</a></h4> 312 <p><a class="reference external" href="http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/_staticOpenLayers/Control/EditingToolbar-js.html">Editing Toolbar</a></p> 313 <p>To test: <a class="reference download internal" href="_downloads/openlayers_editing_toolbar.html"><tt class="xref download docutils literal"><span class="pre">openlayers_editing_toolbar.html</span></tt></a></p> 314 <a id="showRef5" href="javascript:showdiv('codeBlock5','showRef5','hideRef5')">Show code</a> 315 <a id="hideRef5" href="javascript:hidediv('codeBlock5','showRef5','hideRef5')" style="display: none; visibility: hidden">Hide code</a> 316 <div id="codeBlock5" style="display: none; visibility: hidden"><div class="highlight-html"><div class="highlight"><pre><span class="nt"><html</span> <span class="na">xmlns=</span><span class="s">"http://www.w3.org/1999/xhtml"</span><span class="nt">></span> 317 <span class="nt"><head></span> 318 <span class="nt"><title></span>OpenLayers Editing Toolbar <span class="nt"></title></span> 319 320 <span class="nt"><script </span><span class="na">src=</span><span class="s">"http://www.openlayers.org/api/OpenLayers.js"</span><span class="nt">></script></span> 321 322 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></span> 323 <span class="kd">var</span> <span class="nx">lon</span> <span class="o">=</span> <span class="mi">5</span><span class="p">;</span> 324 <span class="kd">var</span> <span class="nx">lat</span> <span class="o">=</span> <span class="mi">40</span><span class="p">;</span> 325 <span class="kd">var</span> <span class="nx">zoom</span> <span class="o">=</span> <span class="mi">5</span><span class="p">;</span> 326 <span class="kd">var</span> <span class="nx">map</span><span class="p">,</span> <span class="nx">layer</span><span class="p">;</span> 327 328 <span class="kd">function</span> <span class="nx">init</span><span class="p">()</span> <span class="p">{</span> 329 <span class="nx">layer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span><span class="s2">"OpenLayers WMS"</span><span class="p">,</span> 330 <span class="s2">"http://labs.metacarta.com/wms/vmap0"</span><span class="p">,</span> 331 <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s1">'basic'</span><span class="p">}</span> 332 <span class="p">);</span> 333 334 <span class="nx">vlayer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">Vector</span><span class="p">(</span><span class="s2">"Editable"</span><span class="p">);</span> 335 <span class="nx">map</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Map</span><span class="p">(</span><span class="s1">'map'</span><span class="p">,</span> <span class="p">{</span> 336 <span class="nx">controls</span><span class="o">:</span> <span class="p">[</span> 337 <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">PanZoom</span><span class="p">(),</span> 338 <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">EditingToolbar</span><span class="p">(</span><span class="nx">vlayer</span><span class="p">)</span> 339 <span class="p">]</span> 340 <span class="p">});</span> 341 <span class="nx">map</span><span class="p">.</span><span class="nx">addLayers</span><span class="p">([</span><span class="nx">layer</span><span class="p">,</span> <span class="nx">vlayer</span><span class="p">]);</span> 342 343 <span class="nx">map</span><span class="p">.</span><span class="nx">setCenter</span><span class="p">(</span><span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">LonLat</span><span class="p">(</span><span class="nx">lon</span><span class="p">,</span> <span class="nx">lat</span><span class="p">),</span> <span class="nx">zoom</span><span class="p">);</span> 344 <span class="p">}</span> 345 <span class="nt"></script></span> 346 <span class="nt"></head></span> 347 <span class="nt"><body</span> <span class="na">onload=</span><span class="s">"init()"</span><span class="nt">></span> 348 <span class="nt"><div</span> <span class="na">id=</span><span class="s">"map"</span><span class="nt">></div></span> 349 <span class="nt"></body></span> 350 <span class="nt"></html></span> 351 </pre></div> 352 </div> 353 </div></div> 354 <div class="section" id="popup"> 355 <h4>Popup<a class="headerlink" href="#popup" title="Permalink to this headline">¶</a></h4> 356 <p><a class="reference external" href="http://www.swissrivers.ch">Swissrivers.ch application</a> uses <a class="reference external" href="http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Popup-js.html">OpenLayers popups</a> to present hydrogramms.</p> 357 <blockquote> 358 <img alt="_images/mapfish_swissrivers.png" src="_images/mapfish_swissrivers.png" /> 359 </blockquote> 360 </div> 361 </div> 362 <div class="section" id="mapfish-client-geoext"> 363 <span id="id4"></span><h3>GeoExt<a class="headerlink" href="#mapfish-client-geoext" title="Permalink to this headline">¶</a></h3> 364 <p>GeoExt is a JavaScript library providing the groundwork for creating web-mapping applications based on OpenLayers and ExtJS.</p> 365 <p>Have a look at the <a class="reference external" href="http://dev.geoext.org/trunk/geoext/examples/">GeoExt examples</a> to see the power of this library.</p> 366 <div class="admonition note"> 367 <p class="first admonition-title">Note</p> 368 <p>In order to play with GeoExt, it is needed to reference the OpenLayers, ExtJS and GeoExt library.</p> 369 <p>For GeoExt, simply add the following code in the html page:</p> 370 <p class="last"><script src=”<a class="reference external" href="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js">http://dev.geoext.org/trunk/geoext/lib/GeoExt.js</a>“></script></p> 371 </div> 372 <div class="section" id="geoext-mappanel"> 373 <h4>GeoExt.MapPanel<a class="headerlink" href="#geoext-mappanel" title="Permalink to this headline">¶</a></h4> 374 <p>A GeoExt MapPanel is an OpenLayers map integrated into an ExtJS Panel.</p> 375 <p>To test: <a class="reference download internal" href="_downloads/geoext_mappanel.html"><tt class="xref download docutils literal"><span class="pre">geoext_mappanel.html</span></tt></a></p> 376 <a id="showRef6" href="javascript:showdiv('codeBlock6','showRef6','hideRef6')">Show code</a> 377 <a id="hideRef6" href="javascript:hidediv('codeBlock6','showRef6','hideRef6')" style="display: none; visibility: hidden">Hide code</a> 378 <div id="codeBlock6" style="display: none; visibility: hidden"><div class="highlight-html"><div class="highlight"><pre><span class="nt"><html></span> 379 <span class="nt"><head></span> 380 381 <span class="nt"><title></span>GeoExt Map Panel<span class="nt"></title></span> 382 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"</span><span class="nt">></script></span> 383 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/ext-all.js"</span><span class="nt">></script></span> 384 <span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">href=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"</span><span class="nt">/></span> 385 <span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">href=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css"</span><span class="nt">/></span> 386 387 <span class="nt"><script </span><span class="na">src=</span><span class="s">"http://www.openlayers.org/api/2.10/OpenLayers.js"</span><span class="nt">></script></span> 388 389 390 <span class="nt"><script </span><span class="na">src=</span><span class="s">"http://dev.geoext.org/trunk/geoext/lib/GeoExt.js"</span> <span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></script></span> 391 392 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></span> 393 <span class="nx">Ext</span><span class="p">.</span><span class="nx">onReady</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> 394 <span class="kd">var</span> <span class="nx">map</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Map</span><span class="p">();</span> 395 <span class="kd">var</span> <span class="nx">layer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span> 396 <span class="s2">"Global Imagery"</span><span class="p">,</span> 397 <span class="s2">"http://maps.opengeo.org/geowebcache/service/wms"</span><span class="p">,</span> 398 <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s2">"bluemarble"</span><span class="p">}</span> 399 <span class="p">);</span> 400 <span class="nx">map</span><span class="p">.</span><span class="nx">addLayer</span><span class="p">(</span><span class="nx">layer</span><span class="p">);</span> 401 402 <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">MapPanel</span><span class="p">({</span> 403 <span class="nx">renderTo</span><span class="o">:</span> <span class="s1">'gxmap'</span><span class="p">,</span> 404 <span class="nx">height</span><span class="o">:</span> <span class="mi">400</span><span class="p">,</span> 405 <span class="nx">width</span><span class="o">:</span> <span class="mi">600</span><span class="p">,</span> 406 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 407 <span class="nx">title</span><span class="o">:</span> <span class="s1">'GeoExt Map Panel'</span> 408 <span class="p">});</span> 409 <span class="p">});</span> 410 <span class="nt"></script></span> 411 <span class="nt"></head></span> 412 <span class="nt"><body></span> 413 <span class="nt"><div</span> <span class="na">id=</span><span class="s">"gxmap"</span><span class="nt">></div></span> 414 <span class="nt"></body></span> 415 <span class="nt"></html></span> 416 </pre></div> 417 </div> 418 </div></div> 419 <div class="section" id="geoext-action"> 420 <h4>GeoExt.Action<a class="headerlink" href="#geoext-action" title="Permalink to this headline">¶</a></h4> 421 <p>GeoExt provides the GeoExt.Action class for adaptating a control to an object that can be inserted in a toolbar or in a menu.</p> 422 <p>To test: <a class="reference download internal" href="_downloads/geoext_action.html"><tt class="xref download docutils literal"><span class="pre">geoext_action.html</span></tt></a></p> 423 <a id="showRef7" href="javascript:showdiv('codeBlock7','showRef7','hideRef7')">Show code</a> 424 <a id="hideRef7" href="javascript:hidediv('codeBlock7','showRef7','hideRef7')" style="display: none; visibility: hidden">Hide code</a> 425 <div id="codeBlock7" style="display: none; visibility: hidden"><div class="highlight-html"><div class="highlight"><pre><span class="nt"><html></span> 426 <span class="nt"><head></span> 427 <span class="nt"><title></span>GeoExt Action<span class="nt"></title></span> 428 429 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"</span><span class="nt">></script></span> 430 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/ext-all.js"</span><span class="nt">></script></span> 431 <span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">href=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"</span><span class="nt">/></span> 432 <span class="nt"><link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">href=</span><span class="s">"http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css"</span><span class="nt">/></span> 433 434 <span class="nt"><script </span><span class="na">src=</span><span class="s">"http://www.openlayers.org/api/2.10/OpenLayers.js"</span><span class="nt">></script></span> 435 436 437 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"http://dev.geoext.org/trunk/geoext/lib/GeoExt.js"</span><span class="nt">></script></span> 438 439 <span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span><span class="nt">></span> 440 <span class="nx">Ext</span><span class="p">.</span><span class="nx">onReady</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span> 441 <span class="kd">var</span> <span class="nx">map</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Map</span><span class="p">();</span> 442 <span class="kd">var</span> <span class="nx">wms</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">WMS</span><span class="p">(</span> 443 <span class="s2">"Global Imagery"</span><span class="p">,</span> 444 <span class="s2">"http://maps.opengeo.org/geowebcache/service/wms"</span><span class="p">,</span> 445 <span class="p">{</span><span class="nx">layers</span><span class="o">:</span> <span class="s2">"bluemarble"</span><span class="p">}</span> 446 <span class="p">);</span> 447 <span class="kd">var</span> <span class="nx">vector</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Layer</span><span class="p">.</span><span class="nx">Vector</span><span class="p">(</span><span class="s2">"vector"</span><span class="p">);</span> 448 <span class="nx">map</span><span class="p">.</span><span class="nx">addLayers</span><span class="p">([</span><span class="nx">wms</span><span class="p">,</span> <span class="nx">vector</span><span class="p">]);</span> 449 450 <span class="kd">var</span> <span class="nx">ctrl</span><span class="p">,</span> <span class="nx">toolbarItems</span> <span class="o">=</span> <span class="p">[],</span> <span class="nx">action</span><span class="p">,</span> <span class="nx">actions</span> <span class="o">=</span> <span class="p">{};</span> 451 452 <span class="c1">// ZoomToMaxExtent control, a "button" control</span> 453 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 454 <span class="nx">control</span><span class="o">:</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">ZoomToMaxExtent</span><span class="p">(),</span> 455 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 456 <span class="nx">text</span><span class="o">:</span> <span class="s2">"max extent"</span> 457 <span class="p">});</span> 458 <span class="nx">actions</span><span class="p">[</span><span class="s2">"max_extent"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 459 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 460 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s2">"-"</span><span class="p">);</span> 461 462 <span class="c1">// Navigation control and DrawFeature controls</span> 463 <span class="c1">// in the same toggle group</span> 464 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 465 <span class="nx">text</span><span class="o">:</span> <span class="s2">"nav"</span><span class="p">,</span> 466 <span class="nx">control</span><span class="o">:</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">Navigation</span><span class="p">(),</span> 467 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 468 <span class="c1">// button options</span> 469 <span class="nx">toggleGroup</span><span class="o">:</span> <span class="s2">"draw"</span><span class="p">,</span> 470 <span class="nx">allowDepress</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> 471 <span class="nx">pressed</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> 472 <span class="c1">// check item options</span> 473 <span class="nx">group</span><span class="o">:</span> <span class="s2">"draw"</span><span class="p">,</span> 474 <span class="nx">checked</span><span class="o">:</span> <span class="kc">true</span> 475 <span class="p">});</span> 476 <span class="nx">actions</span><span class="p">[</span><span class="s2">"nav"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 477 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 478 479 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 480 <span class="nx">text</span><span class="o">:</span> <span class="s2">"draw poly"</span><span class="p">,</span> 481 <span class="nx">control</span><span class="o">:</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">DrawFeature</span><span class="p">(</span> 482 <span class="nx">vector</span><span class="p">,</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Handler</span><span class="p">.</span><span class="nx">Polygon</span> 483 <span class="p">),</span> 484 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 485 <span class="c1">// button options</span> 486 <span class="nx">toggleGroup</span><span class="o">:</span> <span class="s2">"draw"</span><span class="p">,</span> 487 <span class="nx">allowDepress</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> 488 <span class="c1">// check item options</span> 489 <span class="nx">group</span><span class="o">:</span> <span class="s2">"draw"</span> 490 <span class="p">});</span> 491 <span class="nx">actions</span><span class="p">[</span><span class="s2">"draw_poly"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 492 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 493 494 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 495 <span class="nx">text</span><span class="o">:</span> <span class="s2">"draw line"</span><span class="p">,</span> 496 <span class="nx">control</span><span class="o">:</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">DrawFeature</span><span class="p">(</span> 497 <span class="nx">vector</span><span class="p">,</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Handler</span><span class="p">.</span><span class="nx">Path</span> 498 <span class="p">),</span> 499 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 500 <span class="c1">// button options</span> 501 <span class="nx">toggleGroup</span><span class="o">:</span> <span class="s2">"draw"</span><span class="p">,</span> 502 <span class="nx">allowDepress</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> 503 <span class="c1">// check item options</span> 504 <span class="nx">group</span><span class="o">:</span> <span class="s2">"draw"</span> 505 <span class="p">});</span> 506 <span class="nx">actions</span><span class="p">[</span><span class="s2">"draw_line"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 507 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 508 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s2">"-"</span><span class="p">);</span> 509 510 <span class="c1">// SelectFeature control, a "toggle" control</span> 511 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 512 <span class="nx">text</span><span class="o">:</span> <span class="s2">"select"</span><span class="p">,</span> 513 <span class="nx">control</span><span class="o">:</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">SelectFeature</span><span class="p">(</span><span class="nx">vector</span><span class="p">,</span> <span class="p">{</span> 514 <span class="nx">type</span><span class="o">:</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">TYPE_TOGGLE</span><span class="p">,</span> 515 <span class="nx">hover</span><span class="o">:</span> <span class="kc">true</span> 516 <span class="p">}),</span> 517 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 518 <span class="c1">// button options</span> 519 <span class="nx">enableToggle</span><span class="o">:</span> <span class="kc">true</span> 520 <span class="p">});</span> 521 <span class="nx">actions</span><span class="p">[</span><span class="s2">"select"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 522 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 523 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s2">"-"</span><span class="p">);</span> 524 525 <span class="c1">// Navigation history - two "button" controls</span> 526 <span class="nx">ctrl</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">Control</span><span class="p">.</span><span class="nx">NavigationHistory</span><span class="p">();</span> 527 <span class="nx">map</span><span class="p">.</span><span class="nx">addControl</span><span class="p">(</span><span class="nx">ctrl</span><span class="p">);</span> 528 529 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 530 <span class="nx">text</span><span class="o">:</span> <span class="s2">"previous"</span><span class="p">,</span> 531 <span class="nx">control</span><span class="o">:</span> <span class="nx">ctrl</span><span class="p">.</span><span class="nx">previous</span><span class="p">,</span> 532 <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> 533 <span class="p">});</span> 534 <span class="nx">actions</span><span class="p">[</span><span class="s2">"previous"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 535 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 536 537 <span class="nx">action</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">Action</span><span class="p">({</span> 538 <span class="nx">text</span><span class="o">:</span> <span class="s2">"next"</span><span class="p">,</span> 539 <span class="nx">control</span><span class="o">:</span> <span class="nx">ctrl</span><span class="p">.</span><span class="nx">next</span><span class="p">,</span> 540 <span class="nx">disabled</span><span class="o">:</span> <span class="kc">true</span> 541 <span class="p">});</span> 542 <span class="nx">actions</span><span class="p">[</span><span class="s2">"next"</span><span class="p">]</span> <span class="o">=</span> <span class="nx">action</span><span class="p">;</span> 543 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">action</span><span class="p">);</span> 544 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s2">"->"</span><span class="p">);</span> 545 546 <span class="c1">// Reuse the GeoExt.Action objects created above</span> 547 <span class="c1">// as menu items</span> 548 <span class="nx">toolbarItems</span><span class="p">.</span><span class="nx">push</span><span class="p">({</span> 549 <span class="nx">text</span><span class="o">:</span> <span class="s2">"menu"</span><span class="p">,</span> 550 <span class="nx">menu</span><span class="o">:</span> <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">Menu</span><span class="p">({</span> 551 <span class="nx">items</span><span class="o">:</span> <span class="p">[</span> 552 <span class="c1">// ZoomToMaxExtent</span> 553 <span class="nx">actions</span><span class="p">[</span><span class="s2">"max_extent"</span><span class="p">],</span> 554 <span class="c1">// Nav</span> 555 <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">CheckItem</span><span class="p">(</span><span class="nx">actions</span><span class="p">[</span><span class="s2">"nav"</span><span class="p">]),</span> 556 <span class="c1">// Draw poly</span> 557 <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">CheckItem</span><span class="p">(</span><span class="nx">actions</span><span class="p">[</span><span class="s2">"draw_poly"</span><span class="p">]),</span> 558 <span class="c1">// Draw line</span> 559 <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">CheckItem</span><span class="p">(</span><span class="nx">actions</span><span class="p">[</span><span class="s2">"draw_line"</span><span class="p">]),</span> 560 <span class="c1">// Select control</span> 561 <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">menu</span><span class="p">.</span><span class="nx">CheckItem</span><span class="p">(</span><span class="nx">actions</span><span class="p">[</span><span class="s2">"select"</span><span class="p">]),</span> 562 <span class="c1">// Navigation history control</span> 563 <span class="nx">actions</span><span class="p">[</span><span class="s2">"previous"</span><span class="p">],</span> 564 <span class="nx">actions</span><span class="p">[</span><span class="s2">"next"</span><span class="p">]</span> 565 <span class="p">]</span> 566 <span class="p">})</span> 567 <span class="p">});</span> 568 569 <span class="kd">var</span> <span class="nx">mapPanel</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">MapPanel</span><span class="p">({</span> 570 <span class="nx">renderTo</span><span class="o">:</span> <span class="s2">"mappanel"</span><span class="p">,</span> 571 <span class="nx">height</span><span class="o">:</span> <span class="mi">400</span><span class="p">,</span> 572 <span class="nx">width</span><span class="o">:</span> <span class="mi">600</span><span class="p">,</span> 573 <span class="nx">map</span><span class="o">:</span> <span class="nx">map</span><span class="p">,</span> 574 <span class="nx">center</span><span class="o">:</span> <span class="k">new</span> <span class="nx">OpenLayers</span><span class="p">.</span><span class="nx">LonLat</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">45</span><span class="p">),</span> 575 <span class="nx">zoom</span><span class="o">:</span> <span class="mi">4</span><span class="p">,</span> 576 <span class="nx">tbar</span><span class="o">:</span> <span class="nx">toolbarItems</span> 577 <span class="p">});</span> 578 <span class="p">});</span> 579 <span class="nt"></script></span> 580 581 <span class="nt"><style </span><span class="na">type=</span><span class="s">"text/css"</span><span class="nt">></span> 582 <span class="c">/* work around an Ext bug that makes the rendering</span> 583 <span class="c"> of menu items not as one would expect */</span> 584 <span class="nc">.ext-ie</span> <span class="nc">.x-menu-item-icon</span> <span class="p">{</span> 585 <span class="k">left</span><span class="o">:</span> <span class="m">-24px</span><span class="p">;</span> 586 <span class="p">}</span> 587 588 <span class="nc">.ext-strict</span> <span class="nc">.x-menu-item-icon</span> <span class="p">{</span> 589 <span class="k">left</span><span class="o">:</span> <span class="m">3px</span><span class="p">;</span> 590 <span class="p">}</span> 591 592 <span class="nc">.ext-ie6</span> <span class="nc">.x-menu-item-icon</span> <span class="p">{</span> 593 <span class="k">left</span><span class="o">:</span> <span class="m">-24px</span><span class="p">;</span> 594 <span class="p">}</span> 595 596 <span class="nc">.ext-ie7</span> <span class="nc">.x-menu-item-icon</span> <span class="p">{</span> 597 <span class="k">left</span><span class="o">:</span> <span class="m">-24px</span><span class="p">;</span> 598 <span class="p">}</span> 599 <span class="nt"></style></span> 600 <span class="nt"></head></span> 601 <span class="nt"><body></span> 602 <span class="nt"><div</span> <span class="na">id=</span><span class="s">"mappanel"</span><span class="nt">></div></span> 603 <span class="nt"></body></span> 604 605 <span class="nt"></html></span> 606 </pre></div> 607 </div> 608 </div></div> 609 </div> 610 </div> 53 611 </div> 54 612 … … 59 617 <div class="sphinxsidebar"> 60 618 <div class="sphinxsidebarwrapper"> 619 <h3><a href="index.html">Table Of Contents</a></h3> 620 <ul> 621 <li><a class="reference internal" href="#">Introduction</a><ul> 622 <li><a class="reference internal" href="#computer-setup">Computer Setup</a></li> 623 <li><a class="reference internal" href="#mapfish-framework">MapFish Framework</a><ul> 624 <li><a class="reference internal" href="#what-is-a-framework">What is a framework ?</a><ul> 625 <li><a class="reference internal" href="#components-of-mapfish-framework">Components of MapFish framework</a></li> 626 </ul> 627 </li> 628 </ul> 629 </li> 630 <li><a class="reference internal" href="#mapfish-examples">MapFish Examples</a><ul> 631 <li><a class="reference internal" href="#mapfish-javascript-toolbox">MapFish JavaScript Toolbox</a></li> 632 <li><a class="reference internal" href="#mapfish-client-extjs">ExtJS</a><ul> 633 <li><a class="reference internal" href="#ext-hello-world">Ext “Hello World”</a></li> 634 <li><a class="reference internal" href="#ext-viewport">Ext.Viewport</a></li> 635 <li><a class="reference internal" href="#ext-grid-gridpanel">Ext.grid.GridPanel</a></li> 636 </ul> 637 </li> 638 <li><a class="reference internal" href="#mapfish-client-openlayers">OpenLayers</a><ul> 639 <li><a class="reference internal" href="#map">Map</a></li> 640 <li><a class="reference internal" href="#editing-toolbar">Editing Toolbar</a></li> 641 <li><a class="reference internal" href="#popup">Popup</a></li> 642 </ul> 643 </li> 644 <li><a class="reference internal" href="#mapfish-client-geoext">GeoExt</a><ul> 645 <li><a class="reference internal" href="#geoext-mappanel">GeoExt.MapPanel</a></li> 646 <li><a class="reference internal" href="#geoext-action">GeoExt.Action</a></li> 647 </ul> 648 </li> 649 </ul> 650 </li> 651 </ul> 652 </li> 653 </ul> 654 61 655 <h4>Previous topic</h4> 62 656 <p class="topless"><a href="agenda.html" 63 title="previous chapter"> Training agenda</a></p>657 title="previous chapter">Agenda</a></p> 64 658 <h4>Next topic</h4> 65 659 <p class="topless"><a href="mapfish.html" 66 title="next chapter"> <no title></a></p>660 title="next chapter">MapFish</a></p> 67 661 <h3>This Page</h3> 68 662 <ul class="this-page-menu"> … … 94 688 >index</a></li> 95 689 <li class="right" > 96 <a href="mapfish.html" title=" <no title>"690 <a href="mapfish.html" title="MapFish" 97 691 >next</a> |</li> 98 692 <li class="right" > 99 <a href="agenda.html" title=" Training agenda"693 <a href="agenda.html" title="Agenda" 100 694 >previous</a> |</li> 101 695 <li><a href="index.html">2010 FHNW Training v1.0 documentation</a> »</li> -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/build/html/mapfish.html
r3670 r3671 24 24 <script type="text/javascript" src="_static/doctools.js"></script> 25 25 <link rel="top" title="2010 FHNW Training v1.0 documentation" href="index.html" /> 26 <link rel="next" title=" GeoExt" href="geoext.html" />26 <link rel="next" title="Module 1 - Getting Started" href="getting_started.html" /> 27 27 <link rel="prev" title="Introduction" href="introduction.html" /> 28 28 </head> … … 35 35 accesskey="I">index</a></li> 36 36 <li class="right" > 37 <a href="ge oext.html" title="GeoExt"37 <a href="getting_started.html" title="Module 1 - Getting Started" 38 38 accesskey="N">next</a> |</li> 39 39 <li class="right" > … … 51 51 <div class="section" id="mapfish"> 52 52 <h1>MapFish<a class="headerlink" href="#mapfish" title="Permalink to this headline">¶</a></h1> 53 <p>This part of the workshop is adapted from the <a class="reference external" href="http://dev.mapfish.org/sandbox/camptocamp/mapfish_workshop_fossgis2010/printing_src/_build/html/">workshop</a> workshop provided by Eric Lemoine and François Van der Biest at Foss4G 2010 in Barcelona.</p> 54 <p>Contents:</p> 55 <div class="toctree-wrapper compound"> 56 <ul> 57 <li class="toctree-l1"><a class="reference internal" href="getting_started.html">Module 1 - Getting Started</a><ul> 58 <li class="toctree-l2"><a class="reference internal" href="getting_started.html#getting-workshop-material">Getting workshop material</a></li> 59 <li class="toctree-l2"><a class="reference internal" href="getting_started.html#installing-mapfish">Installing MapFish</a></li> 60 <li class="toctree-l2"><a class="reference internal" href="getting_started.html#installing-firefox-extensions">Installing FireFox extensions</a></li> 61 </ul> 62 </li> 63 </ul> 64 </div> 53 65 </div> 54 66 … … 63 75 title="previous chapter">Introduction</a></p> 64 76 <h4>Next topic</h4> 65 <p class="topless"><a href="ge oext.html"66 title="next chapter"> GeoExt</a></p>77 <p class="topless"><a href="getting_started.html" 78 title="next chapter">Module 1 - Getting Started</a></p> 67 79 <h3>This Page</h3> 68 80 <ul class="this-page-menu"> … … 94 106 >index</a></li> 95 107 <li class="right" > 96 <a href="ge oext.html" title="GeoExt"108 <a href="getting_started.html" title="Module 1 - Getting Started" 97 109 >next</a> |</li> 98 110 <li class="right" > -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/build/html/searchindex.js
r3670 r3671 1 Search.setIndex({objects:{},terms:{ geoext:[0,1,4],"12h00":4,modul:0,tabl:0,"13h00":4,indic:0,"15h00":4,api:[0,3,4],mapfish:[0,4,5],geoadmin:[0,3,4],index:0,welcom:0,titl:[],"09h30":4,content:0,document:0,train:0,"16h00":4,introduct:[2,0,4],search:0,"09h00":4,fhnw:0,agenda:[0,4],page:0},objtypes:{},titles:["Welcome to 2010 FHNW Training’s documentation!","GeoExt","Introduction","GeoAdmin API","Agenda","MapFish"],objnames:{},filenames:["index","geoext","introduction","api","agenda","mapfish"]})1 Search.setIndex({objects:{},terms:{all:2,code:2,groundwork:2,global:2,follow:[2,6],children:2,depend:6,setcent:2,init:2,sens:2,addon:6,sourc:2,cmoullet:6,fals:2,veri:2,look:[2,6],button:2,list:[2,6],geograph:[],item:2,vector:2,div:2,setup:[2,0],geoext_act:2,past:6,download:6,click:2,blue:[],index:0,what:2,editingtoolbar:2,hide:2,abl:2,access:[2,6],version:6,"new":2,net:2,can:[2,6],full:2,vmap0:2,here:2,bodi:2,let:2,address:[2,6],layout:2,toolbar:2,search:0,technolog:2,"09h00":4,action:2,basic_packag:6,macintosh:6,firefox:[6,5],activ:[2,6],modul:[0,6,5],apt:[],postgi:2,href:2,tabpanel:2,visibl:2,marker:2,instal:[2,6,5],select:2,from:[2,5],would:2,commun:2,two:2,next:2,stylesheet:2,handler:2,overhead:2,python25:6,recommend:6,msg:2,renderto:2,type:2,toggl:2,relat:2,site:6,fhnw:0,templat:6,paste_deploi:6,toolbaritem:2,none:2,der:5,work:[2,6],dev:[2,6],histori:2,conceptu:2,vlayer:2,whatev:2,root:2,control:2,prompt:6,give:2,sudo:[],share:2,indic:0,high:2,selectfeatur:2,tab:2,enabletoggl:2,openplan:[],end:2,tbar:2,charset:2,minheight:2,geojson:[],env:6,tile:2,xhtml:2,css:2,collaps:2,map:2,product:2,resourc:2,fran:[],lab:2,mai:2,associ:2,printing_src:[],issu:2,inform:2,sandbox:6,imageri:2,environ:6,agenda:[0,4],enter:6,order:2,"15h00":4,through:6,addcontrol:2,cachefli:2,flexibl:2,mainli:2,dynam:2,equiv:2,style:2,group:2,window:[2,6],html:[2,6],hidden:2,python:[2,6],framework:[2,0,6],getelementbyid:2,now:6,introduct:[2,0,4],name:6,edit:2,debug:6,extj:2,draw_lin:2,globe:2,meta:2,expect:2,out:[],goe:2,content:[2,0,5],adapt:[2,5],rel:2,internet:2,integr:2,postgr:2,navig:2,manipul:2,togglegroup:2,base:2,put:2,org:[2,6],recom:6,iso:2,geometri:2,south:2,first:2,origin:2,softwar:2,render:2,qualiti:2,lat:2,mapfish_workshop_fossgis2010:[],done:6,open:2,size:2,autoheight:2,treeload:2,script:[2,6],data:[],interact:2,"09h30":4,messag:2,showref6:2,showref7:2,showref4:2,showref5:2,showref2:2,showref3:2,termin:[],store:6,listen:2,xmln:2,option:2,copi:[],setuptool:6,part:5,provid:[2,5],tree:2,structur:2,reus:2,were:2,browser:[2,6],analysi:2,comput:[2,0,6],ani:[2,6],marbl:[],packag:[2,6],pylon:[2,6],have:2,tabl:0,need:2,treepanel:2,border:2,lib:2,note:2,also:[2,6],exampl:[2,0],lonlat:2,build:[2,6],prepar:2,allow:[2,6],previou:2,oracl:2,plai:2,deploi:6,"class":2,icon:2,simplic:2,allevi:2,ext:2,sigma:[],width:2,camptocamp:[],show:2,text:2,cdn:2,lemoin:5,line:[2,6],onli:2,locat:6,menu:2,configur:2,apach:[],should:[2,6],jsonview:6,rich:2,folder:6,get:[2,0,6,5],cannot:6,toolbox:2,requir:6,mapper:2,bat:6,enabl:6,ie7:2,ie6:2,common:2,attribut:2,view:6,xtype:2,"12h00":4,navigationhistori:2,"13h00":4,mapfish_cli:6,see:2,getfirebug:6,respons:6,hidediv:2,correctli:[2,6],user:2,wikipedia:2,cartograph:2,paster:6,popup:2,web:[2,6],javascript:[2,6],extens:[2,6,5],hydrogramm:2,extent:2,solv:2,openlayers_editing_toolbar:2,plugin:6,region:2,instanc:2,mappanel:2,com:[2,6],bluemarbl:2,load:2,simpli:2,trunk:2,loader:2,header:2,linux:6,assum:6,poli:2,java:2,west:2,three:2,been:2,compon:2,json:6,workshop:[6,5],basic:[2,6],autoscrol:2,emphas:2,rubi:2,mapguid:2,present:2,gridpanel:2,mapserv:2,servic:2,icewasel:[],aim:2,abov:2,margin:2,"3px":2,layer:2,checkitem:2,geoalchemi:2,ctrl:2,asynctreenod:2,toolkit:2,itself:2,lightweight:2,sever:2,"fran\u00e7oi":5,develop:2,welcom:0,minim:6,perform:2,make:2,addlay:2,cross:2,same:[2,6],check:[2,6],complex:2,split:2,extjs_hello_world:2,document:[2,0],complet:2,http:[2,6],swissriv:2,alert:2,tempmapfish:[],php:2,expand:2,iceweasel:[],center:2,client:[2,6],command:6,thi:[2,6,5],geoext_mappanel:2,left:2,protocol:2,rest:6,shape:2,mysql:2,languag:2,onload:2,rapid:2,easi:2,add:[2,6],ultraedit:2,bin:[],applic:[2,6],hover:2,around:2,format:[],agnost:2,varieti:[],piec:2,panzoom:2,grid:2,press:2,world:2,height:2,codeblock2:2,python2:[],hideref5:2,insert:2,hideref7:2,hideref6:2,like:[2,6],hideref3:2,hideref2:2,zoom:2,server:2,api:[2,0,3,4],necessari:2,mapfish_serv:[],output:6,resiz:2,page:[2,0,6],geoext:[2,0,1,4],allowdepress:2,some:2,"export":[],mapfish:[2,0,6,4,5],drawfeatur:2,geoadmin:[0,3,4],librari:2,leaf:2,openlayers_map:2,biest:5,larg:2,localhost:[],refer:2,object:2,zoomtomaxext:2,power:2,geowebcach:2,geoserv:2,step:6,panel:2,src:2,postgresql:[],materi:[6,5],side:2,disabl:2,block:2,own:2,encod:[],www:[2,6],automat:2,compos:2,opengeo:2,draw_poli:2,onreadi:2,openlay:2,type_toggl:2,your:[2,6],libgeo:[],manag:2,van:5,lon:2,avail:6,start:[0,6,5],interfac:2,"var":2,"_build":[],strict:2,"function":2,head:2,north:2,"2010_mapfish_workshop_fhnw":6,sqlalchemi:2,link:2,metacarta:2,foss4g:5,"true":2,bug:2,viewport:2,temp:6,possibl:2,"default":2,geospati:2,displai:2,rc2:[],"24px":2,highlight:2,embed:2,showdiv:2,creat:[2,6],firebug:6,home:[],curl:[],path:2,eric:5,polygon:2,titl:2,pylons_minim:6,rootvis:2,virtual:6,other:[2,6],nav:2,spatial:2,test:2,you:[2,6],codeblock3:2,codeblock4:2,codeblock5:2,codeblock6:2,codeblock7:2,hideref4:2,draw:2,mozilla:6,gxmap:2,sql:2,"16h00":4,debian:[],svn:[],max:2,directori:[],htdoc:[],max_ext:2,barcelona:5,train:0,time:2,push:2,hello:2,extjs_viewport:2},objtypes:{},titles:["Welcome to 2010 FHNW Training’s documentation!","GeoExt","Introduction","GeoAdmin API","Agenda","MapFish","Module 1 - Getting Started"],objnames:{},filenames:["index","geoext","introduction","api","agenda","mapfish","getting_started"]}) -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/source/introduction.rst
r3670 r3671 2 2 ************ 3 3 4 Computer setup 4 .. raw:: html 5 6 <script language=javascript type='text/javascript'> 7 8 function hidediv(div, showDiv, hideDiv) { 9 document.getElementById(div).style.visibility = 'hidden'; 10 document.getElementById(div).style.display = 'none'; 11 document.getElementById(hideDiv).style.visibility = 'hidden'; 12 document.getElementById(hideDiv).style.display = 'none'; 13 document.getElementById(showDiv).style.visibility = 'visible'; 14 document.getElementById(showDiv).style.display = 'block'; 15 } 16 17 function showdiv(div, showDiv, hideDiv) { 18 document.getElementById(div).style.visibility = 'visible'; 19 document.getElementById(div).style.display = 'block'; 20 document.getElementById(showDiv).style.visibility = 'hidden'; 21 document.getElementById(showDiv).style.display = 'none'; 22 document.getElementById(hideDiv).style.visibility = 'visible'; 23 document.getElementById(hideDiv).style.display = 'block'; 24 } 25 </script> 26 27 28 Computer Setup 5 29 -------------- 6 30 7 31 Several pieces of software have been installed on your computer: 32 8 33 * PostGres / PostGIS 9 34 * Ultraedit … … 11 36 * `Python for Windows extensions <http://sourceforge.net/projects/pywin32/>`_ 12 37 13 MapFish general overview 14 ------------------------ 38 MapFish Framework 39 ----------------- 40 41 What is a framework ? 42 ^^^^^^^^^^^^^^^^^^^^^ 43 44 MapFish is a flexible and complete framework for building rich web-mapping 45 applications. It emphasizes high productivity, and high-quality development. 46 But, what is a framework ? From `wikipedia <http://en.wikipedia.org/wiki/Framework>`_ : 47 "A framework is a basic conceptual structure used to solve or address complex issues.". 48 The framework aims to alleviate the overhead associated with common activities performed in Web mapping development. 49 50 In that sense, MapFish Framework provides the technology for building web mapping applications. 51 With client technologies, the developer can create user interfaces and with server technologies, it is possible to develop the necessary web services. 52 53 On the client side, JavaScript libraries are mainly used, on the server side, several languages can be used. 54 Originally, Python components were used, but with the time, Java, Ruby and PHP components have also been developped. 55 This shows the flexibility and openness of the framework. 56 57 .. note:: 58 59 MapFish is cartographic server agnostic. It can be used with `MapServer <http://www.mapserver.org>`_, `GeoServer <http://www.geoserver.org>`_, `MapGuide <http://www.mapguide.org>`_ 60 or whatever cartographic server that is able to communicate with open protocols like WMS or WFS. 61 62 Components of MapFish framework 63 ::::::::::::::::::::::::::::::: 64 65 Several Open Source technologies are used in MapFish Framework. 66 67 Client side: 68 69 * `GeoExt <http://www.geoext.org>`_: GeoExt is a JavaScript library providing the groundwork for creating web-mapping applications based on OpenLayers and ExtJS. 70 * `OpenLayers <http://www.openlayers.org>`_: OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source. 71 * `ExtJS <http://extjs.com/>`_: Ext JS is a cross-browser JavaScript library for building rich internet applications. 72 73 Server side: 74 75 * `Shapely <http://pypi.python.org/pypi/Shapely>`_: Shapely is a Python package for manipulation and analysis of 2D geospatial geometries. 76 * `SqlAlchemy <http://www.sqlalchemy.org/>`_: SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. 77 * `GeoAlchemy <http://www.geoalchemy.org/>`_: GeoAlchemy is an extension of SQLAlchemy allowing the access to Oracle Spatial, PostGis and MySQL. 78 * `Pylons <http://pylonshq.com/>`_: Pylons is a lightweight web framework emphasizing flexibility and rapid development. 79 80 MapFish Examples 81 ---------------- 82 83 MapFish JavaScript Toolbox 84 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 85 86 MapFish JavaScript Toolbox is composed of three JavaScript libraries: ExtJS, OpenLayers and GeoExt. The functionality of all these libraries will be highlighted with some example code. 87 88 .. _mapfish_client_extjs: 89 90 ExtJS 91 ^^^^^ 92 93 Ext JS is a cross-browser JavaScript library for building rich internet applications. It provides a `very large list of UI components <http://www.extjs.com/deploy/dev/examples/samples.html>`_. 94 95 .. note:: 96 97 In order to play with ExtJS, it is needed to reference the ExtJS library and the associated css. For simplicity, we have prepared an accessible build with `CacheFly <http://extjs.com/products/extjs/build/index.php>`_. 98 99 Then, simply add the following code in the html page: 100 101 <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script> 102 103 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" /> 104 105 Ext "Hello World" 106 ::::::::::::::::: 107 108 Create your own html page with the following code :download:`extjs_hello_world.html <_static/extjs_hello_world.html>`. 109 If you open it in a browser, you should get a message "Hello World! You have ExtJS configured correctly!" 110 111 .. raw:: html 112 113 <a id="showRef2" href="javascript:showdiv('codeBlock2','showRef2','hideRef2')">Show code</a> 114 <a id="hideRef2" href="javascript:hidediv('codeBlock2','showRef2','hideRef2')" style="display: none; visibility: hidden">Hide code</a> 115 <div id="codeBlock2" style="display: none; visibility: hidden"> 116 117 .. code-block:: html 118 119 <html> 120 <head> 121 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 122 <title id='title'>ExtJS Hello World</title> 123 124 <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script> 125 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" /> 126 127 <script type="text/javascript"> 128 Ext.onReady(function(){ 129 alert("Hello World! You have ExtJS configured correctly!"); 130 }); //end onReady 131 </script> 132 133 </head> 134 <body> 135 </body> 136 </html> 137 138 .. raw:: html 139 140 </div> 141 142 Ext.Viewport 143 :::::::::::: 144 145 The Viewport renders itself to the document body, and automatically sizes itself to the size of the browser viewport and manages window resizing. There may only be one Viewport created in a page. Let's have a look at the configuration of a `viewport <http://www.extjs.com/deploy/dev/docs/?class=Ext.Viewport>`_: 146 147 To test: :download:`extjs_viewport.html <_static/extjs_viewport.html>` 148 149 .. raw:: html 150 151 <a id="showRef3" href="javascript:showdiv('codeBlock3','showRef3','hideRef3')">Show code</a> 152 <a id="hideRef3" href="javascript:hidediv('codeBlock3','showRef3','hideRef3')" style="display: none; visibility: hidden">Hide code</a> 153 <div id="codeBlock3" style="display: none; visibility: hidden"> 154 155 .. code-block:: html 156 157 <html> 158 <head> 159 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> 160 <title id='title'>ExtJS Viewport</title> 161 162 <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script> 163 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"/> 164 165 <script type="text/javascript"> 166 Ext.onReady(function() { 167 new Ext.Viewport({ 168 layout: 'border', 169 items: [ 170 { 171 region: 'north', 172 html: '<h1 class="x-panel-header">Page Title</h1>', 173 autoHeight: true, 174 border: false, 175 margins: '0 0 5 0' 176 }, 177 { 178 region: 'west', 179 collapsible: true, 180 title: 'Navigation', 181 xtype: 'treepanel', 182 width: 200, 183 autoScroll: true, 184 split: true, 185 loader: new Ext.tree.TreeLoader(), 186 root: new Ext.tree.AsyncTreeNode({ 187 expanded: true, 188 children: [ 189 { 190 text: 'Menu Option 1', 191 leaf: true 192 }, 193 { 194 text: 'Menu Option 2', 195 leaf: true 196 }, 197 { 198 text: 'Menu Option 3', 199 leaf: true 200 } 201 ] 202 }), 203 rootVisible: false, 204 listeners: { 205 click: function(n) { 206 Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.text + '"'); 207 } 208 } 209 }, 210 { 211 region: 'center', 212 xtype: 'tabpanel', 213 items: { 214 title: 'Default Tab', 215 html: 'The first tab\'s content. Others may be added dynamically' 216 } 217 }, 218 { 219 region: 'south', 220 title: 'Information', 221 collapsible: true, 222 html: 'Information goes here', 223 split: true, 224 height: 100, 225 minHeight: 100 226 } 227 ] 228 }); 229 }); //end onReady 230 </script> 231 232 </head> 233 <body> 234 </body> 235 </html> 236 237 .. raw:: html 238 239 </div> 240 241 Ext.grid.GridPanel 242 :::::::::::::::::: 243 244 `Globe application <http://map.globe.admin.ch>`_ uses a `grid panel <http://extjs.com/deploy/dev/docs/?class=Ext.grid.GridPanel>`_: 245 246 .. image:: _static/mapfish_globe.png 247 248 .. _mapfish_client_openlayers: 249 250 OpenLayers 251 ^^^^^^^^^^ 252 253 OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source. 254 255 Have a look at the `OpenLayers examples <http://openlayers.org/dev/examples/>`_ to see the power of this library. 256 257 .. note:: 258 259 In order to play with OpenLayers, it is needed to reference the OpenLayers library. 260 261 Simply add the following code in the html page: 262 263 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 264 265 Map 266 ::: 267 268 Instances of `OpenLayers.Map <http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Map-js.html>`_ are interactive maps embedded in a web page. 269 270 To test: :download:`openlayers_map.html <_static/openlayers_map.html>` 271 272 .. raw:: html 273 274 <a id="showRef4" href="javascript:showdiv('codeBlock4','showRef4','hideRef4')">Show code</a> 275 <a id="hideRef4" href="javascript:hidediv('codeBlock4','showRef4','hideRef4')" style="display: none; visibility: hidden">Hide code</a> 276 <div id="codeBlock4" style="display: none; visibility: hidden"> 277 278 .. code-block:: html 279 280 <html> 281 <head> 282 <title>OpenLayers Map</title> 283 284 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 285 286 <script type="text/javascript"> 287 var map, layer; 288 function init() { 289 map = new OpenLayers.Map('map'); 290 layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 291 "http://labs.metacarta.com/wms/vmap0", 292 {layers: 'basic'} 293 ); 294 map.addLayer(layer); 295 map.zoomToMaxExtent(); 296 } 297 </script> 298 </head> 299 300 <body onload="init()"> 301 302 <div id="map"></div> 303 304 </body> 305 </html> 306 307 .. raw:: html 308 309 </div> 310 311 Editing Toolbar 312 ::::::::::::::: 313 314 `Editing Toolbar <http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/_staticOpenLayers/Control/EditingToolbar-js.html>`_ 315 316 To test: :download:`openlayers_editing_toolbar.html <_static/openlayers_editing_toolbar.html>` 317 318 .. raw:: html 319 320 <a id="showRef5" href="javascript:showdiv('codeBlock5','showRef5','hideRef5')">Show code</a> 321 <a id="hideRef5" href="javascript:hidediv('codeBlock5','showRef5','hideRef5')" style="display: none; visibility: hidden">Hide code</a> 322 <div id="codeBlock5" style="display: none; visibility: hidden"> 323 324 .. code-block:: html 325 326 <html xmlns="http://www.w3.org/1999/xhtml"> 327 <head> 328 <title>OpenLayers Editing Toolbar </title> 329 330 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 331 332 <script type="text/javascript"> 333 var lon = 5; 334 var lat = 40; 335 var zoom = 5; 336 var map, layer; 337 338 function init() { 339 layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 340 "http://labs.metacarta.com/wms/vmap0", 341 {layers: 'basic'} 342 ); 343 344 vlayer = new OpenLayers.Layer.Vector("Editable"); 345 map = new OpenLayers.Map('map', { 346 controls: [ 347 new OpenLayers.Control.PanZoom(), 348 new OpenLayers.Control.EditingToolbar(vlayer) 349 ] 350 }); 351 map.addLayers([layer, vlayer]); 352 353 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 354 } 355 </script> 356 </head> 357 <body onload="init()"> 358 <div id="map"></div> 359 </body> 360 </html> 361 362 .. raw:: html 363 364 </div> 365 366 Popup 367 ::::: 368 369 `Swissrivers.ch application <http://www.swissrivers.ch>`_ uses `OpenLayers popups <http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Popup-js.html>`_ to present hydrogramms. 370 371 .. image:: _static/mapfish_swissrivers.png 372 373 .. _mapfish_client_geoext: 374 375 GeoExt 376 ^^^^^^ 377 378 GeoExt is a JavaScript library providing the groundwork for creating web-mapping applications based on OpenLayers and ExtJS. 379 380 Have a look at the `GeoExt examples <http://dev.geoext.org/trunk/geoext/examples/>`_ to see the power of this library. 381 382 .. note:: 383 384 In order to play with GeoExt, it is needed to reference the OpenLayers, ExtJS and GeoExt library. 385 386 For GeoExt, simply add the following code in the html page: 387 388 <script src="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js"></script> 389 390 GeoExt.MapPanel 391 ::::::::::::::: 392 393 A GeoExt MapPanel is an OpenLayers map integrated into an ExtJS Panel. 394 395 To test: :download:`geoext_mappanel.html <_static/geoext_mappanel.html>` 396 397 .. raw:: html 398 399 <a id="showRef6" href="javascript:showdiv('codeBlock6','showRef6','hideRef6')">Show code</a> 400 <a id="hideRef6" href="javascript:hidediv('codeBlock6','showRef6','hideRef6')" style="display: none; visibility: hidden">Hide code</a> 401 <div id="codeBlock6" style="display: none; visibility: hidden"> 402 403 .. code-block:: html 404 405 <html> 406 <head> 407 408 <title>GeoExt Map Panel</title> 409 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script> 410 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script> 411 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"/> 412 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css"/> 413 414 <script src="http://www.openlayers.org/api/2.10/OpenLayers.js"></script> 415 416 417 <script src="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js" type="text/javascript"></script> 418 419 <script type="text/javascript"> 420 Ext.onReady(function() { 421 var map = new OpenLayers.Map(); 422 var layer = new OpenLayers.Layer.WMS( 423 "Global Imagery", 424 "http://maps.opengeo.org/geowebcache/service/wms", 425 {layers: "bluemarble"} 426 ); 427 map.addLayer(layer); 428 429 new GeoExt.MapPanel({ 430 renderTo: 'gxmap', 431 height: 400, 432 width: 600, 433 map: map, 434 title: 'GeoExt Map Panel' 435 }); 436 }); 437 </script> 438 </head> 439 <body> 440 <div id="gxmap"></div> 441 </body> 442 </html> 443 444 .. raw:: html 445 446 </div> 447 448 GeoExt.Action 449 ::::::::::::: 450 451 GeoExt provides the GeoExt.Action class for adaptating a control to an object that can be inserted in a toolbar or in a menu. 452 453 To test: :download:`geoext_action.html <_static/geoext_action.html>` 454 455 .. raw:: html 456 457 <a id="showRef7" href="javascript:showdiv('codeBlock7','showRef7','hideRef7')">Show code</a> 458 <a id="hideRef7" href="javascript:hidediv('codeBlock7','showRef7','hideRef7')" style="display: none; visibility: hidden">Hide code</a> 459 <div id="codeBlock7" style="display: none; visibility: hidden"> 460 461 .. code-block:: html 462 463 <html> 464 <head> 465 <title>GeoExt Action</title> 466 467 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script> 468 <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script> 469 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"/> 470 <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css"/> 471 472 <script src="http://www.openlayers.org/api/2.10/OpenLayers.js"></script> 473 474 475 <script type="text/javascript" src="http://dev.geoext.org/trunk/geoext/lib/GeoExt.js"></script> 476 477 <script type="text/javascript"> 478 Ext.onReady(function() { 479 var map = new OpenLayers.Map(); 480 var wms = new OpenLayers.Layer.WMS( 481 "Global Imagery", 482 "http://maps.opengeo.org/geowebcache/service/wms", 483 {layers: "bluemarble"} 484 ); 485 var vector = new OpenLayers.Layer.Vector("vector"); 486 map.addLayers([wms, vector]); 487 488 var ctrl, toolbarItems = [], action, actions = {}; 489 490 // ZoomToMaxExtent control, a "button" control 491 action = new GeoExt.Action({ 492 control: new OpenLayers.Control.ZoomToMaxExtent(), 493 map: map, 494 text: "max extent" 495 }); 496 actions["max_extent"] = action; 497 toolbarItems.push(action); 498 toolbarItems.push("-"); 499 500 // Navigation control and DrawFeature controls 501 // in the same toggle group 502 action = new GeoExt.Action({ 503 text: "nav", 504 control: new OpenLayers.Control.Navigation(), 505 map: map, 506 // button options 507 toggleGroup: "draw", 508 allowDepress: false, 509 pressed: true, 510 // check item options 511 group: "draw", 512 checked: true 513 }); 514 actions["nav"] = action; 515 toolbarItems.push(action); 516 517 action = new GeoExt.Action({ 518 text: "draw poly", 519 control: new OpenLayers.Control.DrawFeature( 520 vector, OpenLayers.Handler.Polygon 521 ), 522 map: map, 523 // button options 524 toggleGroup: "draw", 525 allowDepress: false, 526 // check item options 527 group: "draw" 528 }); 529 actions["draw_poly"] = action; 530 toolbarItems.push(action); 531 532 action = new GeoExt.Action({ 533 text: "draw line", 534 control: new OpenLayers.Control.DrawFeature( 535 vector, OpenLayers.Handler.Path 536 ), 537 map: map, 538 // button options 539 toggleGroup: "draw", 540 allowDepress: false, 541 // check item options 542 group: "draw" 543 }); 544 actions["draw_line"] = action; 545 toolbarItems.push(action); 546 toolbarItems.push("-"); 547 548 // SelectFeature control, a "toggle" control 549 action = new GeoExt.Action({ 550 text: "select", 551 control: new OpenLayers.Control.SelectFeature(vector, { 552 type: OpenLayers.Control.TYPE_TOGGLE, 553 hover: true 554 }), 555 map: map, 556 // button options 557 enableToggle: true 558 }); 559 actions["select"] = action; 560 toolbarItems.push(action); 561 toolbarItems.push("-"); 562 563 // Navigation history - two "button" controls 564 ctrl = new OpenLayers.Control.NavigationHistory(); 565 map.addControl(ctrl); 566 567 action = new GeoExt.Action({ 568 text: "previous", 569 control: ctrl.previous, 570 disabled: true 571 }); 572 actions["previous"] = action; 573 toolbarItems.push(action); 574 575 action = new GeoExt.Action({ 576 text: "next", 577 control: ctrl.next, 578 disabled: true 579 }); 580 actions["next"] = action; 581 toolbarItems.push(action); 582 toolbarItems.push("->"); 583 584 // Reuse the GeoExt.Action objects created above 585 // as menu items 586 toolbarItems.push({ 587 text: "menu", 588 menu: new Ext.menu.Menu({ 589 items: [ 590 // ZoomToMaxExtent 591 actions["max_extent"], 592 // Nav 593 new Ext.menu.CheckItem(actions["nav"]), 594 // Draw poly 595 new Ext.menu.CheckItem(actions["draw_poly"]), 596 // Draw line 597 new Ext.menu.CheckItem(actions["draw_line"]), 598 // Select control 599 new Ext.menu.CheckItem(actions["select"]), 600 // Navigation history control 601 actions["previous"], 602 actions["next"] 603 ] 604 }) 605 }); 606 607 var mapPanel = new GeoExt.MapPanel({ 608 renderTo: "mappanel", 609 height: 400, 610 width: 600, 611 map: map, 612 center: new OpenLayers.LonLat(5, 45), 613 zoom: 4, 614 tbar: toolbarItems 615 }); 616 }); 617 </script> 618 619 <style type="text/css"> 620 /* work around an Ext bug that makes the rendering 621 of menu items not as one would expect */ 622 .ext-ie .x-menu-item-icon { 623 left: -24px; 624 } 625 626 .ext-strict .x-menu-item-icon { 627 left: 3px; 628 } 629 630 .ext-ie6 .x-menu-item-icon { 631 left: -24px; 632 } 633 634 .ext-ie7 .x-menu-item-icon { 635 left: -24px; 636 } 637 </style> 638 </head> 639 <body> 640 <div id="mappanel"></div> 641 </body> 642 643 </html> 644 645 .. raw:: html 646 647 </div> -
sandbox/cmoullet/2010_mapfish_workshop_fhnw/source/mapfish.rst
r3670 r3671 2 2 ******* 3 3 4 * Install MapFish 4 This part of the workshop is adapted from the `workshop <http://dev.mapfish.org/sandbox/camptocamp/mapfish_workshop_fossgis2010/printing_src/_build/html/>`_ workshop provided by Eric Lemoine and François Van der Biest at Foss4G 2010 in Barcelona. 5 6 Contents: 7 8 .. toctree:: 9 :maxdepth: 2 10 11 getting_started 12
