Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OverviewMap plugin #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions examples/viewer-overviewmap-osm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>Viewer with OverviewMap</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.4.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.4.0/examples/shared/examples.css" />
<link rel="stylesheet" type="text/css" href="../externals/openlayers/theme/default/style.css" />
<link rel="stylesheet" type="text/css" href="../externals/geoext/resources/css/geoext-all.css" />
<link rel="stylesheet" type="text/css" href="../src/theme/all.css"/>
<script src="http://extjs.cachefly.net/ext-3.4.0/adapter/ext/ext-base.js"></script>
<script src="http://extjs.cachefly.net/ext-3.4.0/ext-all-debug.js"></script>
<script src="../externals/openlayers/lib/OpenLayers.js"></script>
<script src="../externals/geoext/lib/GeoExt.js"></script>
<script src="../externals/geoext/lib/overrides/override-ext-ajax.js"></script>
<script src="../src/script/loader.js"></script>

<script type="text/javascript" src="viewer/ux/RowExpander.js"></script>
<script type="text/javascript" src="viewer-overviewmap-osm.js"></script>

</head>
<body>
<h1>Viewer with OverviewMap</h1>
<p>This example shows a map viewer and the OverviewMap plugin configured with a OSM layer.</p>

<p>The js is not minified so it is readable.
See <a href="viewer-overviewmap-osm.js">viewer-overviewmap-osm.js</a>.</p>

</body>
</html>
101 changes: 101 additions & 0 deletions examples/viewer-overviewmap-osm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
var app;
Ext.onReady(function() {
app = new gxp.Viewer({
proxy: "/geoserver/rest/proxy?url=",
portalConfig: {
renderTo: document.body,
layout: "border",
width: 600,
height: 400,
border: false,
items: [{
xtype: "panel",
region: "center",
border: false,
layout: "fit",
items: ["map-viewport"]
}, {
id: "tree-container",
xtype: "container",
layout: "fit",
region: "west",
width: 200
}]
},

// configuration of all tool plugins for this application
tools: [{
ptype: "gxp_layertree",
outputConfig: {
id: "tree",
border: true,
tbar: [] // we will add buttons to "tree.bbar" later
},
outputTarget: "tree-container"
}, {
ptype: "gxp_zoomtoextent",
actionTarget: "map.tbar"
}, {
ptype: "gxp_zoom",
actionTarget: "map.tbar"
}, {
ptype: "gxp_navigationhistory",
actionTarget: "map.tbar"
}, {
ptype: "gxp_overviewmap",
layer: {
source: "osm",
name: "mapnik"
},
mapOptions: { projection: "EPSG:900913" },
size : [120, 100]
}],

// layer sources
defaultSourceType: "gxp_wmssource",
sources: {
local: {
title: "Local GeoServer",
url: "/geoserver/wms",
version: "1.1.1"
},
suite: {
title: "Remote GeoServer",
url: "http://v2.suite.opengeo.org/geoserver/wms",
version: "1.1.1"
},
google: {
ptype: "gxp_googlesource"
},
osm: {
ptype: "gxp_osmsource"
}
},

// map and layers
map: {
id: "map-viewport", // id needed to reference map in items above
title: "Map",
projection: "EPSG:900913",
units: "m",
maxResolution: 156543.0339,
maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34],
center: [-10764594.758211, 4523072.3184791],
zoom: 3,
layers: [{
source: "google",
name: "TERRAIN",
group: "background"
}, {
source: "local",
name: "usa:states",
selected: true
}],
items: [{
xtype: "gx_zoomslider",
vertical: true,
height: 100
}]
}
});
});
31 changes: 31 additions & 0 deletions examples/viewer-overviewmap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>Viewer with OverviewMap</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.4.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.4.0/examples/shared/examples.css" />
<link rel="stylesheet" type="text/css" href="../externals/openlayers/theme/default/style.css" />
<link rel="stylesheet" type="text/css" href="../externals/geoext/resources/css/geoext-all.css" />
<link rel="stylesheet" type="text/css" href="../src/theme/all.css"/>
<script src="http://extjs.cachefly.net/ext-3.4.0/adapter/ext/ext-base.js"></script>
<script src="http://extjs.cachefly.net/ext-3.4.0/ext-all-debug.js"></script>
<script src="../externals/openlayers/lib/OpenLayers.js"></script>
<script src="../externals/geoext/lib/GeoExt.js"></script>
<script src="../externals/geoext/lib/overrides/override-ext-ajax.js"></script>
<script src="../src/script/loader.js"></script>

<script type="text/javascript" src="viewer/ux/RowExpander.js"></script>
<script type="text/javascript" src="viewer-overviewmap.js"></script>

</head>
<body>
<h1>Viewer with OverviewMap</h1>
<p>This example shows a map viewer and the OverviewMap plugin configured with a WMS layer.</p>

<p>The js is not minified so it is readable.
See <a href="viewer-overviewmap.js">viewer-overviewmap.js</a>.</p>

</body>
</html>
113 changes: 113 additions & 0 deletions examples/viewer-overviewmap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
var app;
Ext.onReady(function() {
app = new gxp.Viewer({
proxy: "/geoserver/rest/proxy?url=",
portalConfig: {
renderTo: document.body,
layout: "border",
width: 600,
height: 400,
border: false,
items: [{
xtype: "panel",
region: "center",
border: false,
layout: "fit",
items: ["map-viewport"]
}, {
id: "tree-container",
xtype: "container",
layout: "fit",
region: "west",
width: 200
}]
},

// configuration of all tool plugins for this application
tools: [{
ptype: "gxp_layertree",
outputConfig: {
id: "tree",
border: true,
tbar: [] // we will add buttons to "tree.bbar" later
},
outputTarget: "tree-container"
}, {
ptype: "gxp_zoomtoextent",
actionTarget: "map.tbar"
}, {
ptype: "gxp_zoom",
actionTarget: "map.tbar"
}, {
ptype: "gxp_navigationhistory",
actionTarget: "map.tbar"
}, {
ptype: "gxp_overviewmap",
layer: {
source: "ol",
type: "OpenLayers.Layer.WMS",
name: "Catastro_",
"args" : [
"Catastro",
"http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx",
{
"layers" : "Catastro",
"type" : "jpeg",
"isBaseLayer": false
}
],
visibility : true,
group: "background"
},
mapOptions: { projection: "EPSG:4326" },
size : [120, 100]
}],

// layer sources
defaultSourceType: "gxp_wmssource",
sources: {
local: {
title: "Local GeoServer",
url: "/geoserver/wms",
version: "1.1.1"
},
suite: {
title: "Remote GeoServer",
url: "http://v2.suite.opengeo.org/geoserver/wms",
version: "1.1.1"
},
google: {
ptype: "gxp_googlesource"
},
ol: {
ptype: "gxp_olsource"
}
},

// map and layers
map: {
id: "map-viewport", // id needed to reference map in items above
title: "Map",
projection: "EPSG:900913",
units: "m",
maxResolution: 156543.0339,
maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34],
center: [-42346.11366998777, 4789773.503433999],
zoom: 7,
layers: [{
source: "google",
name: "TERRAIN",
group: "background"
}, {
source: "local",
name: "usa:states",
selected: true
}],
items: [{
xtype: "gx_zoomslider",
vertical: true,
height: 100
}]
}
});
});
1 change: 1 addition & 0 deletions src/script/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"plugins/Print.js",
"plugins/LoadingIndicator.js",
"plugins/Playback.js",
"plugins/OverviewMap.js",
"locale/es.js",
"locale/ca.js"
);
Expand Down
Loading