[OpenLayers-Users] Image layer obscured by image bounds.

Simon Knapp sleepingwell at gmail.com
Fri Feb 20 19:37:53 PST 2015


Hi List,

This is the first post from this newbie, so please complain/guide if I do a
bad job of explaining myself in this post

I have developed an application that returns an image encoded in a data url
to the user, which I place on my map using OpenLayers.Layer.Image. I'm not
sure this detail matters, but the user defines a polygon using
OpenLayers.Control.DrawFeature with the handler OpenLayers.Handler.Polygon.
and a layer named "polygonLayer" The image is added with:

resultLayer = new OpenLayers.Layer.Image(

    'Spatial result',

    resp.result.image.data,

    new OpenLayers.Bounds(resp.result.image.bounds),

    new OpenLayers.Size(resp.result.image.size.w, resp.result.image.size.h),

    {

        isBaseLayer: false,

        displayInLayerSwitcher: false,

        projection: new OpenLayers.Projection('EPSG:900913')

    }

)



The first time a user submits a polygon, the effect is spot on - the image
is rendered and looks lovely. When they send a second request, The result
is not so pretty, as the image is obscured by something that is probably a
representation of the bounding box (not sure if I can add images, but I
have tried)


[image: Inline image 1]


I've been asking Google for help for a while, but have not been able to
find the right words.


Can anyone advise on how I can stop this from happening?


Cheers,

Simon Knapp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20150221/e4798ae7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: layer-2.png
Type: image/png
Size: 19714 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20150221/e4798ae7/attachment-0001.png>


More information about the Users mailing list