[OpenLayers-Users] Layer.Image not working as Overlay

Marco Scheuble mail at marco-scheuble.de
Mon Feb 4 01:54:13 PST 2013


Hi Arndt,

works perfect!

It was my fault. By mistake I added the ImageOverlay-Layer to a LayerList of
a selectControl!

var ctrl = new OpenLayers.Control.SelectFeature( 
  map.getLayersBy( "isBaseLayer", false ), ...
);

Thank you very much,
Regards, Marco

-----------------------------------------------------------------------
Hi,

That's what I do, to show the floorplan

function init()
{
    mapOptions = {
        //allOverlays:true,
        "controls":[
           new OpenLayers.Control.Navigation(),
           new OpenLayers.Control.PanZoomBar(),
           new OpenLayers.Control.LayerSwitcher()
        ],
        projection:"EPSG:21781",
        scales: [ 200000, 100000, 50000, 25000, 17500, 10000, 5000, 3000,
2000, 1000, 500 ],
        maxExtent: new OpenLayers.Bounds(699000,227130,716400,237580),
        maxZoomLevel:11,
        numZoomLevels:11,
        units:"m",
        center: new
OpenLayers.LonLat(lon=707751.653645,lat=232444.48785022),
        zoom:8
    }

    map = new OpenLayers.Map("map", mapOptions);

    var baseLyr = new OpenLayers.Layer("Fake BaseLayer");
    baseLyr.isBaseLayer=true;

    lyr1 = new OpenLayers.Layer.Image("Image Overlay",
"http://www.ritholtz.com/blog/wp-content/uploads/2010/02/Fusion-IQ-floor-pla
n.png",
        new OpenLayers.Bounds(707650,232400,707850,232500),
        new OpenLayers.Size(0,0),
        {
            projection:"EPSG:21781",
            isBaseLayer:false,
            visibility:true
        }
    );
    map.addLayers([baseLyr,lyr1]);

    map.setCenter(mapOptions["center"], mapOptions["zoom"]);
}

good luck,
Arnd 



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Layer-Image-not-working-as-Overlay-tp5031200p5031915.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list