1

when I do this:

    var options = {
        autoPan : true,
        size : new OpenLayers.Size(300, 200),
        layers : this.map.layers,
        mapOptions : {
            allOverlays : true
        }
    };
    var ov = new OpenLayers.Control.OverviewMap(options);

    this.map.addControl(ov);

my layers are only shown in the overview window. The layers disappear from the main screen.

Any suggestions how to fix it?

0

You need to add a clone of the map layer to the overview control rather than the layer itself.

The OpenLayers overview map example has a bit more information in the page source:

A clone of the above layer that we will use as overview for map2. We need to clone jpl before the it gets added to a map, so the clone can have its own maxExtent and maxResolution instead of getting these settings initialized from map1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.