Ticket #497: Add_gx_mappanel_in_examples,_format_code.patch
| File Add_gx_mappanel_in_examples,_format_code.patch, 152.9 kB (added by cmoullet, 3 years ago) |
|---|
-
MapFish/client/examples/print/basic.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Map printing with a simple form</title>5 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">6 <link rel="stylesheet" type="text/css"7 href="../../mfbase/ext/resources/css/ext-all.css"/>8 <link rel="stylesheet" type="text/css"9 href="../../mfbase/mapfish/mapfish.css"/>4 <title>Map printing with a simple form</title> 5 <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 <link rel="stylesheet" type="text/css" 7 href="../../mfbase/ext/resources/css/ext-all.css"/> 8 <link rel="stylesheet" type="text/css" 9 href="../../mfbase/mapfish/mapfish.css"/> 10 10 11 <script type="text/javascript"12 src="../../mfbase/openlayers/lib/OpenLayers.js"></script>11 <script type="text/javascript" 12 src="../../mfbase/openlayers/lib/OpenLayers.js"></script> 13 13 14 <script type="text/javascript"15 src="../../mfbase/ext/adapter/ext/ext-base.js"></script>16 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script>14 <script type="text/javascript" 15 src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 16 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 17 17 18 <script type="text/javascript"> 19 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 20 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 21 var gMfLocation = "../../mfbase/mapfish/"; 22 </script> 23 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 24 <script type="text/javascript" src="../examples.js"></script> 18 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 19 20 <script type="text/javascript"> 21 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 22 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 23 var gMfLocation = "../../mfbase/mapfish/"; 24 </script> 25 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 26 <script type="text/javascript" src="../examples.js"></script> 25 27 26 <style type="text/css">27 html, body {28 font: normal 12px verdana;29 margin: 0;30 padding: 0;31 border: 0 none;32 overflow: hidden;33 height: 100%;34 }35 </style>36 <script type="text/javascript">37 // reference local blank image38 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';39 Ext.onReady(function() {28 <style type="text/css"> 29 html, body { 30 font: normal 12px verdana; 31 margin: 0; 32 padding: 0; 33 border: 0 none; 34 overflow: hidden; 35 height: 100%; 36 } 37 </style> 38 <script type="text/javascript"> 39 // reference local blank image 40 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 41 Ext.onReady(function() { 40 42 41 var map = new OpenLayers.Map();43 var map = new OpenLayers.Map(); 42 44 43 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",44 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});45 map.addLayers([wms]);45 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 46 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 47 map.addLayers([wms]); 46 48 47 var layerOverrides={48 "OpenLayers WMS": {overview: true}49 };49 var layerOverrides = { 50 "OpenLayers WMS": {overview: true} 51 }; 50 52 51 var printConfigUrl = mapfish.SERVER_BASE_URL + 'print/info.json';53 var printConfigUrl = mapfish.SERVER_BASE_URL + 'print/info.json'; 52 54 53 var toolbar = new mapfish.widgets.toolbar.Toolbar({54 map: map,55 configurable: false,56 items: [new mapfish.widgets.print.PrintAction({57 map: map,58 configUrl: printConfigUrl,59 overrides: layerOverrides60 })]61 });55 var toolbar = new mapfish.widgets.toolbar.Toolbar({ 56 map: map, 57 configurable: false, 58 items: [new mapfish.widgets.print.PrintAction({ 59 map: map, 60 configUrl: printConfigUrl, 61 overrides: layerOverrides 62 })] 63 }); 62 64 63 var viewport = new Ext.Viewport({ 64 layout:'border', 65 items:[ 66 new Ext.BoxComponent({ // raw 67 region: 'north', 68 el: 'north', 69 height: 32 70 }), 71 { 72 region: 'west', 73 id: 'west-panel', 74 title: 'West', 75 split: true, 76 width: 280, 77 minSize: 175, 78 maxSize: 400, 79 collapsible: true, 80 margins: '0 0 0 5', 81 layout: 'accordion', 82 defaults: { 83 collapsed: true 84 }, 85 layoutConfig:{ 86 animate: true, 87 activeOnTop: false 88 }, 89 items: [ 90 { 91 xtype: 'print-simple', 92 title: 'Print single page', 93 bodyStyle: 'padding: 7px;', 94 collapsed: false, 95 formConfig: { 96 labelWidth: 65, 97 defaults: { 98 width: 140, 99 listWidth: 140 100 }, 101 items: [ 102 { 103 xtype: 'textfield', 104 fieldLabel: OpenLayers.Lang.translate('mf.print.mapTitle'), 105 name: 'mapTitle', 106 value: 'Map title' 107 }, 108 { 109 xtype: 'textarea', 110 fieldLabel: OpenLayers.Lang.translate('mf.print.comment'), 111 name: 'comment', 112 height: 100, 113 value: 'Some comments' 114 } 115 ] 116 }, 117 border: false, 118 map: map, 119 configUrl: printConfigUrl, 120 overrides: layerOverrides 121 } 122 ] 123 },{ 124 region: 'center', 125 title: 'Map', 126 layout: 'fit', 127 xtype: 'mapcomponent', 128 map: map, 129 tbar: toolbar 130 }] 131 }); 65 var viewport = new Ext.Viewport({ 66 layout:'border', 67 items:[ 68 new Ext.BoxComponent({ // raw 69 region: 'north', 70 el: 'north', 71 height: 32, 72 margins: {left: 5,top: 5} 73 }), 74 { 75 region: 'west', 76 id: 'west-panel', 77 title: 'West', 78 split: true, 79 width: 280, 80 minSize: 175, 81 maxSize: 400, 82 collapsible: true, 83 margins: '0 0 0 5', 84 layout: 'accordion', 85 defaults: { 86 collapsed: true 87 }, 88 layoutConfig:{ 89 animate: true, 90 activeOnTop: false 91 }, 92 items: [ 93 { 94 xtype: 'print-simple', 95 title: 'Print single page', 96 bodyStyle: 'padding: 7px;', 97 collapsed: false, 98 formConfig: { 99 labelWidth: 65, 100 defaults: { 101 width: 140, 102 listWidth: 140 103 }, 104 items: [ 105 { 106 xtype: 'textfield', 107 fieldLabel: OpenLayers.Lang.translate('mf.print.mapTitle'), 108 name: 'mapTitle', 109 value: 'Map title' 110 }, 111 { 112 xtype: 'textarea', 113 fieldLabel: OpenLayers.Lang.translate('mf.print.comment'), 114 name: 'comment', 115 height: 100, 116 value: 'Some comments' 117 } 118 ] 119 }, 120 border: false, 121 map: map, 122 configUrl: printConfigUrl, 123 overrides: layerOverrides 124 } 125 ] 126 },{ 127 region: 'center', 128 title: 'Map', 129 layout: 'fit', 130 xtype: 'gx_mappanel', 131 map: map, 132 tbar: toolbar 133 }] 134 }); 132 135 133 map.setCenter(new OpenLayers.LonLat(8.5, 0), 3);134 });135 </script>136 map.setCenter(new OpenLayers.LonLat(8.5, 0), 3); 137 }); 138 </script> 136 139 </head> 137 140 <body> 138 <div id="west"></div>139 <div id="north">140 < p style="font-size:14pt" align="center">MapFish printer</p>141 </div>142 <div id="center"></div>141 <div id="west"></div> 142 <div id="north"> 143 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Printer</h1> 144 </div> 145 <div id="center"></div> 143 146 </body> 144 147 </html> -
MapFish/client/examples/geostat/choropleths.html
1 1 <!DOCTYPE html> 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head>3 <head> 4 4 <title>Choropleths</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 13 <script type="text/javascript"> 14 // Because of a bug in Firefox 2 we need to specify the MapFish base path.15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128216 var gMfLocation = "../../mfbase/mapfish/";14 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 16 var gMfLocation = "../../mfbase/mapfish/"; 17 17 </script> 18 18 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 19 19 <script type="text/javascript" src="../examples.js"></script> 20 20 21 21 <!-- EXT colorField Extent --> 22 <script type="text/javascript" src="../../mfbase/ext-community-extensions/color-field.js" ></script>23 <link rel="stylesheet" type="text/css" href="../../mfbase/ext-community-extensions/color-field.css" />22 <script type="text/javascript" src="../../mfbase/ext-community-extensions/color-field.js"></script> 23 <link rel="stylesheet" type="text/css" href="../../mfbase/ext-community-extensions/color-field.css"/> 24 24 25 25 <!-- A Localization Script File comes here --> 26 26 <script type="text/javascript"> 27 function createMap(mapDiv) {28 var map = new OpenLayers.Map('olmap');27 function createMap(mapDiv) { 28 var map = new OpenLayers.Map('olmap'); 29 29 30 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",31 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});30 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 31 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 32 32 33 map.addLayers([wms]);34 map.addControl(new OpenLayers.Control.LayerSwitcher());35 map.setCenter(new OpenLayers.LonLat(17, 2), 2);33 map.addLayers([wms]); 34 map.addControl(new OpenLayers.Control.LayerSwitcher()); 35 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 36 36 37 return map;38 }37 return map; 38 } 39 39 40 // reference local blank image41 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';40 // reference local blank image 41 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 42 42 43 Ext.onReady(function() {44 var map = createMap("map");43 Ext.onReady(function() { 44 var map = createMap("map"); 45 45 46 var choropleth = new mapfish.widgets.geostat.Choropleth({ 47 'map': map, 48 'nameAttribute': 'country', 49 'indicators': [['birth_rt', 'Birth Rate'], 50 ['death_rt', 'Death Rate'], 51 ['fertility', 'Fertility']], 52 'url': mapfish.SERVER_BASE_URL + "countries", 53 'loadMask' : {msg: 'Loading Data...', msgCls: 'x-mask-loading'}, 54 'legendDiv' : 'myChoroplethLegendDiv' 55 }); 56 choropleth.render('myChoroplethDiv'); 46 var choropleth = new mapfish.widgets.geostat.Choropleth({ 47 'map': map, 48 'nameAttribute': 'country', 49 'indicators': [ 50 ['birth_rt', 'Birth Rate'], 51 ['death_rt', 'Death Rate'], 52 ['fertility', 'Fertility'] 53 ], 54 'url': mapfish.SERVER_BASE_URL + "countries", 55 'loadMask' : {msg: 'Loading Data...', msgCls: 'x-mask-loading'}, 56 'legendDiv' : 'myChoroplethLegendDiv' 57 }); 58 choropleth.render('myChoroplethDiv'); 57 59 58 }, this);60 }, this); 59 61 60 62 </script> 61 63 62 64 <style type="text/css"> 63 65 #right { 64 float: right;65 width: 28%;66 float: right; 67 width: 28%; 66 68 } 69 67 70 #olmap { 68 71 width: 65%; 69 72 height: 400px; 70 73 border: 1px solid black; 71 74 } 75 72 76 #myChoroplethLegendDiv { 73 77 margin-top: 1.5em; 74 78 font-size: small; 75 79 } 80 81 #north { 82 margin-top: 5px; 83 margin-left: 5px; 84 } 76 85 </style> 77 </head> 78 <body> 79 <h1 class="page-title">Choropleths Example</h1> 86 </head> 87 <body> 88 <div id="north"> 89 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Chloropleth 90 example</h1> 91 <br> 92 </div> 80 93 81 <div id="content">82 <div id="right">94 <div id="content"> 95 <div id="right"> 83 96 <div id="myChoroplethDiv"></div> 84 97 <div id="myChoroplethLegendDiv"></div> 85 </div>86 <div id="olmap"></div>87 </div>88 </body>98 </div> 99 <div id="olmap"></div> 100 </div> 101 </body> 89 102 </html> -
MapFish/client/examples/editing/index.html
3 3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5 5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 6 <head>6 <head> 7 7 <title>Edition examples</title> 8 </head>9 <body>10 <h1 class="page-title">Edition examples</h1>8 </head> 9 <body> 10 <h1 class="page-title">Edition examples</h1> 11 11 12 <div id="content">13 <ul>12 <div id="content"> 13 <ul> 14 14 <li><a href="list.html">Separate feature list</a></li> 15 15 <li><a href="editing-panel.html">Editing panel</a></li> 16 </ul>17 </div>18 </body>16 </ul> 17 </div> 18 </body> 19 19 </html> -
MapFish/client/examples/print/simple.html
17 17 src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 18 18 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 19 19 20 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 21 20 22 <script type="text/javascript"> 21 // Because of a bug in Firefox 2 we need to specify the MapFish base path.22 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128223 var gMfLocation = "../../mfbase/mapfish/";23 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 24 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 25 var gMfLocation = "../../mfbase/mapfish/"; 24 26 </script> 25 27 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 26 28 <script type="text/javascript" src="../examples.js"></script> 27 29 28 30 <style type="text/css"> 29 html, body {30 font: normal 12px verdana;31 margin: 0;32 padding: 0;33 border: 0 none;34 overflow: hidden;35 height: 100%;36 }31 html, body { 32 font: normal 12px verdana; 33 margin: 0; 34 padding: 0; 35 border: 0 none; 36 overflow: hidden; 37 height: 100%; 38 } 37 39 </style> 38 40 <script type="text/javascript"> 39 41 40 // reference local blank image41 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';42 Ext.onReady(function() {42 // reference local blank image 43 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 44 Ext.onReady(function() { 43 45 44 var map = new OpenLayers.Map($('center'));46 var map = new OpenLayers.Map($('center')); 45 47 46 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",47 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});48 map.addLayers([wms]);48 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 49 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 50 map.addLayers([wms]); 49 51 50 var summits = new OpenLayers.Layer.WMS("Summits",51 "http://demo.mapfish.org/mapfishsample/trunk/wms?",52 {layers: ['summits'], format: 'image/png', transparent: true},53 {visibility: false, singleTile: true}54 );55 map.addLayer(summits);52 var summits = new OpenLayers.Layer.WMS("Summits", 53 "http://demo.mapfish.org/mapfishsample/trunk/wms?", 54 {layers: ['summits'], format: 'image/png', transparent: true}, 55 {visibility: false, singleTile: true} 56 ); 57 map.addLayer(summits); 56 58 57 var countries = new OpenLayers.Layer.WMS("Countries",58 "http://demo.mapfish.org/mapfishsample/trunk/wms?",59 {layers: ['countries'], format: OpenLayers.Util.alphaHack()?'image/gif':'image/png', transparent: true},60 {visibility: true, singleTile: true}61 );62 map.addLayer(countries);59 var countries = new OpenLayers.Layer.WMS("Countries", 60 "http://demo.mapfish.org/mapfishsample/trunk/wms?", 61 {layers: ['countries'], format: OpenLayers.Util.alphaHack() ? 'image/gif' : 'image/png', transparent: true}, 62 {visibility: true, singleTile: true} 63 ); 64 map.addLayer(countries); 63 65 64 map.addControl(new OpenLayers.Control.LayerSwitcher());66 map.addControl(new OpenLayers.Control.LayerSwitcher()); 65 67 66 var layerOverrides={67 "OpenLayers WMS": {overview: true},68 Countries: { format: 'image/svg+xml' }69 };68 var layerOverrides = { 69 "OpenLayers WMS": {overview: true}, 70 Countries: { format: 'image/svg+xml' } 71 }; 70 72 71 var printConfigUrl = mapfish.SERVER_BASE_URL + 'print/info.json';72 //var printConfigUrl = '/tomcat/print-servlet-1.1-SNAPSHOT/pdf/info.json';73 var printConfigUrl = mapfish.SERVER_BASE_URL + 'print/info.json'; 74 //var printConfigUrl = '/tomcat/print-servlet-1.1-SNAPSHOT/pdf/info.json'; 73 75 74 var toolbar = new mapfish.widgets.toolbar.Toolbar({75 map: map,76 configurable: false,77 items: [new mapfish.widgets.print.PrintAction({78 map: map,79 configUrl: printConfigUrl,80 overrides: layerOverrides,81 fillSpec: function(printCommand) {82 mapfish.widgets.print.PrintAction.prototype.fillSpec.call(this, printCommand);76 var toolbar = new mapfish.widgets.toolbar.Toolbar({ 77 map: map, 78 configurable: false, 79 items: [new mapfish.widgets.print.PrintAction({ 80 map: map, 81 configUrl: printConfigUrl, 82 overrides: layerOverrides, 83 fillSpec: function(printCommand) { 84 mapfish.widgets.print.PrintAction.prototype.fillSpec.call(this, printCommand); 83 85 84 //our layout needs two fields... hard code them here85 printCommand.spec.comment = "No comment";86 printCommand.spec.mapTitle = "PrintControl";87 }88 })]89 });86 //our layout needs two fields... hard code them here 87 printCommand.spec.comment = "No comment"; 88 printCommand.spec.mapTitle = "PrintControl"; 89 } 90 })] 91 }); 90 92 91 var viewport = new Ext.Viewport({ 92 layout:'border', 93 items:[ 94 new Ext.BoxComponent({ // raw 95 region: 'north', 96 el: 'north', 97 height: 32 98 }), 99 { 100 region: 'west', 101 id: 'west-panel', 102 title: 'West', 103 split: true, 104 width: 280, 105 minSize: 175, 106 maxSize: 400, 107 collapsible: true, 108 margins: '0 0 0 5', 109 layout: 'accordion', 110 defaults: { 111 collapsed: true 112 }, 113 layoutConfig:{ 114 animate: true, 115 activeOnTop: false 116 }, 117 items: [ 118 { 119 contentEl: 'help', 120 collapsed: false, 121 title: 'Help', 122 autoScroll: true, 123 bodyStyle: 'padding: 7px;', 124 border: false 125 }, 126 { 127 xtype: 'print-simple', 128 title: 'Print single page', 129 bodyStyle: 'padding: 7px;', 130 formConfig: { 131 labelWidth: 65, 132 defaults: { 133 width: 140, 134 listWidth: 140 135 }, 136 items: [ 137 { 138 xtype: 'textfield', 139 fieldLabel: OpenLayers.Lang.translate('mf.print.mapTitle'), 140 name: 'mapTitle', 141 value: 'Map title' 142 }, 143 { 144 xtype: 'textarea', 145 fieldLabel: OpenLayers.Lang.translate('mf.print.comment'), 146 name: 'comment', 147 height: 100, 148 value: 'Some comments' 149 } 150 ] 151 }, 152 border: false, 153 map: map, 154 configUrl: printConfigUrl, 155 overrides: layerOverrides 156 }, 157 { 158 xtype: 'print-multi', 159 title: 'Print multi page', 160 formConfig: { 161 labelWidth: 65, 162 bodyStyle: 'padding: 7px;', 163 defaults: { 164 width: 140, 165 listWidth: 140 166 }/*, 167 items: [ 168 { 169 xtype: 'textfield', 170 fieldLabel: 'Title', 171 name: 'title', 172 value: 'Map title' 173 } 174 ]*/ 175 }, 176 columns: [ 177 { 178 header: OpenLayers.Lang.translate('mf.print.mapTitle'), 179 dataIndex: 'mapTitle', 180 editor: new Ext.form.TextField() 181 }, 182 { 183 header: OpenLayers.Lang.translate('mf.print.comment'), 184 dataIndex: 'comment', 185 editor: new Ext.form.TextField() 186 } 187 ], 188 border: false, 189 map: map, 190 configUrl: printConfigUrl, 191 overrides: layerOverrides 192 } 193 ] 194 },{ 195 region: 'center', 196 title: 'Map', 197 layout: 'fit', 198 xtype: 'mapcomponent', 199 map: map, 200 tbar: toolbar 201 }] 202 }); 93 var viewport = new Ext.Viewport({ 94 layout:'border', 95 items:[ 96 new Ext.BoxComponent({ // raw 97 region: 'north', 98 el: 'north', 99 height: 32, 100 margins: {left: 5,top: 5} 101 }), 102 { 103 region: 'west', 104 id: 'west-panel', 105 title: 'West', 106 split: true, 107 width: 280, 108 minSize: 175, 109 maxSize: 400, 110 collapsible: true, 111 margins: '0 0 0 5', 112 layout: 'accordion', 113 defaults: { 114 collapsed: true 115 }, 116 layoutConfig:{ 117 animate: true, 118 activeOnTop: false 119 }, 120 items: [ 121 { 122 contentEl: 'help', 123 collapsed: false, 124 title: 'Help', 125 autoScroll: true, 126 bodyStyle: 'padding: 7px;', 127 border: false 128 }, 129 { 130 xtype: 'print-simple', 131 title: 'Print single page', 132 bodyStyle: 'padding: 7px;', 133 formConfig: { 134 labelWidth: 65, 135 defaults: { 136 width: 140, 137 listWidth: 140 138 }, 139 items: [ 140 { 141 xtype: 'textfield', 142 fieldLabel: OpenLayers.Lang.translate('mf.print.mapTitle'), 143 name: 'mapTitle', 144 value: 'Map title' 145 }, 146 { 147 xtype: 'textarea', 148 fieldLabel: OpenLayers.Lang.translate('mf.print.comment'), 149 name: 'comment', 150 height: 100, 151 value: 'Some comments' 152 } 153 ] 154 }, 155 border: false, 156 map: map, 157 configUrl: printConfigUrl, 158 overrides: layerOverrides 159 }, 160 { 161 xtype: 'print-multi', 162 title: 'Print multi page', 163 formConfig: { 164 labelWidth: 65, 165 bodyStyle: 'padding: 7px;', 166 defaults: { 167 width: 140, 168 listWidth: 140 169 }/*, 170 items: [ 171 { 172 xtype: 'textfield', 173 fieldLabel: 'Title', 174 name: 'title', 175 value: 'Map title' 176 } 177 ]*/ 178 }, 179 columns: [ 180 { 181 header: OpenLayers.Lang.translate('mf.print.mapTitle'), 182 dataIndex: 'mapTitle', 183 editor: new Ext.form.TextField() 184 }, 185 { 186 header: OpenLayers.Lang.translate('mf.print.comment'), 187 dataIndex: 'comment', 188 editor: new Ext.form.TextField() 189 } 190 ], 191 border: false, 192 map: map, 193 configUrl: printConfigUrl, 194 overrides: layerOverrides 195 } 196 ] 197 },{ 198 region: 'center', 199 title: 'Map', 200 layout: 'fit', 201 xtype: 'gx_mappanel', 202 map: map, 203 tbar: toolbar 204 }] 205 }); 203 206 204 map.setCenter(new OpenLayers.LonLat(8.5, 0), 3);205 });207 map.setCenter(new OpenLayers.LonLat(8.5, 0), 3); 208 }); 206 209 </script> 207 210 </head> 208 211 <body> 209 <div id="west"></div> 210 <div id="north"> 211 <p style="font-size:14pt" align="center">MapFish printer</p> 212 </div> 213 <div id="center"></div> 214 <div id="help"> 215 There are 3 tools available for the PDF generation (printing):<br/><br/> 216 <ul style="list-style: disc outside; padding-left: 20px;"> 217 <li><b>mapfish.widgets.print.SimpleForm</b>:<br /> 218 Shows a form and let the user choose the extent of a single page.<br/> 219 You can find it in the West panel.<br/><br/> 220 </li> 221 <li><b>mapfish.widgets.print.MultiPage</b>:<br /> 222 Show a table and a form and let the user choose the extent of multiple pages.<br/> 223 You can find it in the West panel.<br/><br/> 224 </li> 225 <li><b>mapfish.PrintAction</b>:<br /> 226 An Ext.Action that prints a single page with an extent that fits as good as possible the current map's extent.<br/> 227 You can find it in the toolbar over the map.<br/><br/> 228 </li> 229 </ul> 230 <p>You can enable the "summit" layer (click on the "+" on the right of the map) and it will shown on the PDF as well.</p> 231 <p>Don't hesitate to play with the Layout and DPI fields in the forms.</p> 232 </div> 212 <div id="west"></div> 213 <div id="north"> 214 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Advanced printer</h1> 215 </div> 216 <div id="center"></div> 217 <div id="help"> 218 There are 3 tools available for the PDF generation (printing):<br/><br/> 219 <ul style="list-style: disc outside; padding-left: 20px;"> 220 <li><b>mapfish.widgets.print.SimpleForm</b>:<br/> 221 Shows a form and let the user choose the extent of a single page.<br/> 222 You can find it in the West panel.<br/><br/> 223 </li> 224 <li><b>mapfish.widgets.print.MultiPage</b>:<br/> 225 Show a table and a form and let the user choose the extent of multiple pages.<br/> 226 You can find it in the West panel.<br/><br/> 227 </li> 228 <li><b>mapfish.PrintAction</b>:<br/> 229 An Ext.Action that prints a single page with an extent that fits as good as possible the current map's 230 extent.<br/> 231 You can find it in the toolbar over the map.<br/><br/> 232 </li> 233 </ul> 234 <p>You can enable the "summit" layer (click on the "+" on the right of the map) and it will shown on the PDF as 235 well.</p> 236 237 <p>Don't hesitate to play with the Layout and DPI fields in the forms.</p> 238 </div> 233 239 </body> 234 240 </html> -
MapFish/client/examples/map/index.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Map widget examples</title>4 <title>Map widget examples</title> 5 5 </head> 6 6 <body> 7 <h1 class="page-title">MapComponent widget examples</h1> 8 <div id="content"> 7 <h1 class="page-title">MapPanel widget examples</h1> 8 9 <div id="content"> 9 10 <ul> 10 <li><a href="window.html">A map in a complex layout</a></li>11 <li><a href="layout.html">A map in a complex layout (2)</a></li>12 <li><a href="toolbar.html">A map with a toolbar</a></li>13 <li><a href="multiple_maps.html">Multiple maps</a></li>14 <li><a href="layout_spherical_mercator.html">Display maps from Google, Yahoo! and OpenStreetMap</a></li>11 <li><a href="window.html">A map in a complex layout</a></li> 12 <li><a href="layout.html">A map in a complex layout (2)</a></li> 13 <li><a href="toolbar.html">A map with a toolbar</a></li> 14 <li><a href="multiple_maps.html">Multiple maps</a></li> 15 <li><a href="layout_spherical_mercator.html">Display maps from Google, Yahoo! and OpenStreetMap</a></li> 15 16 </ul> 16 </div>17 </div> 17 18 </body> 18 19 </html> 19 20 -
MapFish/client/examples/map/toolbar.html
1 1 <!DOCTYPE html> 2 2 <html> 3 <head>4 <title>Toolbar</title>5 6 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/>7 <link rel="stylesheet" type="text/css" href="../../mfbase/mapfish/mapfish.css"/>3 <head> 4 <title>Toolbar</title> 5 6 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 7 <link rel="stylesheet" type="text/css" href="../../mfbase/mapfish/mapfish.css"/> 8 8 9 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 10 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> 11 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 12 <script type="text/javascript" src="../../mfbase/ext/ext-all.js"></script> 9 10 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 11 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> 12 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 13 <script type="text/javascript" src="../../mfbase/ext/ext-all.js"></script> 13 14 14 <script type="text/javascript"> 15 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 16 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 17 var gMfLocation = "../../mfbase/mapfish/"; 18 </script> 19 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 20 <script type="text/javascript" src="../examples.js"></script> 21 22 <script type="text/javascript"> 23 // reference local blank image 24 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 25 26 // create namespace 27 Ext.namespace('toolbarExample'); 28 29 // create application 30 toolbarExample.app = function() { 31 // private vars: 32 var map, toolbar, viewport, vectorLayer; 15 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 16 17 <script type="text/javascript"> 18 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 19 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 20 var gMfLocation = "../../mfbase/mapfish/"; 21 </script> 22 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 23 <script type="text/javascript" src="../examples.js"></script> 24 25 <script type="text/javascript"> 26 // reference local blank image 27 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 28 29 // create namespace 30 Ext.namespace('toolbarExample'); 31 32 // create application 33 toolbarExample.app = function() { 34 // private vars: 35 var map, toolbar, viewport, vectorLayer; 33 36 34 // private functions 35 var createMap = function() { 36 map = new OpenLayers.Map('mymap', { 37 projection: "EPSG:4326", 38 controls: [], 39 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), 40 scales: [ 41 442943842.5, 221471921.25, 110735960.625, 55367980.3125, 27683990.15625, 42 13841995.078125, 6920997.5390625, 3460498.76953125, 1730249.384765625, 43 865124.6923828125, 432562.34619140625, 216281.17309570312, 108140.58654785156, 44 54070.29327392578 45 ] 46 }); 47 }; 48 49 var createWmsLayer = function(name, url, params, options) { 50 map.addLayer(new OpenLayers.Layer.WMS(name, url, params, options)); 51 }; 52 53 var createVectorLayer = function() { 54 vectorLayer = new OpenLayers.Layer.Vector("vector", { 55 displayInLayerSwitcher: false 56 }); 57 map.addLayer(vectorLayer); 58 59 vectorLayer.events.register('featureadded', vectorLayer, function(){ 60 var l = this.features.length; 61 var msg = (l==1) ? 'There is one feature on map' : 'There are now ' + l + ' features on map'; 62 toolbarExample.app.setStatus(msg); 63 }); 64 65 return vectorLayer; 66 }; 67 68 var addMapControls = function() { 69 // navigation control 70 var navControl = new OpenLayers.Control.Navigation({ 71 type: OpenLayers.Control.TYPE_TOGGLE, 72 zoomWheelEnabled: true 73 }); 74 map.addControl(navControl); 75 navControl.activate(); 76 }; 77 78 var createToolbar = function() { 79 toolbar = new mapfish.widgets.toolbar.Toolbar({ 80 map: map, 81 configurable: false 82 }); 83 84 // this is a quick fix for http://trac.mapfish.org/trac/mapfish/ticket/126 85 toolbar.autoHeight = false; 86 toolbar.height = 25; 87 }; 88 89 var addSeparator = function() { 90 toolbar.add(new Ext.Toolbar.Spacer()); 91 toolbar.add(new Ext.Toolbar.Separator()); 92 toolbar.add(new Ext.Toolbar.Spacer()); 93 }; 94 95 var createViewport = function() { 96 viewport = new Ext.Viewport({ 97 layout: 'border', 98 items: [ 99 new Ext.BoxComponent({ 100 region: 'north', 101 el: 'north', 102 height: 60 103 }), { 104 region: 'west', 105 title: 'LayerTree', 106 width: 200, 107 border: true, 108 margins: '5 0 0 5', 109 frame: false, 110 split: true, 111 layout: 'fit', 112 collapsible: true, 113 items: [{ 37 // private functions 38 var createMap = function() { 39 map = new OpenLayers.Map('mymap', { 40 projection: "EPSG:4326", 41 controls: [], 42 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), 43 scales: [ 44 442943842.5, 221471921.25, 110735960.625, 55367980.3125, 27683990.15625, 45 13841995.078125, 6920997.5390625, 3460498.76953125, 1730249.384765625, 46 865124.6923828125, 432562.34619140625, 216281.17309570312, 108140.58654785156, 47 54070.29327392578 48 ] 49 }); 50 }; 51 52 var createWmsLayer = function(name, url, params, options) { 53 map.addLayer(new OpenLayers.Layer.WMS(name, url, params, options)); 54 }; 55 56 var createVectorLayer = function() { 57 vectorLayer = new OpenLayers.Layer.Vector("vector", { 58 displayInLayerSwitcher: false 59 }); 60 map.addLayer(vectorLayer); 61 62 vectorLayer.events.register('featureadded', vectorLayer, function() { 63 var l = this.features.length; 64 var msg = (l == 1) ? 'There is one feature on map' : 'There are now ' + l + ' features on map'; 65 toolbarExample.app.setStatus(msg); 66 }); 67 68 return vectorLayer; 69 }; 70 71 var addMapControls = function() { 72 // navigation control 73 var navControl = new OpenLayers.Control.Navigation({ 74 type: OpenLayers.Control.TYPE_TOGGLE, 75 zoomWheelEnabled: true 76 }); 77 map.addControl(navControl); 78 navControl.activate(); 79 }; 80 81 var createToolbar = function() { 82 toolbar = new mapfish.widgets.toolbar.Toolbar({ 83 map: map, 84 configurable: false 85 }); 86 87 // this is a quick fix for http://trac.mapfish.org/trac/mapfish/ticket/126 88 toolbar.autoHeight = false; 89 toolbar.height = 25; 90 }; 91 92 var addSeparator = function() { 93 toolbar.add(new Ext.Toolbar.Spacer()); 94 toolbar.add(new Ext.Toolbar.Separator()); 95 toolbar.add(new Ext.Toolbar.Spacer()); 96 }; 97 98 var createViewport = function() { 99 viewport = new Ext.Viewport({ 100 layout: 'border', 101 items: [ 102 new Ext.BoxComponent({ 103 region: 'north', 104 el: 'north', 105 height: 32, 106 margins: {left: 5,top: 5} 107 }), { 108 region: 'west', 109 title: 'LayerTree', 110 width: 200, 111 border: true, 112 margins: '5 0 0 5', 113 frame: false, 114 split: true, 115 layout: 'fit', 116 collapsible: true, 117 items: [ 118 { 114 119 xtype: 'layertree', 115 map: map, 116 border: false 117 }] 118 },{ 119 region: 'center', 120 //title: 'map', 121 layout: 'fit', 122 frame: false, 123 border: true, 124 margins: '5 5 0 0', 125 items: [{ 126 xtype: 'mapcomponent', 120 map: map, 121 border: false 122 } 123 ] 124 },{ 125 region: 'center', 126 //title: 'map', 127 layout: 'fit', 128 frame: false, 129 border: true, 130 margins: '5 5 0 0', 131 items: [ 132 { 133 xtype: 'gx_mappanel', 127 134 map: map, 128 135 tbar: toolbar, 129 136 border: false 130 }] 131 },{ 132 region: 'south', 133 id: 'statusBar', 134 border: false, 135 bodyStyle: 'text-align:left;padding:0px;', 136 height: 25, 137 margins: '5 0 0 0', 138 frame: true, 139 html: 'a status bar' 140 } 141 ] 142 }); 143 }; 144 145 var setToolbarContent = function() { 146 147 toolbar.addControl( 137 } 138 ] 139 },{ 140 region: 'south', 141 id: 'statusBar', 142 border: false, 143 bodyStyle: 'text-align:left;padding:0px;', 144 height: 25, 145 margins: '5 0 0 0', 146 frame: true, 147 html: 'a status bar' 148 } 149 ] 150 }); 151 }; 152 153 var setToolbarContent = function() { 154 155 toolbar.addControl( 148 156 new OpenLayers.Control.ZoomToMaxExtent({ 149 157 map: map, 150 158 title: 'Zoom to maximum map extent' 151 159 }), { 152 iconCls: 'zoomfull',153 toggleGroup: 'map'154 }155 );156 157 addSeparator();158 159 toolbar.addControl(160 iconCls: 'zoomfull', 161 toggleGroup: 'map' 162 } 163 ); 164 165 addSeparator(); 166 167 toolbar.addControl( 160 168 new OpenLayers.Control.ZoomBox({ 161 169 title: 'Zoom in: click in the map or use the left mouse button and drag to create a rectangle' 162 170 }), { 163 iconCls: 'zoomin',164 toggleGroup: 'map'165 }166 );167 168 toolbar.addControl(171 iconCls: 'zoomin', 172 toggleGroup: 'map' 173 } 174 ); 175 176 toolbar.addControl( 169 177 new OpenLayers.Control.ZoomBox({ 170 178 out: true, 171 179 title: 'Zoom out: click in the map or use the left mouse button and drag to create a rectangle' 172 180 }), { 173 iconCls: 'zoomout',174 toggleGroup: 'map'175 }176 );177 178 toolbar.addControl(181 iconCls: 'zoomout', 182 toggleGroup: 'map' 183 } 184 ); 185 186 toolbar.addControl( 179 187 new OpenLayers.Control.DragPan({ 180 188 isDefault: true, 181 189 title: 'Pan map: keep the left mouse button pressed and drag the map' 182 190 }), { 183 iconCls: 'pan',184 toggleGroup: 'map'185 }186 );187 188 addSeparator();189 190 toolbar.addControl(191 iconCls: 'pan', 192 toggleGroup: 'map' 193 } 194 ); 195 196 addSeparator(); 197 198 toolbar.addControl( 191 199 new OpenLayers.Control.DrawFeature(vectorLayer, OpenLayers.Handler.Point, { 192 200 title: 'Draw a point on the map' 193 201 }), { 194 iconCls: 'drawpoint',195 toggleGroup: 'map'196 }197 );198 199 toolbar.addControl(202 iconCls: 'drawpoint', 203 toggleGroup: 'map' 204 } 205 ); 206 207 toolbar.addControl( 200 208 new OpenLayers.Control.DrawFeature(vectorLayer, OpenLayers.Handler.Path, { 201 209 title: 'Draw a linestring on the map' 202 210 }), { 203 iconCls: 'drawline',204 toggleGroup: 'map'205 }206 );207 208 toolbar.addControl(211 iconCls: 'drawline', 212 toggleGroup: 'map' 213 } 214 ); 215 216 toolbar.addControl( 209 217 new OpenLayers.Control.DrawFeature(vectorLayer, OpenLayers.Handler.Polygon, { 210 218 title: 'Draw a polygon on the map' 211 219 }), { 212 iconCls: 'drawpolygon',213 toggleGroup: 'map'214 }215 );216 217 addSeparator();218 219 var nav = new OpenLayers.Control.NavigationHistory();220 map.addControl(nav);221 nav.activate();222 223 var buttonPrevious = new Ext.Toolbar.Button({224 iconCls: 'back',225 tooltip: 'Previous view',226 disabled: true,227 handler: nav.previous.trigger228 });229 230 var buttonNext = new Ext.Toolbar.Button({231 iconCls: 'next',232 tooltip: 'Next view',233 disabled: true,234 handler: nav.next.trigger235 });236 237 toolbar.add(buttonPrevious);238 toolbar.add(buttonNext);239 240 nav.previous.events.register(241 "activate", 220 iconCls: 'drawpolygon', 221 toggleGroup: 'map' 222 } 223 ); 224 225 addSeparator(); 226 227 var nav = new OpenLayers.Control.NavigationHistory(); 228 map.addControl(nav); 229 nav.activate(); 230 231 var buttonPrevious = new Ext.Toolbar.Button({ 232 iconCls: 'back', 233 tooltip: 'Previous view', 234 disabled: true, 235 handler: nav.previous.trigger 236 }); 237 238 var buttonNext = new Ext.Toolbar.Button({ 239 iconCls: 'next', 240 tooltip: 'Next view', 241 disabled: true, 242 handler: nav.next.trigger 243 }); 244 245 toolbar.add(buttonPrevious); 246 toolbar.add(buttonNext); 247 248 nav.previous.events.register( 249 "activate", 242 250 buttonPrevious, 243 function() { 244 this.setDisabled(false); 251 function() { 252 this.setDisabled(false); 245 253 } 246 );247 248 nav.previous.events.register(249 "deactivate", 254 ); 255 256 nav.previous.events.register( 257 "deactivate", 250 258 buttonPrevious, 251 function() { 252 this.setDisabled(true); 259 function() { 260 this.setDisabled(true); 253 261 } 254 );255 256 nav.next.events.register(257 "activate", 258 buttonNext, 259 function() {260 this.setDisabled(false); 262 ); 263 264 nav.next.events.register( 265 "activate", 266 buttonNext, 267 function() { 268 this.setDisabled(false); 261 269 } 262 );263 264 nav.next.events.register(265 "deactivate", 270 ); 271 272 nav.next.events.register( 273 "deactivate", 266 274 buttonNext, 267 function() { 268 this.setDisabled(true); 275 function() { 276 this.setDisabled(true); 269 277 } 270 );271 272 addSeparator();273 }274 275 // public space:276 return {277 // for debug, we make this property public:278 vector: null,279 280 setStatus: function(text) {281 Ext.getCmp('statusBar').body.dom.innerHTML = text;282 },283 284 init: function() {285 createMap();286 createWmsLayer(287 "OpenLayers WMS", 278 ); 279 280 addSeparator(); 281 } 282 283 // public space: 284 return { 285 // for debug, we make this property public: 286 vector: null, 287 288 setStatus: function(text) { 289 Ext.getCmp('statusBar').body.dom.innerHTML = text; 290 }, 291 292 init: function() { 293 createMap(); 294 createWmsLayer( 295 "OpenLayers WMS", 288 296 "http://labs.metacarta.com/wms/vmap0", 289 {layers: 'basic'},290 {isBaseLayer: true}291 );292 createWmsLayer(297 {layers: 'basic'}, 298 {isBaseLayer: true} 299 ); 300 createWmsLayer( 293 301 "Summits", 294 302 "http://demo.mapfish.org/mapfishsample/trunk/wms", { 295 layers: ['summits'], 296 format: 'image/png', 297 transparent: true, 298 singleTile: true 299 } 300 ); 301 302 this.vector = createVectorLayer(); 303 // vector layer is now accessible via toolbarExample.app.vector 304 305 addMapControls(); 306 createToolbar(); 307 createViewport(); 308 309 map.setCenter(new OpenLayers.LonLat(5,45), 6); 310 311 setToolbarContent(); 312 toolbar.activate(); 313 314 // display some text in the status bar: 315 this.setStatus('Status: example app ready'); 316 } 317 }; 318 }(); // end of app 319 320 Ext.onReady(toolbarExample.app.init, toolbarExample.app); 321 322 </script> 323 <style type="text/css"> 324 .float-left { 325 float: left; 326 } 327 .clear-left { 328 clear: left; 329 } 330 #north { 331 // uncomment this line to insert a banner : 332 /*background:transparent url(images/banner.jpg) repeat-x scroll 0 0;*/ 333 } 334 </style> 335 </head> 303 layers: ['summits'], 304 format: 'image/png', 305 transparent: true, 306 singleTile: true 307 } 308 ); 309 310 this.vector = createVectorLayer(); 311 // vector layer is now accessible via toolbarExample.app.vector 312 313 addMapControls(); 314 createToolbar(); 315 createViewport(); 316 317 map.setCenter(new OpenLayers.LonLat(5, 45), 6); 318 319 setToolbarContent(); 320 toolbar.activate(); 321 322 // display some text in the status bar: 323 this.setStatus('Status: example app ready'); 324 } 325 }; 326 }(); // end of app 327 328 Ext.onReady(toolbarExample.app.init, toolbarExample.app); 329 330 </script> 331 <style type="text/css"> 332 .float-left { 333 float: left; 334 } 335 336 .clear-left { 337 clear: left; 338 } 339 340 #north { 341 / / uncomment this line to insert a banner : /*background:transparent url(images/banner.jpg) repeat-x scroll 0 0;*/ 342 } 343 </style> 344 </head> 336 345 337 <body> 338 <div id="north">your banner here</div> 339 <div id="mymap"></div> 340 </body> 346 <body> 347 <div id="north"> 348 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Toolbar with MapPanel 349 example</h1> 350 </div> 351 <div id="mymap"></div> 352 </body> 341 353 </html> -
MapFish/client/examples/shortcuts/shortcuts.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Shortcuts simple example</title>5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />4 <title>Shortcuts simple example</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 13 <script type="text/javascript"> 14 // Because of a bug in Firefox 2 we need to specify the MapFish base path.15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128216 var gMfLocation = "../../mfbase/mapfish/";14 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 16 var gMfLocation = "../../mfbase/mapfish/"; 17 17 </script> 18 18 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 19 19 <script type="text/javascript" src="../examples.js"></script> 20 20 21 21 <style type="text/css"> 22 html, body { 23 font:normal 12px verdana; 24 margin: 10px; 25 padding:0; 26 border:0 none; 27 overflow:hidden; 28 height:100%; 29 } 30 #olmap { 31 width: 450px; 32 height: 300px; 33 border: 1px solid #aaa; 34 } 22 html, body { 23 font: normal 12px verdana; 24 margin: 10px; 25 padding: 0; 26 border: 0 none; 27 overflow: hidden; 28 height: 100%; 29 } 30 31 #olmap { 32 width: 450px; 33 height: 300px; 34 border: 1px solid #aaa; 35 } 35 36 </style> 36 <script type="text/javascript">37 38 // reference local blank image39 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';40 41 var map;42 43 Ext.onReady(function() {44 map = new OpenLayers.Map('olmap');37 <script type="text/javascript"> 38 39 // reference local blank image 40 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 41 42 var map; 43 44 Ext.onReady(function() { 45 map = new OpenLayers.Map('olmap'); 45 46 46 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",47 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});47 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 48 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 48 49 49 map.addLayers([wms]); 50 map.addControl(new OpenLayers.Control.LayerSwitcher()); 51 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 52 53 var store = new Ext.data.SimpleStore({ 54 fields: ['value', 'text', 'bbox'], 55 data : [['OC', 'Oceana', new OpenLayers.Bounds(56.0234375, -72.53125, 214.2265625, 32.9375)], 50 map.addLayers([wms]); 51 map.addControl(new OpenLayers.Control.LayerSwitcher()); 52 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 53 54 var store = new Ext.data.SimpleStore({ 55 fields: ['value', 'text', 'bbox'], 56 data : [ 57 ['OC', 'Oceana', new OpenLayers.Bounds(56.0234375, -72.53125, 214.2265625, 32.9375)], 56 58 ['NA', 'North America', new OpenLayers.Bounds(-186.37890625, -2.21875, -28.17578125, 103.25)], 57 59 ['SA', 'South America', new OpenLayers.Bounds(-146.828125, -71.828125, 11.375, 33.640625)], 58 60 ['AF', 'Africa', new OpenLayers.Bounds(-58.9375, -51.7890625, 99.265625, 53.6796875)], 59 61 ['EU', 'Europe', new OpenLayers.Bounds(-23.078125, 26.2578125, 56.0234375, 78.9921875)], 60 ['AS', 'Asia', new OpenLayers.Bounds(15.59375, -21.90625, 173.796875, 83.5625)]] 61 }); 62 63 var shortcuts = new mapfish.widgets.Shortcuts({ 64 map: map, 65 el: 'myDiv', 66 store: store, 67 templates: { 68 header: new Ext.Template("Choose a continent in the list"), 69 footer: new Ext.Template("The map will automatically center to this location") 70 } 71 }); 72 shortcuts.render(); 73 74 }); 75 </script> 62 ['AS', 'Asia', new OpenLayers.Bounds(15.59375, -21.90625, 173.796875, 83.5625)] 63 ] 64 }); 65 66 var shortcuts = new mapfish.widgets.Shortcuts({ 67 map: map, 68 el: 'myDiv', 69 store: store, 70 templates: { 71 header: new Ext.Template("Choose a continent in the list"), 72 footer: new Ext.Template("The map will automatically center to this location") 73 } 74 }); 75 shortcuts.render(); 76 77 }); 78 </script> 76 79 </head> 77 80 <body> 78 <div id="myDiv">79 </div>80 <div id="olmap"></div>81 </body>81 <div id="myDiv"> 82 </div> 83 <div id="olmap"></div> 84 </body> 82 85 </html> -
MapFish/client/examples/map/multiple_maps.html
1 1 <!DOCTYPE html> 2 2 <html> 3 <head>4 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />3 <head> 4 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 5 5 6 6 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 10 10 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 11 11 12 12 <script type="text/javascript"> 13 // Because of a bug in Firefox 2 we need to specify the MapFish base path.14 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128215 var gMfLocation = "../../mfbase/mapfish/";13 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 14 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 15 var gMfLocation = "../../mfbase/mapfish/"; 16 16 </script> 17 17 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 18 18 <script type="text/javascript" src="../examples.js"></script> 19 19 20 20 <script type="text/javascript"> 21 22 // reference local blank image23 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';21 22 // reference local blank image 23 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 24 24 25 function createFirstMap(e) {26 var map = new OpenLayers.Map(e);27 var layer = new OpenLayers.Layer.WMS("OpenLayers WMS",28 "http://labs.metacarta.com/wms/vmap0",29 {layers: 'basic'});30 map.addLayer(layer);31 map.setCenter(new OpenLayers.LonLat(5, 40), 5);32 33 return map;34 }25 function createFirstMap(e) { 26 var map = new OpenLayers.Map(e); 27 var layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 28 "http://labs.metacarta.com/wms/vmap0", 29 {layers: 'basic'}); 30 map.addLayer(layer); 31 map.setCenter(new OpenLayers.LonLat(5, 40), 5); 32 33 return map; 34 } 35 35 36 function createSecondMap(e) {37 var map = new OpenLayers.Map(e);38 39 var ol_wms = new OpenLayers.Layer.WMS("World Map",40 "http://labs.metacarta.com/wms-c/Basic.py?",41 {layers: 'basic', format: 'image/png' });42 43 var jpl_wms = new OpenLayers.Layer.WMS("Satellite",44 "http://labs.metacarta.com/wms-c/Basic.py?",45 {layers: 'satellite', format: 'image/png' });46 var dm_wms = new OpenLayers.Layer.WMS("Canada",47 "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",48 {layers: "bathymetry,land_fn,park,drain_fn,drainage," +49 "prov_bound,fedlimit,rail,road,popplace",50 transparent: "true", format: "image/png" });51 dm_wms.setVisibility(false);52 map.addLayers([jpl_wms, ol_wms, dm_wms]);53 map.setCenter(new OpenLayers.LonLat(20, 35), 5);54 55 return map;56 }36 function createSecondMap(e) { 37 var map = new OpenLayers.Map(e); 38 39 var ol_wms = new OpenLayers.Layer.WMS("World Map", 40 "http://labs.metacarta.com/wms-c/Basic.py?", 41 {layers: 'basic', format: 'image/png' }); 42 43 var jpl_wms = new OpenLayers.Layer.WMS("Satellite", 44 "http://labs.metacarta.com/wms-c/Basic.py?", 45 {layers: 'satellite', format: 'image/png' }); 46 var dm_wms = new OpenLayers.Layer.WMS("Canada", 47 "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap", 48 {layers: "bathymetry,land_fn,park,drain_fn,drainage," + 49 "prov_bound,fedlimit,rail,road,popplace", 50 transparent: "true", format: "image/png" }); 51 dm_wms.setVisibility(false); 52 map.addLayers([jpl_wms, ol_wms, dm_wms]); 53 map.setCenter(new OpenLayers.LonLat(20, 35), 5); 54 55 return map; 56 } 57 57 58 Ext.onReady(function() {59 var map, tree;60 61 map = createFirstMap("firstMap");62 tree = new mapfish.widgets.LayerTree({map: map, el: 'firstTree'});63 tree.render();58 Ext.onReady(function() { 59 var map, tree; 60 61 map = createFirstMap("firstMap"); 62 tree = new mapfish.widgets.LayerTree({map: map, el: 'firstTree'}); 63 tree.render(); 64 64 65 map = createSecondMap("secondMap");66 tree = new mapfish.widgets.LayerTree({map: map, el: 'secondTree'});67 tree.render();68 69 }, this);65 map = createSecondMap("secondMap"); 66 tree = new mapfish.widgets.LayerTree({map: map, el: 'secondTree'}); 67 tree.render(); 68 69 }, this); 70 70 </script> 71 71 72 72 <style type="text/css"> 73 73 .map, .mapContainer, #firstMap, #secondMap { 74 width: 300px;75 height: 200px;76 border: 1px solid #999;74 width: 300px; 75 height: 200px; 76 border: 1px solid #999; 77 77 } 78 78 79 .tree, #firstTree, #secondTree { 79 width: 500px;80 height: 100px;80 width: 500px; 81 height: 100px; 81 82 } 83 82 84 .x-panel-body { 83 border: none !important;85 border: none !important; 84 86 } 85 87 </style> 86 </head>88 </head> 87 89 88 <body>89 <div id="firstMap" class="map"></div>90 <div id="firstTree" class="tree"></div>90 <body> 91 <div id="firstMap" class="map"></div> 92 <div id="firstTree" class="tree"></div> 91 93 92 <div id="secondMap" class="map"></div>93 <div id="secondTree" class="tree"></div>94 </body>94 <div id="secondMap" class="map"></div> 95 <div id="secondTree" class="tree"></div> 96 </body> 95 97 </html> -
MapFish/client/examples/map/layout_spherical_mercator.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Google, Yahoo! and OSM maps</title>5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />4 <title>Google, Yahoo! and OSM maps</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 10 10 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 14 13 15 <script type="text/javascript"> 14 // Because of a bug in Firefox 2 we need to specify the MapFish base path.15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128216 var gMfLocation = "../../mfbase/mapfish/";16 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 17 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 18 var gMfLocation = "../../mfbase/mapfish/"; 17 19 </script> 18 20 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 19 21 <script type="text/javascript" src="../examples.js"></script> 20 22 21 23 <script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script> 22 24 <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA05C9249WzNJ_bo8JW1_d1RR4mkyLzoxNxIarp_9bfNMlpzk1lBTKyrzDeVpecEf3n5k8eLOy20OHKg'></script> 23 25 <script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script> 24 25 <style type="text/css">26 html, body {27 font: normal 12px verdana;28 margin: 0;29 padding: 0;30 border: 0 none;31 overflow: hidden;32 height: 100%;33 }26 27 <style type="text/css"> 28 html, body { 29 font: normal 12px verdana; 30 margin: 0; 31 padding: 0; 32 border: 0 none; 33 overflow: hidden; 34 height: 100%; 35 } 34 36 </style> 35 <script type="text/javascript">36 37 // reference local blank image38 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';39 40 Ext.onReady(function() {41 42 var options = {43 projection: "EPSG:900913",44 units: "m",45 maxResolution: 156543.0339,46 maxExtent: new OpenLayers.Bounds(-20037508, -20037508,47 20037508, 20037508.34)48 };49 map = new OpenLayers.Map('center', options);37 <script type="text/javascript"> 38 39 // reference local blank image 40 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 41 42 Ext.onReady(function() { 43 44 var options = { 45 projection: "EPSG:900913", 46 units: "m", 47 maxResolution: 156543.0339, 48 maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 49 20037508, 20037508.34) 50 }; 51 map = new OpenLayers.Map('center', options); 50 52 51 // create Google Mercator layers52 var gmap = new OpenLayers.Layer.Google(53 "Google Streets",53 // create Google Mercator layers 54 var gmap = new OpenLayers.Layer.Google( 55 "Google Streets", 54 56 {'sphericalMercator': true} 55 );57 ); 56 58 57 // create Yahoo layer58 var yahoo = new OpenLayers.Layer.Yahoo(59 "Yahoo Street",59 // create Yahoo layer 60 var yahoo = new OpenLayers.Layer.Yahoo( 61 "Yahoo Street", 60 62 {'sphericalMercator': true} 61 );62 var yahoosat = new OpenLayers.Layer.Yahoo(63 "Yahoo Sattelite",63 ); 64 var yahoosat = new OpenLayers.Layer.Yahoo( 65 "Yahoo Sattelite", 64 66 {'type': YAHOO_MAP_SAT, 'sphericalMercator': true} 65 );66 var yahoohyb = new OpenLayers.Layer.Yahoo(67 "Yahoo Hybrid",67 ); 68 var yahoohyb = new OpenLayers.Layer.Yahoo( 69 "Yahoo Hybrid", 68 70 {'type': YAHOO_MAP_HYB, 'sphericalMercator': true} 69 );71 ); 70 72 71 // create OSM layer72 var mapnik = new OpenLayers.Layer.TMS(73 "OpenStreetMap",74 "http://tile.openstreetmap.org/",73 // create OSM layer 74 var mapnik = new OpenLayers.Layer.TMS( 75 "OpenStreetMap", 76 "http://tile.openstreetmap.org/", 75 77 { 76 78 type: 'png', getURL: osm_getTileURL, 77 79 displayOutsideMaxExtent: true 78 80 } 79 );81 ); 80 82 81 map.addLayers([gmap, yahoo, yahoosat, yahoohyb, mapnik]);82 83 map.setCenter(new OpenLayers.LonLat(17, 2), 2);83 map.addLayers([gmap, yahoo, yahoosat, yahoohyb, mapnik]); 84 85 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 84 86 85 86 var mapcomponent = new mapfish.widgets.MapComponent({map: map}); 87 88 var viewport = new Ext.Viewport({ 89 layout:'border', 90 items:[ 91 new Ext.BoxComponent({ // raw 92 region: 'north', 93 el: 'north', 94 height: 32 95 }),{ 96 region: 'south', 97 contentEl: 'south', 98 split: true, 99 height: 100, 100 minSize: 100, 101 maxSize: 200, 102 collapsible: true, 103 title: 'South', 104 margins: '0 0 0 0' 105 },{ 106 region: 'west', 107 id: 'west-panel', 108 title: 'West', 109 split: true, 110 width: 200, 111 minSize: 175, 112 maxSize: 400, 113 collapsible: true, 114 margins: '0 0 0 5', 115 layout: 'accordion', 116 layoutConfig:{ 117 animate: true 118 }, 119 items: [{ 120 title: 'Layers', 121 region: 'north', 122 height: 100, 123 xtype: 'layertree', 124 map: map 125 },{ 126 title: 'Settings', 127 html: '<p>Some settings in here.</p>', 128 border: false, 129 iconCls: 'settings' 130 }] 131 },{ 132 region: 'center', 133 title: 'Map', 134 layout: 'fit', 135 items: mapcomponent 136 } 137 ] 138 }); 139 }); 140 87 var mapPanel = new GeoExt.MapPanel({map: map}); 88 89 var viewport = new Ext.Viewport({ 90 layout:'border', 91 items:[ 92 new Ext.BoxComponent({ // raw 93 region: 'north', 94 el: 'north', 95 height: 32, 96 margins: {left: 5,top: 5} 97 }),{ 98 region: 'south', 99 contentEl: 'south', 100 split: true, 101 height: 100, 102 minSize: 100, 103 maxSize: 200, 104 collapsible: true, 105 title: 'South', 106 margins: '0 0 0 0' 107 },{ 108 region: 'west', 109 id: 'west-panel', 110 title: 'West', 111 split: true, 112 width: 200, 113 minSize: 175, 114 maxSize: 400, 115 collapsible: true, 116 margins: '0 0 0 5', 117 layout: 'accordion', 118 layoutConfig:{ 119 animate: true 120 }, 121 items: [ 122 { 123 title: 'Layers', 124 region: 'north', 125 height: 100, 126 xtype: 'layertree', 127 map: map 128 }, 129 { 130 title: 'Settings', 131 html: '<p>Some settings in here.</p>', 132 border: false, 133 iconCls: 'settings' 134 } 135 ] 136 },{ 137 region: 'center', 138 title: 'Map', 139 layout: 'fit', 140 items: mapPanel 141 } 142 ] 143 }); 144 }); 145 141 146 142 function osm_getTileURL(bounds) {143 var res = this.map.getResolution();144 var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));145 var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));146 var z = this.map.getZoom();147 var limit = Math.pow(2, z);148 149 if (y < 0 || y >= limit) {150 return OpenLayers.Util.getImagesLocation() + "404.png";151 } else {152 x = ((x % limit) + limit) % limit;153 return this.url + z + "/" + x + "/" + y + "." + this.type;154 }155 }156 </script>147 function osm_getTileURL(bounds) { 148 var res = this.map.getResolution(); 149 var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); 150 var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)); 151 var z = this.map.getZoom(); 152 var limit = Math.pow(2, z); 153 154 if (y < 0 || y >= limit) { 155 return OpenLayers.Util.getImagesLocation() + "404.png"; 156 } else { 157 x = ((x % limit) + limit) % limit; 158 return this.url + z + "/" + x + "/" + y + "." + this.type; 159 } 160 } 161 </script> 157 162 </head> 158 163 <body> 159 <div id="north"> 160 <p>MapFish</p> 161 </div> 162 <div id="center"> 163 </div> 164 <div id="south"> 164 <div id="north"> 165 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Map panel in spherical 166 mercator example</h1> 167 </div> 168 <div id="center"> 169 </div> 170 <div id="south"> 165 171 <p>south - generally for informational stuff, also could be for status bar</p> 166 </div>172 </div> 167 173 168 </body>174 </body> 169 175 </html> -
MapFish/client/examples/map/layout.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Map in a Complex Layout</title>5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />4 <title>Map in a Complex Layout</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 10 10 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 14 13 15 <script type="text/javascript"> 14 // Because of a bug in Firefox 2 we need to specify the MapFish base path.15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128216 var gMfLocation = "../../mfbase/mapfish/";16 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 17 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 18 var gMfLocation = "../../mfbase/mapfish/"; 17 19 </script> 18 20 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 19 21 <script type="text/javascript" src="../examples.js"></script> 20 22 21 23 <style type="text/css"> 22 html, body {23 font: normal 12px verdana;24 margin: 0;25 padding: 0;26 border: 0 none;27 overflow: hidden;28 height: 100%;29 }24 html, body { 25 font: normal 12px verdana; 26 margin: 0; 27 padding: 0; 28 border: 0 none; 29 overflow: hidden; 30 height: 100%; 31 } 30 32 </style> 31 33 <script type="text/javascript"> 32 33 // reference local blank image34 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';35 36 Ext.onReady(function() {37 38 var map = new OpenLayers.Map($('center'));34 35 // reference local blank image 36 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 37 38 Ext.onReady(function() { 39 40 var map = new OpenLayers.Map($('center')); 39 41 40 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",41 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});42 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 43 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 42 44 43 map.addLayers([wms]);44 map.addControl(new OpenLayers.Control.LayerSwitcher());45 map.setCenter(new OpenLayers.LonLat(17, 2), 2);45 map.addLayers([wms]); 46 map.addControl(new OpenLayers.Control.LayerSwitcher()); 47 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 46 48 47 var viewport = new Ext.Viewport({ 48 layout:'border', 49 items:[ 50 new Ext.BoxComponent({ // raw 51 region: 'north', 52 el: 'north', 53 height: 32 54 }),{ 55 region: 'south', 56 contentEl: 'south', 57 split: true, 58 height: 100, 59 minSize: 100, 60 maxSize: 200, 61 collapsible: true, 62 title: 'South', 63 margins: '0 0 0 0' 64 },{ 65 region: 'west', 66 id: 'west-panel', 67 title: 'West', 68 split: true, 69 width: 200, 70 minSize: 175, 71 maxSize: 400, 72 collapsible: true, 73 margins: '0 0 0 5', 74 layout: 'accordion', 75 layoutConfig:{ 76 animate: true 77 }, 78 items: [{ 79 contentEl: 'west', 80 title: 'Layer Tree', 81 border: false, 82 xtype: 'layertree', 83 map: map 84 },{ 85 title: 'Settings', 86 html: '<p>Some settings in here.</p>', 87 border: false 88 },{ 89 id: 'recenter-widget', 90 title: 'Recenter', 91 xtype: 'coordsrecenter', 92 map: map, 93 labelAlign: 'top', 94 hideMode: 'offsets', 95 showCenter: true, // boolean, indicates if a symbol must be shown at the new center 96 scales: [1000000, 2500000, 5000000, 10000000, 25000000], 97 bodyStyle: 'padding: 5px', 98 defaults: { 99 width: 170 100 } 101 }] 102 },{ 103 region: 'center', 104 title: 'Map', 105 layout: 'fit', 106 xtype: 'mapcomponent', 107 map: map 108 } 109 ] 110 }); 111 }); 49 var viewport = new Ext.Viewport({ 50 layout:'border', 51 items:[ 52 new Ext.BoxComponent({ // raw 53 region: 'north', 54 el: 'north', 55 height: 32, 56 margins: {left: 5,top: 5} 57 }),{ 58 region: 'south', 59 contentEl: 'south', 60 split: true, 61 height: 100, 62 minSize: 100, 63 maxSize: 200, 64 collapsible: true, 65 title: 'South', 66 margins: '0 0 0 0' 67 },{ 68 region: 'west', 69 id: 'west-panel', 70 title: 'West', 71 split: true, 72 width: 200, 73 minSize: 175, 74 maxSize: 400, 75 collapsible: true, 76 margins: '0 0 0 5', 77 layout: 'accordion', 78 layoutConfig:{ 79 animate: true 80 }, 81 items: [ 82 { 83 contentEl: 'west', 84 title: 'Layer Tree', 85 border: false, 86 xtype: 'layertree', 87 map: map 88 }, 89 { 90 title: 'Settings', 91 html: '<p>Some settings in here.</p>', 92 border: false 93 }, 94 { 95 id: 'recenter-widget', 96 title: 'Recenter', 97 xtype: 'coordsrecenter', 98 map: map, 99 labelAlign: 'top', 100 hideMode: 'offsets', 101 showCenter: true, 102 // boolean, indicates if a symbol must be shown at the new center 103 scales: [1000000, 2500000, 5000000, 10000000, 25000000], 104 bodyStyle: 'padding: 5px', 105 defaults: { 106 width: 170 107 } 108 } 109 ] 110 },{ 111 region: 'center', 112 title: 'Map', 113 layout: 'fit', 114 xtype: 'gx_mappanel', 115 map: map 116 } 117 ] 118 }); 119 }); 112 120 </script> 113 121 </head> 114 122 <body> 115 <div id="west"></div>116 <div id="north">117 < p>MapFish</p>118 </div>119 <div id="center"></div>120 <div id="south">123 <div id="west"></div> 124 <div id="north"> 125 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Map panel example</h1> 126 </div> 127 <div id="center"></div> 128 <div id="south"> 121 129 <p>south - generally for informational stuff, also could be for status bar</p> 122 </div>130 </div> 123 131 124 </body>132 </body> 125 133 </html> -
MapFish/client/examples/map/window.html
1 1 <html> 2 2 <head> 3 <title>Map in a Complex Layout</title>4 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />3 <title>Map in a Complex Layout</title> 4 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 5 5 6 6 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 9 9 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 10 10 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 11 11 12 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 13 12 14 <script type="text/javascript"> 13 // Because of a bug in Firefox 2 we need to specify the MapFish base path.14 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128215 var gMfLocation = "../../mfbase/mapfish/";15 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 16 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 17 var gMfLocation = "../../mfbase/mapfish/"; 16 18 </script> 17 19 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 18 20 <script type="text/javascript" src="../examples.js"></script> 19 20 <style type="text/css"> 21 html, body { 22 font: normal 12px verdana; 23 margin: 0; 24 padding: 0; 25 border: 0 none; 26 overflow: hidden; 27 height: 100%; 28 } 21 22 <style type="text/css"> 23 html, body { 24 font: normal 12px verdana; 25 margin: 0; 26 padding: 0; 27 border: 0 none; 28 overflow: hidden; 29 height: 100%; 30 } 31 32 #north { 33 margin-top: 5px; 34 margin-left: 5px; 35 } 29 36 </style> 30 <script type="text/javascript">31 32 // reference local blank image33 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';34 35 Ext.onReady(function(){36 37 var map = new OpenLayers.Map('olmap');37 <script type="text/javascript"> 38 39 // reference local blank image 40 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 41 42 Ext.onReady(function() { 43 44 var map = new OpenLayers.Map('olmap'); 38 45 39 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",40 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});46 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 47 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 41 48 42 map.addLayers([wms]); 43 map.addControl(new OpenLayers.Control.LayerSwitcher()); 44 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 45 46 var window = new Ext.Window({ 47 title: 'Map', 48 width: 500, 49 height: 300, 50 minWidth: 300, 51 minHeight: 200, 52 layout: 'fit', 53 plain: true, 54 bodyStyle: 'padding:5px;', 55 items: [{ 56 xtype: 'mapcomponent', 57 map: map 58 }] 59 }); 60 window.show(); 61 62 63 var store = new Ext.data.SimpleStore({ 64 fields: ['value', 'text', 'bbox'], 65 data : [['OC', 'Oceana', new OpenLayers.Bounds(56.0234375, -72.53125, 214.2265625, 32.9375)], 49 map.addLayers([wms]); 50 map.addControl(new OpenLayers.Control.LayerSwitcher()); 51 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 52 53 var window = new Ext.Window({ 54 title: 'Map', 55 width: 500, 56 height: 300, 57 minWidth: 300, 58 minHeight: 200, 59 layout: 'fit', 60 plain: true, 61 bodyStyle: 'padding:5px;', 62 items: [ 63 { 64 xtype: 'gx_mappanel', 65 map: map 66 } 67 ] 68 }); 69 window.show(); 70 71 72 var store = new Ext.data.SimpleStore({ 73 fields: ['value', 'text', 'bbox'], 74 data : [ 75 ['OC', 'Oceana', new OpenLayers.Bounds(56.0234375, -72.53125, 214.2265625, 32.9375)], 66 76 ['NA', 'North America', new OpenLayers.Bounds(-186.37890625, -2.21875, -28.17578125, 103.25)], 67 77 ['SA', 'South America', new OpenLayers.Bounds(-146.828125, -71.828125, 11.375, 33.640625)], 68 78 ['AF', 'Africa', new OpenLayers.Bounds(-58.9375, -51.7890625, 99.265625, 53.6796875)], 69 79 ['EU', 'Europe', new OpenLayers.Bounds(-23.078125, 26.2578125, 56.0234375, 78.9921875)], 70 ['AS', 'Asia', new OpenLayers.Bounds(15.59375, -21.90625, 173.796875, 83.5625)]] 71 }); 72 73 var window = new Ext.Window({ 74 title: 'Shortcuts', 75 width: 200, 76 height: 100, 77 minWidth: 200, 78 minHeight: 100, 79 layout: 'fit', 80 plain: true, 81 bodyStyle: 'padding: 5px;', 82 items: [{ 83 xtype: 'shortcuts', 84 map: map, 85 store: store, 86 templates: { 87 header: new Ext.Template("Choose a continent in the list"), 88 footer: new Ext.Template("The map will automatically center to this location") 89 } 90 }] 91 }); 92 window.setPagePosition(20, 40); 80 ['AS', 'Asia', new OpenLayers.Bounds(15.59375, -21.90625, 173.796875, 83.5625)] 81 ] 82 }); 83 84 var window = new Ext.Window({ 85 title: 'Shortcuts', 86 width: 200, 87 height: 100, 88 minWidth: 200, 89 minHeight: 100, 90 layout: 'fit', 91 plain: true, 92 bodyStyle: 'padding: 5px;', 93 items: [ 94 { 95 xtype: 'shortcuts', 96 map: map, 97 store: store, 98 templates: { 99 header: new Ext.Template("Choose a continent in the list"), 100 footer: new Ext.Template("The map will automatically center to this location") 101 } 102 } 103 ] 104 }); 105 window.setPagePosition(20, 40); 93 106 94 window.show();95 });96 </script>107 window.show(); 108 }); 109 </script> 97 110 </head> 98 111 <body> 99 <!-- 100 body element must not start with text to prevent IE bug 101 http://extjs.com/forum/showthread.php?t=7912&highlight=createRange 102 --> 103 <h1>MapFish example</h1> 104 This example shows how to use the MapComponent class to integrate a OL map into a window layout. 105 <div id="olmap"> 106 </div> 112 <!-- 113 body element must not start with text to prevent IE bug 114 http://extjs.com/forum/showthread.php?t=7912&highlight=createRange 115 --> 116 <div id="north"> 117 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Map panel example</h1> 118 </div> 119 <div id="olmap"> 120 </div> 107 121 108 </body>122 </body> 109 123 </html> -
MapFish/client/examples/recenter/index.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Recenter examples</title>4 <title>Recenter examples</title> 5 5 </head> 6 6 <body> 7 <h1 class="page-title">Recenter examples</h1> 8 <div id="content"> 7 <h1 class="page-title">Recenter examples</h1> 8 9 <div id="content"> 9 10 <ul> 10 <li><a href="basic.html">Basic recenter example (DataField widget)</a></li>11 <li><a href="basic.html">Basic recenter example (DataField widget)</a></li> 11 12 </ul> 12 </div>13 </div> 13 14 </body> 14 15 </html> 15 16 -
MapFish/client/examples/search/c2corg.html
1 1 <!DOCTYPE html> 2 2 <html> 3 <head>3 <head> 4 4 <title>Search</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> 9 9 10 10 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 13 14 14 <script type="text/javascript"> 15 // Because of a bug in Firefox 2 we need to specify the MapFish base path.16 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128217 var gMfLocation = "../../mfbase/mapfish/";15 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 16 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 17 var gMfLocation = "../../mfbase/mapfish/"; 18 18 </script> 19 19 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 20 20 <script type="text/javascript" src="../examples.js"></script> … … 29 29 Ext.onReady(function() { 30 30 31 31 var vectorStyle = OpenLayers.Util.extend( 32 {}, OpenLayers.Feature.Vector.style['default']33 );32 {}, OpenLayers.Feature.Vector.style['default'] 33 ); 34 34 vectorStyle.externalGraphic = "AQUA.png"; 35 35 vectorStyle.graphicWidth = 20; 36 36 vectorStyle.graphicHeight = 20; … … 43 43 865124.6923828125, 432562.34619140625, 216281.17309570312, 108140.58654785156, 44 44 54070.29327392578 45 45 ]; 46 46 47 47 var options = { 48 48 projection: "EPSG:4326", 49 controls: [new OpenLayers.Control.Navigation()] , 49 controls: [new OpenLayers.Control.Navigation()] , 50 50 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), 51 51 scales: scales 52 52 }; 53 53 54 54 map = new OpenLayers.Map('map', options); 55 55 56 56 var layer; 57 58 layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 59 "http://labs.metacarta.com/wms/vmap0",60 {layers: 'basic'},61 {isBaseLayer: true}62 );57 58 layer = new OpenLayers.Layer.WMS("OpenLayers WMS", 59 "http://labs.metacarta.com/wms/vmap0", 60 {layers: 'basic'}, 61 {isBaseLayer: true} 62 ); 63 63 layer.setVisibility(true); 64 64 map.addLayer(layer); 65 65 66 layer = new OpenLayers.Layer.WMS( "World Map",67 "http://world.freemap.in/cgi-bin/mapserv?",68 {69 map: '/www/freemap.in/world/map/factbooktrans.map',70 transparent: true,71 layers: 'factbook',72 format: 'image/png'73 }74 );66 layer = new OpenLayers.Layer.WMS("World Map", 67 "http://world.freemap.in/cgi-bin/mapserv?", 68 { 69 map: '/www/freemap.in/world/map/factbooktrans.map', 70 transparent: true, 71 layers: 'factbook', 72 format: 'image/png' 73 } 74 ); 75 75 layer.setVisibility(false); 76 76 map.addLayer(layer); 77 77 78 78 layer = new OpenLayers.Layer.WMS("Summits", 79 "http://demo.mapfish.org/mapfishsample/trunk/wms?",80 {layers: ['summits'], format: 'image/png', transparent: true,81 singleTile: true}82 );79 "http://demo.mapfish.org/mapfishsample/trunk/wms?", 80 {layers: ['summits'], format: 'image/png', transparent: true, 81 singleTile: true} 82 ); 83 83 layer.setVisibility(true); 84 map.addLayer(layer); 84 map.addLayer(layer); 85 85 86 86 vectorLayer = new OpenLayers.Layer.Vector("vector", { 87 87 style: vectorStyle, 88 88 displayInLayerSwitcher: false 89 89 }); 90 90 map.addLayer(vectorLayer); 91 92 map.setCenter(new OpenLayers.LonLat(5, 45), 6);91 92 map.setCenter(new OpenLayers.LonLat(5, 45), 6); 93 93 map.addControl(new OpenLayers.Control.PanZoomBar()); 94 94 95 95 // we need to wrap the MapFish protocol in a trigger event … … 113 113 114 114 map.addControl(searcher); 115 115 116 var tree = new mapfish.widgets.LayerTree({map: map, 117 useArrows: true,118 el: 'tree'});116 var tree = new mapfish.widgets.LayerTree({map: map, 117 useArrows: true, 118 el: 'tree'}); 119 119 tree.render(); 120 120 121 121 }); 122 122 123 function activate() {124 var checked = document.getElementById("active").checked;125 if (checked) {126 searcher.activate();127 } else {128 searcher.deactivate();129 }130 }123 function activate() { 124 var checked = document.getElementById("active").checked; 125 if (checked) { 126 searcher.activate(); 127 } else { 128 searcher.deactivate(); 129 } 130 } 131 131 132 </script>133 <style type="text/css">132 </script> 133 <style type="text/css"> 134 134 html, body { 135 font-family: arial,tahoma,helvetica,sans-serif;136 font-size: 14px;137 font-size-adjust: none;138 font-style: normal;139 font-variant: normal;140 font-weight: normal;141 line-height: normal;135 font-family: arial, tahoma, helvetica, sans-serif; 136 font-size: 14px; 137 font-size-adjust: none; 138 font-style: normal; 139 font-variant: normal; 140 font-weight: normal; 141 line-height: normal; 142 142 } 143 143 144 .float-left { 144 float: left;145 margin-left: 20px;145 float: left; 146 margin-left: 20px; 146 147 } 148 147 149 .clear-left { 148 clear: left;150 clear: left; 149 151 } 152 150 153 #map { 151 width: 600px;152 height: 400px;153 border: 1px solid black;154 width: 600px; 155 height: 400px; 156 border: 1px solid black; 154 157 } 158 155 159 #tree { 156 height: 180px;157 width: 200px;160 height: 180px; 161 width: 200px; 158 162 } 163 159 164 #text { 160 width: 400px;165 width: 400px; 161 166 } 162 </style> 163 </head> 167 #north { 168 margin-top: 5px; 169 margin-left: 5px; 170 } 171 </style> 172 </head> 164 173 165 <body> 166 <h1 class="page-title">Search Example</h1> 167 <div id="content"> 168 <div id="map" class="float-left"></div> 169 <div class="float-left"> 174 <body> 175 <div id="north"> 176 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Search 177 example</h1> 178 <br> 179 </div> 180 181 <div id="content"> 182 <div id="map" class="float-left"></div> 183 <div class="float-left"> 170 184 <div id="tree"></div> 171 185 <div id="text"> 172 <p>Click on the map or draw a box to query the summits layer, check the checkbox to activate the searcher.</p> 173 <ul id="searcher"> 174 <li> 175 <input id="active" type="checkbox" name="hover" onchange="javascript:activate()" /> 176 <label for="active">Activate searcher</label> 177 </li> 178 </ul> 186 <p>Click on the map or draw a box to query the summits layer, check the checkbox to activate the 187 searcher.</p> 188 <ul id="searcher"> 189 <li> 190 <input id="active" type="checkbox" name="hover" onchange="javascript:activate()"/> 191 <label for="active">Activate searcher</label> 192 </li> 193 </ul> 179 194 </div> 180 </div>181 <div class="clear-left"></div>182 </div>183 </body>195 </div> 196 <div class="clear-left"></div> 197 </div> 198 </body> 184 199 </html> -
MapFish/client/examples/shortcuts/index.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Tree examples</title>4 <title>Tree examples</title> 5 5 </head> 6 6 <body> 7 <h1 class="page-title">Shortcuts examples</h1> 8 <div id="content"> 7 <h1 class="page-title">Shortcuts examples</h1> 8 9 <div id="content"> 9 10 <ul> 10 <li><a href="shortcuts.html">Simple shorcuts example</a></li>11 <li><a href="layout.html">Shortcuts in a complex layout</a></li>11 <li><a href="shortcuts.html">Simple shorcuts example</a></li> 12 <li><a href="layout.html">Shortcuts in a complex layout</a></li> 12 13 </ul> 13 </div>14 </div> 14 15 </body> 15 16 </html> 16 17 -
MapFish/client/examples/recenter/basic.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Map recenter with autocompletion</title>5 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">6 <link rel="stylesheet" type="text/css"7 href="../../mfbase/ext/resources/css/ext-all.css"/>8 <link rel="stylesheet" type="text/css"9 href="../../mfbase/mapfish/mapfish.css"/>4 <title>Map recenter with autocompletion</title> 5 <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 <link rel="stylesheet" type="text/css" 7 href="../../mfbase/ext/resources/css/ext-all.css"/> 8 <link rel="stylesheet" type="text/css" 9 href="../../mfbase/mapfish/mapfish.css"/> 10 10 11 <script type="text/javascript"12 src="../../mfbase/openlayers/lib/OpenLayers.js"></script>11 <script type="text/javascript" 12 src="../../mfbase/openlayers/lib/OpenLayers.js"></script> 13 13 14 <script type="text/javascript"15 src="../../mfbase/ext/adapter/ext/ext-base.js"></script>16 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script>14 <script type="text/javascript" 15 src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 16 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 17 17 18 <script type="text/javascript"19 src="../../mfbase/geoext/lib/GeoExt.js"></script>18 <script type="text/javascript" 19 src="../../mfbase/geoext/lib/GeoExt.js"></script> 20 20 21 <script type="text/javascript">22 // Because of a bug in Firefox 2 we need to specify the MapFish base path.23 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128224 var gMfLocation = "../../mfbase/mapfish/";25 </script>26 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script>27 <script type="text/javascript" src="../examples.js"></script>21 <script type="text/javascript"> 22 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 23 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 24 var gMfLocation = "../../mfbase/mapfish/"; 25 </script> 26 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 27 <script type="text/javascript" src="../examples.js"></script> 28 28 29 <style type="text/css"> 30 html, body { 31 font: normal 12px verdana; 32 margin: 0; 33 padding: 0; 34 border: 0 none; 35 overflow: hidden; 36 height: 100%; 37 } 38 </style> 39 <script type="text/javascript"> 40 // reference local blank image 41 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 42 Ext.onReady(function() { 29 <style type="text/css"> 30 html, body { 31 font: normal 12px verdana; 32 margin: 0; 33 padding: 0; 34 border: 0 none; 35 overflow: hidden; 36 height: 100%; 37 } 38 39 #north { 40 margin-top: 5px; 41 margin-left: 5px; 42 } 43 </style> 44 <script type="text/javascript"> 45 // reference local blank image 46 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 47 Ext.onReady(function() { 43 48 44 var map = new OpenLayers.Map($('center'));49 var map = new OpenLayers.Map($('center')); 45 50 46 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",47 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});48 map.addLayers([wms]);51 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 52 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 53 map.addLayers([wms]); 49 54 50 var viewport = new Ext.Viewport({51 layout:'border',52 items:[53 new Ext.BoxComponent({ // raw54 region: 'north',55 el: 'north',56 height: 3257 }),58 {59 region: 'west',60 id: 'west-panel',61 title: 'West',62 split: true,63 width: 320,64 minSize: 175,65 maxSize: 400,66 collapsible: true,67 margins: '0 0 0 5',68 layout: 'accordion',69 defaults: {70 collapsed: true71 },72 layoutConfig:{73 animate: true,74 activeOnTop: false75 },76 items: [77 {78 xtype: 'datafieldrecenter',79 title: 'Recenter',80 bodyStyle: 'padding: 7px;',81 collapsed: false,82 url: mapfish.SERVER_BASE_URL + "countries",83 map: map,84 fieldLabel: "Africa country",85 displayField: "country"86 }87 ]88 },{89 region: 'center',90 title: 'Map',91 layout: 'fit',92 xtype: 'mapcomponent',93 map: map94 }]95 });55 var viewport = new Ext.Viewport({ 56 layout:'border', 57 items:[ 58 new Ext.BoxComponent({ // raw 59 region: 'north', 60 el: 'north', 61 height: 32 62 }), 63 { 64 region: 'west', 65 id: 'west-panel', 66 title: 'West', 67 split: true, 68 width: 320, 69 minSize: 175, 70 maxSize: 400, 71 collapsible: true, 72 margins: '0 0 0 5', 73 layout: 'accordion', 74 defaults: { 75 collapsed: true 76 }, 77 layoutConfig:{ 78 animate: true, 79 activeOnTop: false 80 }, 81 items: [ 82 { 83 xtype: 'datafieldrecenter', 84 title: 'Recenter', 85 bodyStyle: 'padding: 7px;', 86 collapsed: false, 87 url: mapfish.SERVER_BASE_URL + "countries", 88 map: map, 89 fieldLabel: "Africa country", 90 displayField: "country" 91 } 92 ] 93 },{ 94 region: 'center', 95 title: 'Map', 96 layout: 'fit', 97 xtype: 'gx_mappanel', 98 map: map 99 }] 100 }); 96 101 97 map.setCenter(new OpenLayers.LonLat(8.5, 0), 3);98 });99 </script>102 map.setCenter(new OpenLayers.LonLat(8.5, 0), 3); 103 }); 104 </script> 100 105 </head> 101 106 <body> 102 <div id="west"></div>103 <div id="north">104 < p style="font-size:14pt" align="center">MapFish recenter</p>105 </div>106 <div id="center"></div>107 <div id="west"></div> 108 <div id="north"> 109 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Recenter example</h1> 110 </div> 111 <div id="center"></div> 107 112 </body> 108 113 </html> -
MapFish/client/examples/geostat/index.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>GeoStat examples</title>4 <title>GeoStat examples</title> 5 5 </head> 6 6 <body> 7 <h1 class="page-title">GeoStat examples</h1> 8 <div id="content"> 7 <h1 class="page-title">GeoStat examples</h1> 8 9 <div id="content"> 9 10 <ul> 10 <li><a href="choropleths.html">Choropleths</a></li>11 <li><a href="proportionalSymbols.html">Proportional Symbols</a></li>11 <li><a href="choropleths.html">Choropleths</a></li> 12 <li><a href="proportionalSymbols.html">Proportional Symbols</a></li> 12 13 </ul> 13 </div>14 </div> 14 15 15 16 </body> 16 17 </html> -
MapFish/client/examples/shortcuts/layout.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Shortcuts example in a Complex Layout</title>5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />4 <title>Shortcuts example in a Complex Layout</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 10 10 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 14 13 15 <script type="text/javascript"> 14 // Because of a bug in Firefox 2 we need to specify the MapFish base path.15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128216 var gMfLocation = "../../mfbase/mapfish/";16 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 17 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 18 var gMfLocation = "../../mfbase/mapfish/"; 17 19 </script> 18 20 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 19 21 <script type="text/javascript" src="../examples.js"></script> 20 21 <style type="text/css">22 html, body {23 font:normal 12px verdana;24 margin:0;25 padding:0;26 border:0 none;27 overflow:hidden;28 height:100%;29 }22 23 <style type="text/css"> 24 html, body { 25 font: normal 12px verdana; 26 margin: 0; 27 padding: 0; 28 border: 0 none; 29 overflow: hidden; 30 height: 100%; 31 } 30 32 </style> 31 <script type="text/javascript">32 33 // reference local blank image34 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';35 36 Ext.onReady(function(){37 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());38 39 40 var map = new OpenLayers.Map('olmap');33 <script type="text/javascript"> 34 35 // reference local blank image 36 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 37 38 Ext.onReady(function() { 39 Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); 40 41 42 var map = new OpenLayers.Map('olmap'); 41 43 42 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",43 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});44 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 45 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 44 46 45 map.addLayers([wms]); 46 map.addControl(new OpenLayers.Control.LayerSwitcher()); 47 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 48 49 var store = new Ext.data.SimpleStore({ 50 fields: ['value', 'text', 'bbox'], 51 data : [['OC', 'Oceana', new OpenLayers.Bounds(56.0234375, -72.53125, 214.2265625, 32.9375)], 47 map.addLayers([wms]); 48 map.addControl(new OpenLayers.Control.LayerSwitcher()); 49 map.setCenter(new OpenLayers.LonLat(17, 2), 2); 50 51 var store = new Ext.data.SimpleStore({ 52 fields: ['value', 'text', 'bbox'], 53 data : [ 54 ['OC', 'Oceana', new OpenLayers.Bounds(56.0234375, -72.53125, 214.2265625, 32.9375)], 52 55 ['NA', 'North America', new OpenLayers.Bounds(-186.37890625, -2.21875, -28.17578125, 103.25)], 53 56 ['SA', 'South America', new OpenLayers.Bounds(-146.828125, -71.828125, 11.375, 33.640625)], 54 57 ['AF', 'Africa', new OpenLayers.Bounds(-58.9375, -51.7890625, 99.265625, 53.6796875)], 55 58 ['EU', 'Europe', new OpenLayers.Bounds(-23.078125, 26.2578125, 56.0234375, 78.9921875)], 56 ['AS', 'Asia', new OpenLayers.Bounds(15.59375, -21.90625, 173.796875, 83.5625)]] 57 }); 58 59 var shortcuts = new mapfish.widgets.Shortcuts({ 60 map: map, 61 store: store, 62 templates: { 63 header: new Ext.Template("Choose a continent in the list"), 64 footer: new Ext.Template("The map will automatically center to this location") 65 } 66 }); 67 68 var viewport = new Ext.Viewport({ 69 layout:'border', 70 items:[ 71 new Ext.BoxComponent({ // raw 72 region:'north', 73 el: 'north', 74 height:32 75 }),{ 76 region:'south', 77 contentEl: 'south', 78 split:true, 79 height: 100, 80 minSize: 100, 81 maxSize: 200, 82 collapsible: true, 83 title:'South', 84 margins:'0 0 0 0' 85 },{ 86 region:'west', 87 id:'west-panel', 88 title:'West', 89 split:true, 90 width: 200, 91 minSize: 175, 92 maxSize: 400, 93 collapsible: true, 94 margins:'0 0 0 5', 95 layout:'anchor', 96 layoutConfig:{ 97 animate:true 98 }, 99 items: [{ 100 contentEl: 'west', 101 title:'Navigation', 102 border:false, 103 iconCls:'nav' 104 },{ 105 title:'Settings', 106 html:'<p>Some settings in here.</p>', 107 border:false, 108 iconCls:'settings' 109 },{ 110 title:'Shortcuts', 111 items: shortcuts, 112 border:false 113 }] 114 },{ 115 region:'center', 116 title: 'Map', 117 layout: 'fit', 118 xtype: 'mapcomponent', 119 map: map 120 } 121 ] 122 }); 123 }); 124 </script> 59 ['AS', 'Asia', new OpenLayers.Bounds(15.59375, -21.90625, 173.796875, 83.5625)] 60 ] 61 }); 62 63 var shortcuts = new mapfish.widgets.Shortcuts({ 64 map: map, 65 store: store, 66 templates: { 67 header: new Ext.Template("Choose a continent in the list"), 68 footer: new Ext.Template("The map will automatically center to this location") 69 } 70 }); 71 72 var viewport = new Ext.Viewport({ 73 layout:'border', 74 items:[ 75 new Ext.BoxComponent({ // raw 76 region:'north', 77 el: 'north', 78 height:32, 79 margins: {left: 5,top: 5} 80 }),{ 81 region:'south', 82 contentEl: 'south', 83 split:true, 84 height: 100, 85 minSize: 100, 86 maxSize: 200, 87 collapsible: true, 88 title:'South', 89 margins:'0 0 0 0' 90 },{ 91 region:'west', 92 id:'west-panel', 93 title:'West', 94 split:true, 95 width: 200, 96 minSize: 175, 97 maxSize: 400, 98 collapsible: true, 99 margins:'0 0 0 5', 100 layout:'anchor', 101 layoutConfig:{ 102 animate:true 103 }, 104 items: [ 105 { 106 contentEl: 'west', 107 title:'Navigation', 108 border:false, 109 iconCls:'nav' 110 }, 111 { 112 title:'Settings', 113 html:'<p>Some settings in here.</p>', 114 border:false, 115 iconCls:'settings' 116 }, 117 { 118 title:'Shortcuts', 119 items: shortcuts, 120 border:false 121 } 122 ] 123 },{ 124 region:'center', 125 title: 'Map', 126 layout: 'fit', 127 xtype: 'gx_mappanel', 128 map: map 129 } 130 ] 131 }); 132 }); 133 </script> 125 134 </head> 126 135 <body> 127 <div id="west">136 <div id="west"> 128 137 <p>Hi. I'm the west panel.</p> 129 </div> 130 <div id="north"> 131 <p>MapFish</p> 132 </div> 133 <div id="olmap"> 134 </div> 135 <div id="south"> 138 </div> 139 <div id="north"> 140 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Shortcuts 141 example</h1> 142 </div> 143 <div id="olmap"> 144 </div> 145 <div id="south"> 136 146 <p>south - generally for informational stuff, also could be for status bar</p> 137 </div>147 </div> 138 148 139 </body>149 </body> 140 150 </html> -
MapFish/client/examples/geostat/proportionalSymbols.html
1 1 <!DOCTYPE html> 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head>3 <head> 4 4 <title>Proportional symbols</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 6 7 7 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> 9 9 10 10 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 11 11 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 12 12 13 13 <script type="text/javascript"> 14 // Because of a bug in Firefox 2 we need to specify the MapFish base path.15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128216 var gMfLocation = "../../mfbase/mapfish/";14 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 15 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 16 var gMfLocation = "../../mfbase/mapfish/"; 17 17 </script> 18 18 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 19 19 <script type="text/javascript" src="../examples.js"></script> 20 20 21 21 <!-- A Localization Script File comes here --> 22 <script type="text/javascript"> 23 var propSymbol;22 <script type="text/javascript"> 23 var propSymbol; 24 24 25 function createMap(mapDiv) {26 var map = new OpenLayers.Map('olmap');25 function createMap(mapDiv) { 26 var map = new OpenLayers.Map('olmap'); 27 27 28 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS",29 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});28 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 29 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 30 30 31 map.addLayers([wms]);32 map.addControl(new OpenLayers.Control.LayerSwitcher());33 map.setCenter(new OpenLayers.LonLat(0, 0), 1);34 35 return map;36 }31 map.addLayers([wms]); 32 map.addControl(new OpenLayers.Control.LayerSwitcher()); 33 map.setCenter(new OpenLayers.LonLat(0, 0), 1); 34 35 return map; 36 } 37 37 38 // reference local blank image39 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';38 // reference local blank image 39 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 40 40 41 Ext.onReady(function() { 42 var map = createMap("map"); 43 44 propSymbol = new mapfish.widgets.geostat.ProportionalSymbol({ 45 'map': map, 46 'nameAttribute': 'name', 47 'indicators': [['population', 'Population']], 48 'url': mapfish.SERVER_BASE_URL + "cities", 49 'loadMask' : {msg: 'Loading Data...', msgCls: 'x-mask-loading'} 50 }); 51 propSymbol.render('myPropSymbDiv'); 41 Ext.onReady(function() { 42 var map = createMap("map"); 43 44 propSymbol = new mapfish.widgets.geostat.ProportionalSymbol({ 45 'map': map, 46 'nameAttribute': 'name', 47 'indicators': [ 48 ['population', 'Population'] 49 ], 50 'url': mapfish.SERVER_BASE_URL + "cities", 51 'loadMask' : {msg: 'Loading Data...', msgCls: 'x-mask-loading'} 52 }); 53 propSymbol.render('myPropSymbDiv'); 52 54 53 }, this);54 55 }, this); 56 55 57 </script> 56 58 57 59 <style type="text/css"> 58 60 #right { 59 float: right;60 width: 28%;61 float: right; 62 width: 28%; 61 63 } 64 62 65 #olmap { 63 66 width: 65%; 64 67 height: 400px; 65 68 border: 1px solid black; 66 69 } 70 71 #north { 72 margin-top: 5px; 73 margin-left: 5px; 74 } 67 75 </style> 68 </head> 69 <body> 70 <h1 class="page-title">Proportional symbols Example</h1> 76 </head> 77 <body> 78 <div id="north"> 79 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Proportional Symbols 80 example</h1> 81 <br> 71 82 72 83 <div id="content"> 73 <div id="right">74 <div id="myPropSymbDiv"></div>75 </div>76 <div id="olmap"></div>84 <div id="right"> 85 <div id="myPropSymbDiv"></div> 86 </div> 87 <div id="olmap"></div> 77 88 </div> 78 </body>89 </body> 79 90 </html> -
MapFish/client/examples/editing/list.html
1 1 <html> 2 2 <head> 3 <title>Grid for editing features</title>4 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/>3 <title>Grid for editing features</title> 4 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 5 5 6 <style type="text/css">7 html, body {8 font: normal 12px verdana;9 margin: 0;10 padding: 0;11 border: 0 none;12 overflow: hidden;13 height: 100%;14 width: 100%;15 }6 <style type="text/css"> 7 html, body { 8 font: normal 12px verdana; 9 margin: 0; 10 padding: 0; 11 border: 0 none; 12 overflow: hidden; 13 height: 100%; 14 width: 100%; 15 } 16 16 17 ul.list {18 list-style-type: disc;19 font-size: 11px;20 padding: 0 0 0 16px;21 }22 </style>17 ul.list { 18 list-style-type: disc; 19 font-size: 11px; 20 padding: 0 0 0 16px; 21 } 22 </style> 23 23 </head> 24 24 <body> 25 <div id="title"> 26 <h1 style="font-size:20px">MapFish, FeatureList example</h1> 27 </div> 28 <div id="olmap"> 29 </div> 30 <div id="help"> 25 <div id="north"> 26 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif;">MapFish: FeatureList 27 example</h1> 28 </div> 29 <div id="olmap"> 30 </div> 31 <div id="help"> 31 32 <!-- if somebody can tell me why the squares are not shown, I'll be happy! --> 32 33 <ul class="list"> 33 <li class="list">If you want to change the features' order, you can drag&drop them in the list.</li> 34 <li>In manual mode, to edit a geometry, click on the yellow icon in the "Geo" column.</li> 35 <li>In automatic mode, to edit a geometry, just click on it.</li> 36 <li>The currently edited geometry (if any), is marked with a blue icon in the "Geo" column.</li> 37 <li>The columns "Enabled", "Name" and "+" are just examples of editable attributes.</li> 38 <li>To add a feature, click on the "Add ..." button (click the arrow besides the button to create another type).</li> 39 <li>To delete a feature, select it and click the "Delete" button.</li> 34 <li class="list">If you want to change the features' order, you can drag&drop them in the list.</li> 35 <li>In manual mode, to edit a geometry, click on the yellow icon in the "Geo" column.</li> 36 <li>In automatic mode, to edit a geometry, just click on it.</li> 37 <li>The currently edited geometry (if any), is marked with a blue icon in the "Geo" column.</li> 38 <li>The columns "Enabled", "Name" and "+" are just examples of editable attributes.</li> 39 <li>To add a feature, click on the "Add ..." button (click the arrow besides the button to create another 40 type). 41 </li> 42 <li>To delete a feature, select it and click the "Delete" button.</li> 40 43 </ul> 41 </div>44 </div> 42 45 </body> 43 46 44 47 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> … … 47 50 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 48 51 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 49 52 53 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 54 50 55 <script type="text/javascript"> 51 // Because of a bug in Firefox 2 we need to specify the MapFish base path.52 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128253 var gMfLocation = "../../mfbase/mapfish/";56 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 57 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 58 var gMfLocation = "../../mfbase/mapfish/"; 54 59 </script> 55 60 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 56 61 <script type="text/javascript" src="../examples.js"></script> … … 76 81 renderer: null, 77 82 78 83 grid: null, 79 84 80 85 init : function(grid) { 81 86 this.grid = grid; 82 87 this.grid.on('render', function() { … … 98 103 renderer : function(v, p, record) { 99 104 p.css += ' x-grid3-check-col-td'; 100 105 return '<div class="x-grid3-check-col' 101 + (v ? '-on' : '')102 + ' x-grid3-cc-'103 + this.id104 + '"> </div>';106 + (v ? '-on' : '') 107 + ' x-grid3-cc-' 108 + this.id 109 + '"> </div>'; 105 110 } 106 111 }; 107 112 … … 114 119 var map = new OpenLayers.Map('olmap'); 115 120 116 121 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 117 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0});122 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}, {buffer: 0}); 118 123 119 124 map.addLayers([wms]); 120 125 map.addControl(new OpenLayers.Control.LayerSwitcher()); … … 124 129 * Define record type. 125 130 */ 126 131 var FeatureType = mapfish.widgets.editing.FeatureList.createRecord([ 127 {name: 'name', type: 'string'}, 128 {name: 'enabled', type: 'bool'}, 129 {name: 'positive', type: 'bool'}, 130 {name: 'geometry', type: 'geo'} // represents the feature geometry 132 { 133 name: 'name', 134 type: 'string' 135 }, 136 { 137 name: 'enabled', 138 type: 'bool' 139 }, 140 { 141 name: 'positive', 142 type: 'bool' 143 }, 144 { 145 name: 'geometry', 146 type: 'geo' 147 } // represents the feature geometry 131 148 ]); 132 149 133 150 /* … … 136 153 var ds = new Ext.data.Store({ 137 154 reader: new Ext.data.JsonReader({root: 'features'}, FeatureType) 138 155 }); 139 156 140 157 /* 141 158 * Define factory functions to create features. 142 159 */ … … 148 165 addButton.setHandler(factory); 149 166 addButton.setText("Add " + name); 150 167 } 168 151 169 function addPolyline() { 152 170 var extent = map.getExtent(); 153 171 var marginW = extent.getWidth() / 5; … … 158 176 positive: true, 159 177 geometry: new OpenLayers.Geometry.LineString([ 160 178 new OpenLayers.Geometry.Point( 161 extent.left + marginW, extent.bottom + marginH),179 extent.left + marginW, extent.bottom + marginH), 162 180 new OpenLayers.Geometry.Point( 163 extent.right - marginW, extent.top - marginH),181 extent.right - marginW, extent.top - marginH), 164 182 ]) 165 183 }, "Polyline", addPolyline); 166 184 } 185 167 186 function addPolygon() { 168 187 var extent = map.getExtent(); 169 188 var marginW = extent.getWidth() / 5; … … 175 194 geometry: new OpenLayers.Geometry.Polygon([ 176 195 new OpenLayers.Geometry.LinearRing([ 177 196 new OpenLayers.Geometry.Point( 178 extent.left+marginW, extent.bottom + marginH),197 extent.left + marginW, extent.bottom + marginH), 179 198 new OpenLayers.Geometry.Point( 180 extent.right - marginW, extent.bottom + marginH),199 extent.right - marginW, extent.bottom + marginH), 181 200 new OpenLayers.Geometry.Point( 182 extent.right - marginW, extent.top - marginH)201 extent.right - marginW, extent.top - marginH) 183 202 ]) 184 203 ]) 185 204 }, "Polygon", addPolygon); … … 192 211 text: 'Add Polygon', 193 212 handler: addPolygon, 194 213 menu: {items: [ 195 {text: 'Polygon', handler: addPolygon }, 196 {text: 'Polyline', handler: addPolyline} 214 { 215 text: 'Polygon', 216 handler: addPolygon 217 }, 218 { 219 text: 'Polyline', 220 handler: addPolyline 221 } 197 222 ]} 198 223 }); 199 224 … … 209 234 210 235 /* 211 236 * Define "Special" boolean columns 212 */ 237 */ 213 238 var enabledColumn = new Ext.grid.CheckColumn({ 214 239 header: 'Enabled', 215 240 dataIndex: 'enabled', … … 232 257 ds: ds, 233 258 editGeometryVisual: function(geometry, record, edited) { //how to render geometries 234 259 return geometry ? 235 '<img width="15" height="15" style="cursor: pointer;" src="geometry' + (edited ? 'On' : 'Off') + '.png" />' : '';260 '<img width="15" height="15" style="cursor: pointer;" src="geometry' + (edited ? 'On' : 'Off') + '.png" />' : ''; 236 261 }, 237 262 viewConfig: { 238 263 //autoFill: true, 239 264 forceFit: true, 240 265 scrollOffset: 20 241 266 }, 242 columns: [ // definition of the columns 243 {header: 'Geo', dataIndex: 'geometry', width: 25}, 267 columns: [ 268 // definition of the columns 269 { 270 header: 'Geo', 271 dataIndex: 'geometry', 272 width: 25 273 }, 244 274 enabledColumn, 245 {header: 'Name', dataIndex: 'name', width: 100, editor: new Ext.form.TextField()}, 275 { 276 header: 'Name', 277 dataIndex: 'name', 278 width: 100, 279 editor: new Ext.form.TextField() 280 }, 246 281 positiveColumn 247 282 ], 248 283 plugins: [enabledColumn, positiveColumn], // trick for the boolean columns … … 275 310 var mode = (featureList.autoFocusMode + 1) % 3; 276 311 featureList.autoFocusMode = mode; 277 312 focusMode.setText(mode == 0 ? "Focus: none" : 278 (mode == 1 ? "Focus: feature" :279 "Focus: expand"));313 (mode == 1 ? "Focus: feature" : 314 "Focus: expand")); 280 315 }); 281 316 var displayMode = new Ext.Button({ 282 317 text: 'Display: all', … … 296 331 */ 297 332 var viewport = new Ext.Viewport({ 298 333 layout: 'border', 299 items: [{ 334 items: [ 335 { 300 336 xtype: 'panel', 301 337 frame: true, 302 338 border: true, 303 339 region: 'north', 304 contentEl: 'title' 305 }, { 340 contentEl: 'north' 341 }, 342 { 306 343 region: 'east', 307 344 title: 'Feature editing', 308 345 split: true, … … 318 355 border: true, 319 356 frame: true 320 357 }, 321 items: [{ 358 items: [ 359 { 322 360 xtype: 'panel', 323 361 title: 'Settings', 324 362 region: 'north', … … 331 369 displayMode 332 370 ] 333 371 }, 334 featureList, { 372 featureList, 373 { 335 374 title: 'Help', 336 375 height: 250, 337 376 minSize: 100, … … 341 380 autoScroll: true, 342 381 region: 'south', 343 382 contentEl: 'help' 344 }] 345 }, { 383 } 384 ] 385 }, 386 { 346 387 region:'center', 347 388 title: 'Map', 348 xtype: ' mapcomponent',389 xtype: 'gx_mappanel', 349 390 map: map 350 }] 391 } 392 ] 351 393 }); 352 394 viewport.render(); 353 395 }); -
MapFish/client/examples/search/index.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Search examples</title>4 <title>Search examples</title> 5 5 </head> 6 6 <body> 7 <h1 class="page-title">Search examples</h1> 8 <div id="content"> 7 <h1 class="page-title">Search examples</h1> 8 9 <div id="content"> 9 10 <ul> 10 <li><a href="c2corg.html">Search example</a></li>11 <li><a href="c2corg.html">Search example</a></li> 11 12 </ul> 12 </div>13 </div> 13 14 </body> 14 15 </html> 15 16 -
MapFish/client/examples/print/index.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Print examples</title>4 <title>Print examples</title> 5 5 </head> 6 6 <body> 7 <h1 class="page-title">Print examples</h1> 8 <div id="content"> 7 <h1 class="page-title">Print examples</h1> 8 9 <div id="content"> 9 10 <ul> 10 <li><a href="simple.html">Print example</a></li>11 <li><a href="basic.html">Basic print example (single page pdf)</a></li>11 <li><a href="simple.html">Print example</a></li> 12 <li><a href="basic.html">Basic print example (single page pdf)</a></li> 12 13 </ul> 13 </div>14 </div> 14 15 </body> 15 16 </html> 16 17 -
MapFish/client/examples/editing/editing-panel.html
1 1 <!DOCTYPE html> 2 2 <html> 3 3 <head> 4 <title>Feature editing panel example</title>5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" />6 <link rel="stylesheet" type="text/css" href="../../mfbase/mapfish/mapfish.css" />4 <title>Feature editing panel example</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 <link rel="stylesheet" type="text/css" href="../../mfbase/mapfish/mapfish.css"/> 7 7 8 8 <script type="text/javascript" src="../../mfbase/openlayers/lib/Firebug/firebug.js"></script> 9 9 <script type="text/javascript" src="../../mfbase/openlayers/lib/OpenLayers.js"></script> … … 11 11 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 12 12 <script type="text/javascript" src="../../mfbase/ext/ext-all-debug.js"></script> 13 13 14 <script type="text/javascript" src="../../mfbase/geoext/lib/GeoExt.js"></script> 15 14 16 <script type="text/javascript"> 15 // Because of a bug in Firefox 2 we need to specify the MapFish base path.16 // See https://bugzilla.mozilla.org/show_bug.cgi?id=35128217 var gMfLocation = "../../mfbase/mapfish/";17 // Because of a bug in Firefox 2 we need to specify the MapFish base path. 18 // See https://bugzilla.mozilla.org/show_bug.cgi?id=351282 19 var gMfLocation = "../../mfbase/mapfish/"; 18 20 </script> 19 21 <script type="text/javascript" src="../../mfbase/mapfish/MapFish.js"></script> 20 22 <script type="text/javascript" src="../examples.js"></script> 21 23 22 24 <style type="text/css"> 23 html, body { 24 font:normal 12px verdana; 25 margin: 0; 26 padding:0; 27 } 28 ul.list { 29 list-style-type: disc; 30 font-size: 11px; 31 padding: 0 0 0 16px; 32 } 33 /* change the modal window z-index so that the combobox of the editing panel 34 is still active when the attributes form is disabled */ 35 .ext-el-mask { 36 z-index: 10999; 37 } 25 html, body { 26 font: normal 12px verdana; 27 margin: 0; 28 padding: 0; 29 } 30 31 ul.list { 32 list-style-type: disc; 33 font-size: 11px; 34 padding: 0 0 0 16px; 35 } 36 37 /* change the modal window z-index so that the combobox of the editing panel 38 is still active when the attributes form is disabled */ 39 .ext-el-mask { 40 z-index: 10999; 41 } 38 42 </style> 39 <script type="text/javascript"> 40 41 // reference local blank image 42 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 43 44 var map; 45 46 Ext.onReady(function() { 47 Ext.QuickTips.init(); 48 49 map = new OpenLayers.Map('olmap'); 50 51 var setupMap = function(viewport) { 52 var map = viewport.findById('map').map; 53 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 54 "http://labs.metacarta.com/wms/vmap0", 55 {layers: 'basic'}, 56 {buffer: 0} 57 ); 43 <script type="text/javascript"> 44 45 // reference local blank image 46 Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif'; 47 48 var map; 49 50 Ext.onReady(function() { 51 Ext.QuickTips.init(); 52 53 map = new OpenLayers.Map(); 54 var wms = new OpenLayers.Layer.WMS("OpenLayers WMS", 55 "http://labs.metacarta.com/wms/vmap0", 56 {layers: 'basic'}, 57 {buffer: 0} 58 ); 58 59 map.addLayers([wms]); 59 60 map.addControl(new OpenLayers.Control.LayerSwitcher()); 60 61 map.setCenter(new OpenLayers.LonLat(17, 2), 3); 61 }; 62 63 var layerConfig = { 64 polygons: { 65 text: 'Polygons', 66 protocol: new mapfish.Protocol.MapFish({ 67 url: mapfish.Util.formatURL( 68 mapfish.SERVER_BASE_URL + 'polygons' 69 ) 70 }), 71 featuretypes: { 72 geometry: { 73 type: OpenLayers.Geometry.Polygon 74 }, 75 properties: [ 76 new mapfish.widgets.editing.StringProperty( 62 63 var layerConfig = { 64 polygons: { 65 text: 'Polygons', 66 protocol: new mapfish.Protocol.MapFish({ 67 url: mapfish.Util.formatURL( 68 mapfish.SERVER_BASE_URL + 'polygons' 69 ) 70 }), 71 featuretypes: { 72 geometry: { 73 type: OpenLayers.Geometry.Polygon 74 }, 75 properties: [ 76 new mapfish.widgets.editing.StringProperty( 77 77 {name: 'name', showInGrid: true}) 78 ]79 }80 },81 lines: {82 text: 'Lines',83 protocol: new mapfish.Protocol.MapFish({84 url: mapfish.Util.formatURL(85 mapfish.SERVER_BASE_URL + 'lines'86 )87 }),88 featuretypes: {89 geometry: {90 type: OpenLayers.Geometry.LineString91 },92 properties: [93 new mapfish.widgets.editing.StringProperty(78 ] 79 } 80 }, 81 lines: { 82 text: 'Lines', 83 protocol: new mapfish.Protocol.MapFish({ 84 url: mapfish.Util.formatURL( 85 mapfish.SERVER_BASE_URL + 'lines' 86 ) 87 }), 88 featuretypes: { 89 geometry: { 90 type: OpenLayers.Geometry.LineString 91 }, 92 properties: [ 93 new mapfish.widgets.editing.StringProperty( 94 94 {name: 'name', showInGrid: true}) 95 ]96 97 }98 },99 points: {100 text: 'Points',101 protocol: new mapfish.Protocol.MapFish({102 url: mapfish.Util.formatURL(103 mapfish.SERVER_BASE_URL + 'points'104 )105 }),106 featuretypes: {107 geometry: {108 type: OpenLayers.Geometry.Point109 },110 properties: [111 new mapfish.widgets.editing.StringProperty(95 ] 96 97 } 98 }, 99 points: { 100 text: 'Points', 101 protocol: new mapfish.Protocol.MapFish({ 102 url: mapfish.Util.formatURL( 103 mapfish.SERVER_BASE_URL + 'points' 104 ) 105 }), 106 featuretypes: { 107 geometry: { 108 type: OpenLayers.Geometry.Point 109 }, 110 properties: [ 111 new mapfish.widgets.editing.StringProperty( 112 112 {name: 'name', showInGrid: true}) 113 ]114 115 }116 }117 };113 ] 114 115 } 116 } 117 }; 118 118 119 new Ext.Viewport({ 120 layout: 'border', 121 listeners: {'afterlayout': {'fn': setupMap}}, 122 items: [ 123 new Ext.BoxComponent({ 124 region: 'north', 125 el: 'north', 126 height: 32 127 }), { 128 region: 'east', 129 id: 'east-panel', 130 title: 'Tools', 131 width: 400, 132 items: [{ 133 title: 'Editing', 134 id: 'editing-panel', 135 bodyStyle: 'padding: 3px', 136 layerConfig: layerConfig, 137 map: map, 138 xtype: 'featureediting' 139 }, { 140 title: 'Help', 141 id: 'help', 142 contentEl: 'helptext' 143 }] 144 }, { 145 region: 'center', 146 id: 'map', 147 title: 'Map', 148 map: map, 149 xtype: 'mapcomponent' 150 } 151 ] 152 }); 153 }); 154 </script> 119 new Ext.Viewport({ 120 layout: 'border', 121 items: [ 122 new Ext.BoxComponent({ 123 region: 'north', 124 el: 'north', 125 height: 32, 126 margins: {left: 5,top: 5} 127 }), { 128 region: 'east', 129 id: 'east-panel', 130 title: 'Tools', 131 width: 400, 132 items: [ 133 { 134 title: 'Editing', 135 id: 'editing-panel', 136 bodyStyle: 'padding: 3px', 137 layerConfig: layerConfig, 138 map: map, 139 xtype: 'featureediting' 140 }, 141 { 142 title: 'Help', 143 id: 'help', 144 contentEl: 'helptext' 145 } 146 ] 147 }, { 148 region: 'center', 149 title: 'Map', 150 map: map, 151 xtype: "gx_mappanel" 152 } 153 ] 154 }); 155 }); 156 </script> 155 157 </head> 156 158 <body> 157 <div id="north"></div>158 < p>Feature editing panel example</p>159 </div>160 <div id="olmap"></div>161 <div id="helptext">159 <div id="north"> 160 <h1 style="font-size:20px;color:#15428B;font-family:tahoma,arial,verdana,sans-serif">MapFish: Editing panel 161 example</h1> 162 </div> 163 <div id="helptext"> 162 164 <ul class="list"> 163 <li class="list">Choose a layer in the list of layers to edit</li>164 <li>Import data for the current extent to edit existing data</li>165 <li>Select a feature by clicking on it, modify its vertices and/or attributes</li>166 <li>To delete a feature, click on it and hit the Delete button</li>167 <li>To create a feature, select the drawing tool and draw the feature</li>168 <li>Modified/Inserted/Deleted features appear in the grouping grid</li>169 <li>When done with editing, click on commit to save modifications</li>165 <li class="list">Choose a layer in the list of layers to edit</li> 166 <li>Import data for the current extent to edit existing data</li> 167 <li>Select a feature by clicking on it, modify its vertices and/or attributes</li> 168 <li>To delete a feature, click on it and hit the Delete button</li> 169 <li>To create a feature, select the drawing tool and draw the feature</li> 170 <li>Modified/Inserted/Deleted features appear in the grouping grid</li> 171 <li>When done with editing, click on commit to save modifications</li> 170 172 </ul> 171 </div>172 </body>173 </div> 174 </body> 173 175 </html>
