Hello,<br><br>I have no geographic tiles show with OpenLayers.Layer.TileCache and I would like to put a Point(feature) at 50% x and 50% y for example <br><br>I have test this :<br><br>var zoom = map.getZoom();<br>var size = zoomDim[zoom]; // Size of my big image by zoom<br>
var x = 50 * size[1] / 100; // give me the x pixel from my image<br> var y = 50 * size[0] / 100; //give me the y pixel from my image<br> var pixel = map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(x,y)); // I have try this to get a correct pixel<br>
var coord = map.getLonLatFromPixel(pixel); <br> <br> vector.removeFeatures(vector.features);<br> var point = new OpenLayers.Geometry.Point(coord.lon, coord.lat);<br> vector.addFeatures( [ new OpenLayers.Feature.Vector(point.clone()) ]);<br>
<br>It's not work my Point is not on the image. I don't know how can I find a lonlat corresponding to my pixel or more simply how can use openlayers with no projection with just pixel because my data is not geographic<br clear="all">
<br>Thanks<br><br>Cheers<br><br>-- <br>Aumard Jimmy<br>Développeur <br><br>KINAXIA<br>c/o CICA / PacaEst<br>2229 Route des Crêtes<br>F-06560 Sophia Antipolis<br><br>Tél.: +33 (0)4 8973 0242<br>Mob.: +33 (0)6 6017 2827<br>
Fax : +33 (0)4 8307 6583<br><br><a href="http://www.kinaxia.fr">http://www.kinaxia.fr</a><br>