[Users] Add overview map to mappanel
Andrew Stewart
Andrew.Stewart at reddeer.ca
Wed Feb 22 16:08:29 CET 2012
First make a new window to hold the overview map, put the function as the listener for "after_layout". Here is how I declare mine -
overview_window = new Ext.Window({
title: "Overview Window",
bodyBorder: false,
closeAction: "hide",
collapsible: true,
titleCollapse: true,
width: 200,
resizable: false,
closable: false,
html: '<div id="overviewmap"></div>',
listeners: {
afterlayout: {
fn: addOverview,
single: true
}
}
});
overview_window.show();
overview_window.alignTo(document.body, "bl", [10, -125]);
function addOverview() {
var b = {
div: Ext.get("overviewmap"),
mapOptions: {
maxResolution: 190,
minResolution: 190,
numZoomLevels: 1
},
id: "overview_map",
layers: [layer_Overview.clone()]
},
a = new OpenLayers.Control.OverviewMap(b);
a.isSuitableOverview = function () {
return true
};
map.addControl(a)
}
________________________________
From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of Robert Buckley
Sent: February 22, 2012 12:30 AM
To: users at geoext.org
Subject: [Users] Add overview map to mappanel
Hi,
I want to add an overviewmap with an rectangle showing the current extent of the mappanel and one wms layer as reference.
I read this...
http://www.geoext.org/pipermail/users/2010-February/000593.html
But cannot see where the following should be place...
addOverview: = function() {
var mapOptions = {
maxExtent: new OpenLayers.Bounds(180000, 397000,200000,
414000),
maxResolution: 500,
projection: "EPSG:28992",
units: "m"
};
..is this part of a panel, or the mappanel?
does anyone know where this should go...or is there a better method to produce a simple yet effective overview map?
Rob
________________________________
[This message has been scanned for security content threats and viruses.]
[The City of Red Deer I.T. Services asks that you please consider the environment before printing this e-mail.]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120222/142fb3fa/attachment.htm
More information about the Users
mailing list