Friday, 25 December 2015

image - Help displaying jpg in OpenLayers?


I am trying to overlay a jpg image over an OpenLayers map. I have been to the example on their site and looked all over for a solution with no luck. So I am guessing that their are rules for setting an openlayers.layer.image as an overlay layer. I have tried jpg, png, gif. They all work fine as a base layer with the following code:



var image_layer = new OpenLayers.Layer.Image( 'Wallpaper', 'images.png', new 
OpenLayers.Bounds(-90,-45,90,45), new OpenLayers.Size(318,159), {numZoomLevels:7,
maxResolution:.625} );

But once I include:


var image_layer = new OpenLayers.Layer.Image( 'Wallpaper', 'images.png', new 
OpenLayers.Bounds(-90,-45,90,45), new OpenLayers.Size(318,159), {numZoomLevels:7,
maxResolution:.625, **isBaseLayer: false**} );

the layer is grey out within the layer switcher



I did figure out that if I include two different image layers - I can specify the second as an overlay. However, once I add a WMS, that overlay greys out!


What am I doing wrong - or better yet - what is OpenLayers doing wrong?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...