I'm new at ol3, I'm trying to display my GIS view by updating my ol2 code.
I created the projection and I can display my static image but I'm obliged to use local extent [0, 0, 1024, 968] instead of my image extent [44823.715846278064, 66102.38217556383, 49823.715846278064, 71102.38217556383] otherwise I get a blank screen. In ol2 I made my bounds with the original datas and everything worked fine :/
here the new code :
var extent = [0, 0, 1024, 968]; var projection = new ol.proj.Projection({ units: 'pixels', extent: extent }); MAP = new ol.Map({ target: target, view: new ol.View({ projection: projection, center: ol.extent.getCenter(extent), zoom: 2 }) ); var imageProjection = new ol.proj.Projection({ units: 'pixels', extent: [0, 0, 1024, 968] }); var graphic = new ol.layer.Image({ source: new ol.source.ImageStatic({ url: layerData, projection: imageProjection, imageExtent: [0, 0, 1024, 968] }) }); MAP.addLayer(graphic);I need to keep the original extent to communicate with my server to generate the good image when moveend happens. I tried to use an EPSG:4326 projection but it doesn't work. I'm missing something but I don't know where.
أكثر...
I created the projection and I can display my static image but I'm obliged to use local extent [0, 0, 1024, 968] instead of my image extent [44823.715846278064, 66102.38217556383, 49823.715846278064, 71102.38217556383] otherwise I get a blank screen. In ol2 I made my bounds with the original datas and everything worked fine :/
here the new code :
var extent = [0, 0, 1024, 968]; var projection = new ol.proj.Projection({ units: 'pixels', extent: extent }); MAP = new ol.Map({ target: target, view: new ol.View({ projection: projection, center: ol.extent.getCenter(extent), zoom: 2 }) ); var imageProjection = new ol.proj.Projection({ units: 'pixels', extent: [0, 0, 1024, 968] }); var graphic = new ol.layer.Image({ source: new ol.source.ImageStatic({ url: layerData, projection: imageProjection, imageExtent: [0, 0, 1024, 968] }) }); MAP.addLayer(graphic);I need to keep the original extent to communicate with my server to generate the good image when moveend happens. I tried to use an EPSG:4326 projection but it doesn't work. I'm missing something but I don't know where.
أكثر...