I use javascript to get feature coordinates, then send this coordinates to the server to find feature in feature source, then create popup html.But every time when I apply different zoom level and click on the same feature I got different coordinates. As a result, I identify a wrong feature and got wrong popup.
How to get the right coordinates to find feature in feature source?
BElow is my code
var MapClientClick = function(e) {
//var lonlat = Map1.GetOpenLayersMap().getLonLatFromPixel(new OpenLayers.Pixel(e.clientX, e.clientY));
var lonlat = Map1.GetOpenLayersMap().getLonLatFromViewPortPx(new OpenLayers.Pixel(e.clientX, e.clientY));
alert(lonlat);
callServer(lonlat);
}