Skip to content

Commit

Permalink
Add state of the work done in Mallorca. This is the combined work of …
Browse files Browse the repository at this point in the history
…the terrestris team back then.
  • Loading branch information
marcjansen committed May 7, 2012
1 parent e522bf9 commit 9120292
Show file tree
Hide file tree
Showing 33 changed files with 59,448 additions and 0 deletions.
51,970 changes: 51,970 additions & 0 deletions examples/action/all-classes.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions examples/action/app-all.js

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions examples/action/mappanel_with_actions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<html>
<head>
<title>Hello GeoExt2 - Action</title>

<link rel="stylesheet" type="text/css" href="../../../ext-4.0.2a/resources/css/ext-all.css">
<script type="text/javascript" src="../../../ext-4.0.2a/ext-all-debug-w-comments.js"></script>

<!-- You should definitely consider using a custom single-file version of OpenLayers -->
<script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"></script>

<script type="text/javascript" src="../../src/GeoExt.js"></script>
<script type="text/javascript" src="../../src/data/models/Layer.js"></script>
<script type="text/javascript" src="../../src/data/store/Layer.js"></script>
<script type="text/javascript" src="../../src/panel/Map.js"></script>
<script type="text/javascript" src="../../src/widgets/Action.js"></script>


<script type="text/javascript" src="mappanel_with_actions.js"></script>
</head>
<body></body>
</html>
176 changes: 176 additions & 0 deletions examples/action/mappanel_with_actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
Ext.require('Ext.container.Viewport');
Ext.require('Ext.window.MessageBox');



Ext.application({
name: 'HelloGeoExt2 - Action',
launch: function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7)) //7 days from now
}));

var map = new OpenLayers.Map({});
map.addControl(new OpenLayers.Control.LayerSwitcher());
var wms = new OpenLayers.Layer.WMS('OSM', 'http://intranet.terrestris.de:8010/mapproxy1.2/service?', {
layers: 'Shaded_Relief',
format: 'image/jpeg',
transparent: 'false'
}, {
isBaseLayer: true,
displayInLayerSwitcher: true,
singleTile: false
});

var reisewarnungen = new OpenLayers.Layer.WMS('Reisewarnungen SOS', 'http://intranet.terrestris.de:8011/geoserver/sos/wms', {
layers: 'sos:reisehinweise',
format: 'image/png',
style: 'sos-gold',
transparent: true
}, {
isBaseLayer: false,
displayInLayerSwitcher: true,
singleTile: true
});

//
//

var vector = new OpenLayers.Layer.Vector("vector");
map.addLayers([wms, reisewarnungen, vector]);

var ctrl, toolbarItems = [], action, actions = {};

// ZoomToMaxExtent control, a "button" control
action = new GeoExt.Action({
control: new OpenLayers.Control.ZoomToMaxExtent(),
map: map,
text: "max extent",
tooltip: "zoom to max extent"
});
actions["max_extent"] = action;
toolbarItems.push(action);
toolbarItems.push("-");

// Navigation control and DrawFeature controls
// in the same toggle group
action = new GeoExt.Action({
text: "nav",
control: new OpenLayers.Control.Navigation(),
map: map,
// button options
toggleGroup: "draw",
allowDepress: false,
pressed: true,
tooltip: "navigate",
// check item options
group: "draw",
checked: true
});
actions["nav"] = action;
toolbarItems.push(action);

action = new GeoExt.Action({
text: "draw poly",
control: new OpenLayers.Control.DrawFeature(vector, OpenLayers.Handler.Polygon),
map: map,
// button options
toggleGroup: "draw",
allowDepress: false,
tooltip: "draw polygon",
// check item options
group: "draw"
});
actions["draw_poly"] = action;
toolbarItems.push(action);

action = new GeoExt.Action({
text: "draw line",
control: new OpenLayers.Control.DrawFeature(vector, OpenLayers.Handler.Path),
map: map,
// button options
toggleGroup: "draw",
allowDepress: false,
tooltip: "draw line",
// check item options
group: "draw"
});
actions["draw_line"] = action;
toolbarItems.push(action);
toolbarItems.push("-");

// SelectFeature control, a "toggle" control
action = new GeoExt.Action({
text: "select",
control: new OpenLayers.Control.SelectFeature(vector, {
type: OpenLayers.Control.TYPE_TOGGLE,
hover: true
}),
map: map,
// button options
enableToggle: true,
tooltip: "select feature"
});
actions["select"] = action;
toolbarItems.push(action);
toolbarItems.push("-");

// Navigation history - two "button" controls
ctrl = new OpenLayers.Control.NavigationHistory();
map.addControl(ctrl);

action = new GeoExt.Action({
text: "previous",
control: ctrl.previous,
disabled: true,
tooltip: "previous in history"
});
actions["previous"] = action;
toolbarItems.push(action);

action = new GeoExt.Action({
text: "next",
control: ctrl.next,
disabled: true,
tooltip: "next in history"
});
actions["next"] = action;
toolbarItems.push(action);
toolbarItems.push("->");

// Reuse the GeoExt.Action objects created above
// as menu items
toolbarItems.push({
text: "menu",
menu: new Ext.menu.Menu({
items: [ // ZoomToMaxExtent
actions["max_extent"], // Nav
new Ext.menu.CheckItem(actions["nav"]), // Draw poly
new Ext.menu.CheckItem(actions["draw_poly"]), // Draw line
new Ext.menu.CheckItem(actions["draw_line"]), // Select control
new Ext.menu.CheckItem(actions["select"]), // Navigation history control
actions["previous"], actions["next"]]
})
});

var mappanel = Ext.create('GeoExt.panel.Map', {
title: 'The GeoExt.panel.Map-class',
map: map,
stateful: true,
stateId: 'mappanel',
mapExtent: '7,51,8,52',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: toolbarItems
}]
});


Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [mappanel]
});

}
});
48 changes: 48 additions & 0 deletions examples/legendpanel/legendpanel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<html>
<head>
<title>GeoExt Legend Panel</title>

<link rel="stylesheet" type="text/css" href="../../../ext-4.0.2a/resources/css/ext-all.css">
<script type="text/javascript" src="../../../ext-4.0.2a/ext-all-debug-w-comments.js"></script>

<!-- You should definitely consider using a custom single-file version of OpenLayers -->
<script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"></script>

<script type="text/javascript" src="../../src/GeoExt.js"></script>
<script type="text/javascript" src="../../src/data/models/Layer.js"></script>
<script type="text/javascript" src="../../src/data/store/Layer.js"></script>
<script type="text/javascript" src="../../src/legend/Layer.js"></script>
<script type="text/javascript" src="../../src/legend/WMSLayer.js"></script>
<script type="text/javascript" src="../../src/legend/URL.js"></script>
<script type="text/javascript" src="../../src/legend/Vector.js"></script>
<script type="text/javascript" src="../../src/legend/Image.js"></script>

<script type="text/javascript" src="../../src/renderer/Feature.js"></script>

<script type="text/javascript" src="../../src/panel/Map.js"></script>

<script type="text/javascript" src="../../src/panel/Legend.js"></script>


<script type="text/javascript" src="legendpanel.js"></script>

<style type="text/css">
.mylabel {
font-weight: bold;
color: red;
display: block;
width: 100%;
}

</style>
</head>
<body>

<h1>GeoExt.LegendPanel</h1>
<p>This example shows the how to create a LegendPanel that autopopulates with legends from a map
that has already been created.</p>
<p>The js is not minified so it is readable. See <a href="legendpanel.js">legendpanel.js</a>.</p>
<div id="view"></div>
<div id="legend"></div>
</body>
</html>
106 changes: 106 additions & 0 deletions examples/legendpanel/legendpanel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/**
* Copyright (c) 2008-2010 The Open Source Geospatial Foundation
*
* Published under the BSD license.
* See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
*/

/** api: example[legendpanel]
* Legend Panel
* ------------
* Display a layer legend in a panel.
*/


var mappanel, legendPanel;

Ext.application({
name: 'LegendPanel GeoExt2',
launch: function() {

var map = new OpenLayers.Map({
allOverlays: true
});
map.addLayers([


new OpenLayers.Layer.WMS(
"Tasmania",
"http://demo.opengeo.org/geoserver/wms?",
{
layers: 'topp:tasmania_state_boundaries',
format: 'image/png',
transparent: true
},

{
singleTile: true
}),
new OpenLayers.Layer.WMS(
"Cities and Roads",
"http://demo.opengeo.org/geoserver/wms?",
{
layers: 'topp:tasmania_cities,topp:tasmania_roads',
format: 'image/png',
transparent: true
},

{
singleTile: true
})
// ,
// new OpenLayers.Layer.Vector('Polygons', {
// styleMap: new OpenLayers.StyleMap({
// "default": new OpenLayers.Style({
// pointRadius: 8,
// fillColor: "#00ffee",
// strokeColor: "#000000",
// strokeWidth: 2
// })
// })
// })
]);
// map.layers[2].addFeatures([
// new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(
// "POLYGON(146.1 -41, 146.2 -41, 146.2 -41.1, 146.1 -41.1)"))
// ]);


// map.addControl(new OpenLayers.Control.LayerSwitcher());


mappanel = Ext.create('GeoExt.panel.Map', {
region: 'center',
height: 400,
width: 600,
map: map,
mapCenter: new OpenLayers.LonLat(146.4, -41.6),
mapZoom: 7
});
var layerRec0 = mappanel.layers.getAt(0);
layerRec0.set("legendURL", "http://demo.opengeo.org/geoserver/wms?FORMAT=image%2Fgif&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=topp%3Atasmania_state_boundaries");


// console.log('mappanel',mappanel);
legendPanel = Ext.create('GeoExt.panel.Legend', {
defaults: {
labelCls: 'mylabel',
style: 'padding:5px'
},
bodyStyle: 'padding:5px',
width: 350,
autoScroll: true,
region: 'west'
});
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [
mappanel,legendPanel
]
});

}
});


37 changes: 37 additions & 0 deletions examples/mappanel/mappanel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<html>
<head>
<title>Hello GeoExt2</title>

<link rel="stylesheet" type="text/css" href="../../../ext-4.0.2a/resources/css/ext-all.css">
<script type="text/javascript" src="../../../ext-4.0.2a/ext-all-debug-w-comments.js"></script>

<!-- You should definitely consider using a custom single-file version of OpenLayers -->
<script type="text/javascript" src="../../../OpenLayers/trunk/lib/OpenLayers.js"></script>

<script type="text/javascript" src="../../src/GeoExt.js"></script>
<script type="text/javascript" src="../../src/data/models/Layer.js"></script>
<script type="text/javascript" src="../../src/data/store/Layer.js"></script>
<script type="text/javascript" src="../../src/panel/Map.js"></script>


<script type="text/javascript" src="mappanel.js"></script>

<style type="text/css">
.olControlAttribution a,
.olControlAttribution a:link,
.olControlAttribution a:visited,
.olControlAttribution a:hover,
.olControlAttribution a:active {
color: #fff;
}
.olControlAttribution {
font-size: 13px !important;
color: #ffffff;
text-shadow: 0 0 0.3em #8877FF, 0 0 0.3em #8877FF, 0 0 0.3em #8877FF;
bottom: 2px !important;
right: 2px !important;
}
</style>
</head>
<body></body>
</html>
Loading

0 comments on commit 9120292

Please sign in to comment.