I am using annotorious plugin in my project. I am using it with openLayer and in that ImageLayer. The issue which I am facing is when I initialize plugin, image get stretched. Check my code below.
init_annotorious = function()
{
var img_src = $('#map').attr('attr-img-src');
$('#map').removeClass('annotorious_map');
if(typeof img_src != "undefined" && img_src != "")
{
$('#map').addClass('annotorious_map');
$('.annotate-action-btn').show();
anno.destroy();
$('#map').html("");
map = new OpenLayers.Map('map', { numZoomLevels: 4 });
var proof = new OpenLayers.Layer.Image('proofimg', img_src, new OpenLayers.Bounds(-600, -500, 250, 600), new OpenLayers.Size(375, 750));
proof.setIsBaseLayer(true);
proof.display(true);
map.addLayer(proof);
map.setCenter(new OpenLayers.LonLat(0,0),0,false,true)
anno.makeAnnotatable(map);
add_floor_coordinates();
}
}
Note : I am not allowed to change image dimensions at any cost. Image can be of any height width.
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(-600, -500, 250, 600), new OpenLayers.Size(375, 750));
Hi,
I am using annotorious plugin in my project. I am using it with openLayer and in that ImageLayer. The issue which I am facing is when I initialize plugin, image get stretched. Check my code below. init_annotorious = function() { var img_src = $('#map').attr('attr-img-src');
Note : I am not allowed to change image dimensions at any cost. Image can be of any height width.
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(-600, -500, 250, 600), new OpenLayers.Size(375, 750));