[OpenLayers-Users] how to change the size of OpenLayers.Layer.Image

JK Chen jk.chen at sdl.usu.edu
Mon Aug 29 10:00:20 EDT 2011


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

Regards.

-----Original Message-----
From: arnd.wippermann at web.de [mailto:arnd.wippermann at web.de] 
Sent: Thursday, August 25, 2011 12:38 PM
To: JK Chen
Cc: users at openlayers.org
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:jk.chen at sdl.usu.edu]
Gesendet: Donnerstag, 25. August 2011 16:23
An: arnd.wippermann at web.de
Cc: users at openlayers.org
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: arnd.wippermann at web.de [mailto:arnd.wippermann at web.de]
Sent: Wednesday, August 24, 2011 6:20 PM
To: JK Chen
Cc: users at openlayers.org
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: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von jk
Gesendet: Mittwoch, 24. August 2011 21:27
An: users at openlayers.org
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
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list