[OpenLayers-Users] R: WG: Problems with OverviewMap
Jacopo Boari
jacopo.boari at sysgroup.it
Fri Jan 5 06:16:00 EST 2007
First of all, you need to download the last version of overviewMap control (If you haven't downloaded yet).
Second , you have correctly declared a variable called options, but you must to contruct use this variable in the contructor ot the OverviewMap control, for Example:
var overview = new OpenLayers.Control.OverviewMap({mapOptions: options})
Best regards
Jacopo Boari
Sysgroup srl - Lungo Dora Colletta 113/14 - 10153 Torino
tel 0112440983 fax 0112406561
e-mail jacopo.boari at sysgroup.it www.sysgroup.it
________________________________
Da: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Per conto di Hans-Jörg Stark
Inviato: venerdì 5 gennaio 2007 12.03
A: users at openlayers.org
Oggetto: [OpenLayers-Users] WG: Problems with OverviewMap
Hi
I would like to put an overview map to my map using projection 'epsg:21781'. Unfortunately I cannot get it working.
I use the following code:
<div id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map', { projection: 'epsg:21781', maxExtent: new OpenLayers.Bounds(606800,262500,619100,272400), units: 'm', minScale: '100000', maxScale: '5000', scales: ['10000', '75000', '50000','40000', '30000', '25000', '20000', '15000', '10000', '9000', '8000', '7000', '6000', '5000'], 'tileSize': new OpenLayers.Size(512,512) });
var myLoc = new OpenLayers.LonLat(7.6,47.558);
my_wms = new OpenLayers.Layer.WMS( "citymap",
"http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apache/htdocs/nafmomNeu/map/citymap.map", {LAYERS: "citymap", format: 'png', transparent:'true'});
my_wms.setIsBaseLayer(true);
my_wms.setVisibility(true);
map.addLayer(my_wms);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(myLoc, 13);
var options = {
projection: 'epsg:21781',
units: 'm',
numZoomLevels: 1,
layers: [my_wms.clone()],
maxExtent: new OpenLayers.Bounds(606800,262500,619100,272400)};
var overview = new OpenLayers.Control.OverviewMap()
map.addControl(overview);
overview.maximizeControl();
</script>
The main map appears as usual and I can use the zooming, panning, etc. Though I get the following error message:
bounds has no properties
file:///C:/.../Openlayers/V2.3/OpenLayers-2.3-rc1/lib/OpenLayers/Map.js
Line: 1011
The overviewmap container appears as well - but with no contents. If I click in it or want to move the red rectangle I get the error:
this.ovmap has no properties
file:///C:/.../OpenLayers-2.3-rc1/lib/OpenLayers/Control/OverviewMap.js
Line: 294
Any help on that?
More information about the Users
mailing list