[OpenLayers-Users] Image layer on top of OSM

Egil Möller egil at skytruth.org
Tue Aug 20 07:44:26 PDT 2013


Hi!

I'm trying to add an Image layer on top of an OSM layer, and it only
semi-works. The following code produces an image in more or less the
right position on my map:

  map.addLayer(new OpenLayers.Layer.Image(
    'imagery',
   
'https://s3.amazonaws.com/FrackFinder/Tadpole/well+pad+examples/empty+well+pads/2010tioga_spudbuffer16.png',
    bounds.transform(   
      new OpenLayers.Projection("EPSG:4326"),
      map.getProjection()),
    new OpenLayers.Size(400, 400),
    {
        opacity: 1.0,   
        isBaseLayer: false,
        numZoomLevels: 20,
        alwaysInRange: true
     }
  ));
 
This however means that the image has to align with the projection of
OSM! I tried:

  map.addLayer(new OpenLayers.Layer.Image(
    'imagery',
   
'https://s3.amazonaws.com/FrackFinder/Tadpole/well+pad+examples/empty+well+pads/2010tioga_spudbuffer16.png',
    bounds,
    new OpenLayers.Size(400, 400),
    {
        opacity: 1.0,   
        isBaseLayer: false,
        numZoomLevels: 20,
        alwaysInRange: true,
        projection: new OpenLayers.Projection("EPSG:4326")
     }
  ));

But this fails entirely (the image just doesn't show up)...

Any ideas?

/Egil

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130820/7c0852f5/attachment.pgp>


More information about the Users mailing list