[OpenLayers-Users] Problems with OverviewMap

Hans-Jörg Stark h.stark at fhbb.ch
Fri Jan 5 07:50:10 EST 2007


Ooops! 

I just realized my mistake in the code: 

instead of     var overview = new OpenLayers.Control.OverviewMap();

I had     var overview = new OpenLayers.Control.OverviewMap({Options:
options});

 

which didn't do the trick either.

sorry for the mistake, thoug!!

 

  _____  

Von: Hans-Jörg Stark [mailto:h.stark at fhbb.ch] 
Gesendet: Freitag, 5. Januar 2007 12:03
An: 'users at openlayers.org.'
Betreff: 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/ma
p/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?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070105/69baba76/attachment.html


More information about the Users mailing list