<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ES link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello Gery,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I appreciate your help,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>But what I want to do is to deal with the pixel problem, I mean to know which conversion is needed… I understand I could inherit and modify Openlayers GetFeatureInfo object as you said, but my intention here is also learn and understand this issue.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Mario Núñez Jiménez<o:p></o:p></span></b></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>GEO Lab<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Enviroment Sector<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Energy & Utilities Market<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Research & Innovation<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><img width=128 height=37 id="Picture_x0020_3" src="cid:image001.gif@01CE0B78.BC11D770" alt="Description: Description: cid:image002.gif@01CCBF15.A5A76050"></span><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>T +34 912148100<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>F +34 917543252<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><a href="mailto:mario.nunez@atosresearch.eu">mario.nunez@atosresearch.eu</a><o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><a href="mailto:mario.nunez@atos.net">mario.nunez@atos.net</a><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Calle Albarracin 25<o:p></o:p></span></p><p class=MsoNormal><span lang=IT style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>(28037) Madrid, Spain<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><img border=0 width=128 height=3 id="Picture_x0020_4" src="cid:image002.gif@01CE0B78.BC11D770" alt="Description: Description: cid:image001.gif@01CCBF15.A5A76050"><img border=0 width=128 height=3 id="Picture_x0020_5" src="cid:image002.gif@01CE0B78.BC11D770" alt="Description: Description: cid:image001.gif@01CCBF15.A5A76050"><o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Gery . [mailto:gamejihou@hotmail.com] <br><b>Sent:</b> viernes, 15 de febrero de 2013 12:31<br><b>To:</b> Mario Nuñez Jimenez<br><b>Cc:</b> openlayers-users@lists.osgeo.org<br><b>Subject:</b> Re: [OpenLayers-Users] custom getFeatureInfo control / problem with layer pixels<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hola Mario,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You have to start with this to create your own control:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>OpenLayers.Control.mygetFeatureInfo = OpenLayers.Class(OpenLayers.Control.getFeatureInfo,{ <br>            // put here the things you need to add or change from the original control<br>}); <o:p></o:p></p></div><div><p class=MsoNormal><br><br><o:p></o:p></p></div><div><p class=MsoNormal>This is a complete approach (I think) if you want to overwrite or change the whole original control: <span style='font-size:11.5pt'><a href="http://stackoverflow.com/questions/9810684/openlayers-updating-initialize-method-of-class-call">http://stackoverflow.com/questions/9810684/openlayers-updating-initialize-method-of-class-call</a></span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.5pt'><br><br></span><o:p></o:p></p></div><div><p class=MsoNormal>Also this link can give you an idea: <a href="http://osgeo-org.1560.n6.nabble.com/Order-Priority-of-Control-GetFeature-and-Control-WMSGetFeatureInfo-on-click-td4997282.html" target="_top">http://osgeo-org.1560.n6.nabble.com/Order-Priority-of-Control-GetFeature-and-Control-WMSGetFeatureInfo-on-click-td4997282.html</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>About the pixel stuff, you can control that with tolerance, that's in pixels if remember well, I use 10 pixels and works great.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>So you need to pick on the map and then show some kind of inset map like the permalink control? If you need messages saying "you click here or there, inside or outside, etc...", you can use mapserver with templates or simply geoext popup: <span style='font-size:11.5pt'><a href="http://api.geoext.org/1.1/examples/popup.html">http://api.geoext.org/1.1/examples/popup.html</a></span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.5pt'><br><br></span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.5pt'>Cheers,</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.5pt'><br><br></span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:11.5pt'>Gery<br></span><br>Sent from my iBath<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>On Feb 15, 2013, at 11:14, "Mario Nuñez Jimenez" <<a href="mailto:mario.nunez@atosresearch.eu">mario.nunez@atosresearch.eu</a>> wrote:<o:p></o:p></p></div><div><p class=MsoNormal>Hello Gery,<br>I am just trying to do my own getFeatureInfo control by capturing the click on map event.<br><br>The problem is to fit the x and y pixels from the click event on the x and y needed to do a getfeatureinfo request  to my wms.<br><br>The idea is that the X and Y from the event are taken from the viewport/base layer (the complete picture shown in the map) but I need to do a get feature info request about other layer loaded in the map, a smaller map shown over the base layer (it only occupies a small area).<br><br>Every time I want to use the X and Y that I get from the event I have a result from my getfeatureinfo request even If I clicked out that layer area, so it's a nonsense since it should replied with some kind of "you are out of the layer extension so there is no data were you clicked".  Also if I cliked in a subarea of my layer the result of the getfeatureinfo request says "you clicked in area Z" but I didn't clicked in subarea Z, so I think the X and Y should be related to the layer you are querying  but I don't know how to do that.<br><br>Cheers,<br>Mario.<br><br>-----Original Message-----<br>From: Gery . [<a href="mailto:gamejihou@hotmail.com">mailto:gamejihou@hotmail.com</a>] <br>Sent: jueves, 14 de febrero de 2013 20:45<br>To: Mario Nuñez Jimenez<br>Cc: <a href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a><br>Subject: Re: [OpenLayers-Users] custom getFeatureInfo control / problem with layer pixels<br><br>I've recently tested the openlayers.control.getfeature to do something related to your question but sorry to say this, I didn't understand what you're trying to do.<br><br>Sent from my iBath<br><br>On Feb 14, 2013, at 19:12, "negroscuro" <<a href="mailto:mario.nunez@atosresearch.eu">mario.nunez@atosresearch.eu</a>> wrote:<br><br>Hello,<br>I am trying to do a customized getFeatureInfo, so in order to do the request to the WMS I need to know the I and J defined in the OGC WMS 1.3.0 specification, I mean to do the getFeatureInfo request i need a I and J, being those I and J pixels of the layer.<br><br>If I am not wrong, when I implemented a control to handle the click on map event, I get a X and Y pixels but those pixels I guess that dont match the layers ones because that x and y from the event are based in the viewport extension and not in a concrete layer extension so my question here is how to get the choosen layer X and Y when I click on it or just get some null value to know that I am clicking outside my concrete layer.<br><br>I know which layer is selected but I dont know how to convert the vieport x and y clicked in that layer's X and Y pixels.<br><br>Do I explained myself clearly enough?<br>Sorry for my english.<br>Thank you in advance for helping<br>Cheers.<br><br><br><br>--<br>View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/custom-getFeatureInfo-control-problem-with-layer-pixels-tp5034389.html">http://osgeo-org.1560.n6.nabble.com/custom-getFeatureInfo-control-problem-with-layer-pixels-tp5034389.html</a><br>Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>------------------------------------------------------------------<br>This e-mail and the documents attached are confidential and intended <br>solely for the addressee; it may also be privileged. If you receive <br>this e-mail in error, please notify the sender immediately and destroy it. <br>As its integrity cannot be secured on the Internet, the Atos <br>group liability cannot be triggered for the message content. Although <br>the sender endeavours to maintain a computer virus-free network, <br>the sender does not warrant that this transmission is virus-free and <br>will not be liable for any damages resulting from any virus transmitted. <br><br>Este mensaje y los ficheros adjuntos pueden contener informacion confidencial <br>destinada solamente a la(s) persona(s) mencionadas anteriormente <br>pueden estar protegidos por secreto profesional. <br>Si usted recibe este correo electronico por error, gracias por informar <br>inmediatamente al remitente y destruir el mensaje. <br>Al no estar asegurada la integridad de este mensaje sobre la red, Atos <br>no se hace responsable por su contenido. Su contenido no constituye ningun <br>compromiso para el grupo Atos, salvo ratificacion escrita por ambas partes. <br>Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor <br>no puede garantizar nada al respecto y no sera responsable de cualesquiera <br>danos que puedan resultar de una transmision de virus. <br>------------------------------------------------------------------<o:p></o:p></p></div></div><DIV> </DIV>------------------------------------------------------------------<br>This e-mail and the documents attached are confidential and intended <br>solely for the addressee; it may also be privileged. If you receive <br>this e-mail in error, please notify the sender immediately and destroy it. <br>As its integrity cannot be secured on the Internet, the Atos <br>group liability cannot be triggered for the message content. Although <br>the sender endeavours to maintain a computer virus-free network, <br>the sender does not warrant that this transmission is virus-free and <br>will not be liable for any damages resulting from any virus transmitted. <br><br>Este mensaje y los ficheros adjuntos pueden contener informacion confidencial <br>destinada solamente a la(s) persona(s) mencionadas anteriormente <br>pueden estar protegidos por secreto profesional. <br>Si usted recibe este correo electronico por error, gracias por informar <br>inmediatamente al remitente y destruir el mensaje. <br>Al no estar asegurada la integridad de este mensaje sobre la red, Atos <br>no se hace responsable por su contenido. Su contenido no constituye ningun <br>compromiso para el grupo Atos, salvo ratificacion escrita por ambas partes. <br>Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor <br>no puede garantizar nada al respecto y no sera responsable de cualesquiera <br>danos que puedan resultar de una transmision de virus. <br>------------------------------------------------------------------</body></html>