You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure is this a bug or not, but I am facing an image get stretched issue. Might I am missing something. Below is my code for clear understanding.
var img_src = "dynamic image url";
map = new OpenLayers.Map('map', { numZoomLevels: 4 });
var proof = new OpenLayers.Layer.Image(
'proofimg',
img_src,
new OpenLayers.Bounds(-375, -750, 375, 750),
new OpenLayers.Size(375, 750)
);
proof.setIsBaseLayer(true);
proof.display(true);
map.addLayer(proof);
map.setCenter(new OpenLayers.LonLat(0,0),0,false,true);
Note : I am not allowed to change image dimensions at any cost. Image can be of any height width and this img_src will be dynamic(it will be uploaded by end user), coming straight from database. Any new way of initialization is welcomed. I mean using any property of ol2
I need a way where this height, width could be set automatically.
Below is the line where I think something could be done.
var proof = new OpenLayers.Layer.Image(
'proofimg',
img_src,
new OpenLayers.Bounds(-375, -750, 375, 750),
new OpenLayers.Size(375, 750)
);
The text was updated successfully, but these errors were encountered:
HI,
I am not sure is this a bug or not, but I am facing an image get stretched issue. Might I am missing something. Below is my code for clear understanding.
Note : I am not allowed to change image dimensions at any cost. Image can be of any height width and this img_src will be dynamic(it will be uploaded by end user), coming straight from database. Any new way of initialization is welcomed. I mean using any property of ol2
I need a way where this height, width could be set automatically.
Below is the line where I think something could be done.
var proof = new OpenLayers.Layer.Image(
'proofimg',
img_src,
new OpenLayers.Bounds(-375, -750, 375, 750),
new OpenLayers.Size(375, 750)
);
The text was updated successfully, but these errors were encountered: