[OpenLayers-Users] Users Digest, Vol 4, Issue 13

Hans-Jörg Stark h.stark at fhbb.ch
Wed Jan 10 09:36:42 EST 2007


Hi Chris

 

In fact I do not want to use the same layer in the map and the overview
window. But I did not manage to achieve this.

The only working was - in Firefox though only - is the following code:

 

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.55);

 

    wms_citymap = new OpenLayers.Layer.WMS( "Basel",

 
"http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apache/htdocs/nafmomNeu/ma
p/stadtplan.map",

        {LAYERS: "stadtplan", format: 'png'});

    wms_citymap.setIsBaseLayer(true);

    wms_citymap.setVisibility(true);

 

 

    //var kmap_stadtplan = new OpenLayers.Layer.KaMap("Stadtplan",
"http://localhost/ka-map/tile.php?", {'i': 'png', 'map': 'stadtplan'},
{isBaseLayer: 'false', Visibility: 'true', 'buffer':1});

 

    map.addLayers([wms_citymap]);

    map.addControl(new OpenLayers.Control.LayerSwitcher());

 

    var opt = {layers: [wms_citymap]};

 

    var mopt = {

            projection: 'EPSG:21781',

            units:'m',

            maxExtent: new OpenLayers.Bounds(606800,262500,619100,272400)

            };

    var ov =  new OpenLayers.Control.OverviewMap({options: opt, mapOptions:
mopt});

    map.addControl(new OpenLayers.Control.OverviewMap({mapOptions: opt}));

    map.addControl(ov);

    ov.maximizeControl();

 

    map.setCenter(myLoc, 8);

 

    map.addControl(overview);

    overview.maximizeControl();

 

I confirm that obviously the first baselayer has to be a WMS layer. OL could
not handle a ka-map layer as baselayer.

 

So I still have two questions:

 

1.    How can I use a different layer for the overview window that is NOT
already a baselayer in the main map window (using my own projection ->
epgs:21781)?

2.    What do I have to change to have this run in iEx as well (Version 6)? 

 

TIA!

-Hans

 

>Message: 1

>Date: Mon, 8 Jan 2007 18:30:14 +0100

>From: " Christian L?pez Esp?nola " <penyaskito at gmail.com>

>Subject: Re: [OpenLayers-Users] Overview Map Question

>Cc: users at openlayers.org

>Message-ID:

>     <e8254e3c0701080930y258e3c00se8036dd996a2fd42 at mail.gmail.com>

>Content-Type: text/plain; charset=UTF-8; format=flowed

> 

>Maybe you are using the SAME layer in the map and in the overviewmap,

>and this make you have this headaches. Try adding the overview map a

>layer.clone().

> 

>Hope this helps.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070110/969a5e0c/attachment.html


More information about the Users mailing list