Within OpenLayers, I have two images, both jpg with world files, and each 1440 x 900 px. The two images are geographically located next to each other. Is there a way to display both images at the same time. I can make an image layer for each and use the Layer Selector to toggle between them, but I cannot figure out how to display both images together.

From my reading it appears that an image layer is a base layer, and since two base layers cannot be active at the same time, I can only have one or the other active.


2 Answers 2


An image layer is a layer pointing to an image at some URL. You can specify if you can they act as base layer with the "isBaseLayer" property. simply set it to false to act as overlay.

Here is a sample using image layer (http://openlayers.org/dev/examples/image-layer.html):

        var graphic = new OpenLayers.Layer.Image(
            'City Lights',
            new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
            new OpenLayers.Size(580, 288),

If you want the image were visible always (at any level or without specifying levels) set the 'alwaysInRange' (inherit from base Layer class) to true.


If you want/need/have to have it as a base layer - why not combine the 2 images into 1 (say with Paint.net) and then you have just 1 image in 1 base layer?

Other option would be to have 2 non-base layers that are always on and you can have the 2 images next to each other that way. You can even have a blank base map, that way there's nothing else on the map except your 2 images. And as you add more layers, your 2 non-base layers, basically become 'base layers' because they'll be at the bottom of the stack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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