Arnd, 

Did you mean I can display image right inside polygon? I attached the 
screenshot here that shows my polygons.

Each of these polygons represents the four corners of sensed images from 
devices of aircrafts.

Thanks.

JK

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Monday, August 29, 2011 1:21 PM
To: JK Chen
Cc: [email protected]
Subject: AW: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Hi,

new OpenLayers.Bounds(-118.354,32.834, -118.383, 32.819) should be new 
OpenLayers.Bounds(left, bottom, right, top)

but

-118.354 > -118.383
  32.834 >   32.819

try
new OpenLayers.Bounds(-118.383, 32.819, -118.354,32.834)

Openlayers can't display rotated images as Layer.Image. If you want to display 
rotated images, you can use as workaround a vector layer with point feature and 
externalGraphic.

Good Luck
Arnd

-----Ursprüngliche Nachricht-----
Von: JK Chen [mailto:[email protected]]
Gesendet: Montag, 29. August 2011 18:16
An: [email protected]; [email protected]
Betreff: RE: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Well, it is not working for me. 

My image is not up-right rectangle. Mine are skewed rectangles. 

1. The BBOX for OpenLayers.Image does not have a way to specify that, Please, 
OL folks can you confirm that?
2. If I put in the two values of bottom left and top right, my image will not 
load.
3. If I specify (-180, -90, 180, 90) for BBox, my image will load. But as you 
know, it is not correct. In terms of aspect ratio.

Here is my image, it's four corners, and my OL code. My image is NITF military 
image, I have converted to JPEG listed in this email.

Thanks.

-- ol code -- 
    map = new OpenLayers.Map('map_element', {});
    var image_layer = new OpenLayers.Layer.Image(
      'Wallpaper',
      'http://localhost:8080/198/lynx2003050817522799.ntf.jpg',
 
//'http://localhost:8080/187/31AUG939Z0000002ZX000013ZZ0000004DB89A19.ntf.jp
g', 
      //'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
      //new OpenLayers.Bounds(-180,-90,180,90),  // this will display the 
image, but of course it's not right in aspect ratio
      new OpenLayers.Bounds(-118.354,32.834, -118.383, 32.819),  // these 
values are "correct", but the image will NOT load
      new OpenLayers.Size(0,0),
      {numZoomLevels:10, maxResolution:.625}
     );

--- the four corners

Corner Coordinates:
Upper Left  (-118.3786921,  32.8152343) (118d22'43.29"W, 32d48'54.84"N) Lower 
Left  (-118.3537928,  32.8343191) (118d21'13.65"W, 32d50'3.55"N) Upper Right 
(-118.3825927,  32.8188274) (118d22'57.33"W, 32d49'7.78"N) Lower Right 
(-118.3576934,  32.8379122) (118d21'27.70"W, 32d50'16.48"N)
Center      (-118.3681927,  32.8265733) (118d22'5.49"W, 32d49'35.66"N)

--- my image (nitf) display in OpenEV
--  my image file (jpeg)
JK

-----Original Message-----
From: JK Chen
Sent: Monday, August 29, 2011 8:00 AM
To: '[email protected]'
Cc: [email protected]
Subject: RE: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Very good. Thanks.
BTW, the example says the size value has no effect. Perfect for me.

Regards.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, August 25, 2011 12:38 PM
To: JK Chen
Cc: [email protected]
Subject: AW: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Hi,

You have to know the width and height in map units and the insert point for 
your image.

Say x0,y0 und w,h im map units, then

imgLayer.extent=new OpenLayers.Bounds(x0,y0,x0+w,y0+h);

Here you can see, how it works:
http://gis.ibbeck.de/OLClient/examples/ArcGIS93Rest.html
 
Regards,
Arnd


-----Ursprüngliche Nachricht-----
Von: JK Chen [mailto:[email protected]]
Gesendet: Donnerstag, 25. August 2011 16:23
An: [email protected]
Cc: [email protected]
Betreff: RE: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Suppose my image is w and h, how I code? Into extent? Why?

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, August 24, 2011 6:20 PM
To: JK Chen
Cc: [email protected]
Subject: AW: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Hi,

Try to set a new extent for the layer:

imgLayer.extent=new OpenLayers.Bounds(-70,-10,70,10);

This is perhaps needed to refresh the layer imgLayer.setVisibility(false); 
imgLayer.setVisibility(true);
 
Arnd

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von jk
Gesendet: Mittwoch, 24. August 2011 21:27
An: [email protected]
Betreff: [OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

Hi,

I am trying to use OL to view military images, jpeg, of various dimensions.
I need to maintain the orginal aspect. Now, how to specify the size values when 
creating a new Layer.Image?

Is it possible to change those values after image loads?

How?

Thanks.

JK

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/how-to-change-the-size-of-OpenLayers-
Layer-Image-tp6721664p6721664.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


<<attachment: polygon.jpg>>

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to