[Users] OverviewMap
Nils Krueger
nik1166 at googlemail.com
Tue Feb 23 18:39:40 CET 2010
Hello...
I would like to show the OverviewMap in an own suitable panel display.
Unfortunately, it doesn’t work. If so, is there any example? Or can anybody
show me how to do this.
Thank you for your help!
Nils
<html>
<head>
<title>OverMap</title>
<!--link rel="stylesheet" type="text/css" href="
http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" /-->
<link rel="stylesheet" type="text/css"
href="./lib/ext/resources/css/ext-all.css" />
<!--script type="text/javascript" src="
http://extjs.cachefly.net/builds/ext-cdn-771.js"></script-->
<script type="text/javascript"
src="./lib/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="./lib/ext/ext-all.js"></script>
<script src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
<script src="./lib/GeoExt/script/GeoExt.js"
type="text/javascript"></script>
<script type="text/javascript">
var panel, map;
Ext.onReady(function(){
var options_31467 = {
projection: new OpenLayers.Projection("EPSG:31467"),
controls: [],
maxExtent: new OpenLayers.Bounds(3336848, 5208708, 3661609,
5575555),
maxResolution: "auto",
numZoomLevels: 20,
units: 'm',
};
// create a new map
map = new OpenLayers.Map('map', options_31467);
// create base layer
var KreiseBW = new OpenLayers.Layer.WMS(
"KreiseBW",
"/geoserver/wms",
{
layers: 'topp:KreiseBW',
isBaseLayer:true,
}
);
// create overview map
var ovMapLayer = new OpenLayers.Layer.WMS(
"Kreise",
"/geoserver/wms",
{
layers: 'topp:BW',
}
);
var ovMap = {
mapOptions: {
projection: map.getProjection(),
maxExtent: map.getMaxExtent()
},
layers: [ovMapLayer]
};
//add Layers
map.addLayer(KreiseBW);
//add Controls
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon:
'true'}));
//map.addControl(new OpenLayers.Control.OverviewMap(ovMap));
map.zoomToMaxExtent();
//create layout
var overmap = new Ext.Panel({
title: 'Overmap',
// ???
control: new OpenLayers.Control.OverviewMap(ovMap),
//items: ovmap,
height:150
});
var toc = new Ext.Panel({
title:'TOC',
html: '<empty panel>',
cls:'empty'
});
var west = new Ext.Panel({
region:'west',
margins:'5 0 5 5',
split:true,
width: 210,
layout:'accordion',
items: [overmap, toc]
});
var map_panel = new GeoExt.MapPanel({
region:'center',
map: map,
});
var view = new Ext.Viewport({
layout:'border',
items:[west, map_panel]
});
});
</script>
</head>
<body>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100223/b9813b71/attachment.htm
More information about the Users
mailing list