<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div style="-webkit-text-size-adjust: auto; ">Hola Mario,</div><div style="-webkit-text-size-adjust: auto; "><br></div><div style="-webkit-text-size-adjust: auto; ">You have to start with this to create your own control:</div><div style="-webkit-text-size-adjust: auto; "><br></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">OpenLayers.Control.mygetFeatureInfo = OpenLayers.Class(OpenLayers.Control.getFeatureInfo,{ <br>            // put here the things you need to add or change from the original control<br>}); </span><br style="color: rgb(54, 96, 146); font-family: Arial; font-size: 13px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); background-color: rgb(255, 255, 255); "></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">This is a complete approach (I think) if you want to overwrite or change the whole original control: </span><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><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></div><div><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><br></span></div><div style="-webkit-text-size-adjust: auto; ">Also this link can give you an <span style="background-color: rgba(255, 255, 255, 0); ">idea: <a href="http://osgeo-org.1560.n6.nabble.com/Order-Priority-of-Control-GetFeature-and-Control-WMSGetFeatureInfo-on-click-td4997282.html" target="_top" rel="nofollow" link="external">http://osgeo-org.1560.n6.nabble.com/Order-Priority-of-Control-GetFeature-and-Control-WMSGetFeatureInfo-on-click-td4997282.html</a></span></div><div style="-webkit-text-size-adjust: auto; "><br></div><div style="-webkit-text-size-adjust: auto; ">About the pixel stuff, you can control that with tolerance, that's in pixels if remember well, I use 10 pixels and works great.</div><div style="-webkit-text-size-adjust: auto; "><br></div><div style="-webkit-text-size-adjust: auto; ">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: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><a href="http://api.geoext.org/1.1/examples/popup.html">http://api.geoext.org/1.1/examples/popup.html</a></span></div><div><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);"><br></span></div><div><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">Cheers,</span></div><div><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);"><br></span></div><div><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">Gery<br></span><br><span style="-webkit-text-size-adjust: auto;">Sent from my iBath</span></div><div style="-webkit-text-size-adjust: auto; "><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:<br><br></div><div style="-webkit-text-size-adjust: auto; "><span>Hello Gery,</span><br><span>I am just trying to do my own getFeatureInfo control by capturing the click on map event.</span><br><span></span><br><span>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.</span><br><span></span><br><span>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).</span><br><span></span><br><span>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.</span><br><span></span><br><span>Cheers,</span><br><span>Mario.</span><br><span></span><br><span>-----Original Message-----</span><br><span>From: Gery . [<a href="mailto:gamejihou@hotmail.com">mailto:gamejihou@hotmail.com</a>] </span><br><span>Sent: jueves, 14 de febrero de 2013 20:45</span><br><span>To: Mario Nuñez Jimenez</span><br><span>Cc: <a href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a></span><br><span>Subject: Re: [OpenLayers-Users] custom getFeatureInfo control / problem with layer pixels</span><br><span></span><br><span>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.</span><br><span></span><br><span>Sent from my iBath</span><br><span></span><br><span>On Feb 14, 2013, at 19:12, "negroscuro" <<a href="mailto:mario.nunez@atosresearch.eu">mario.nunez@atosresearch.eu</a>> wrote:</span><br><span></span><br><span>Hello,</span><br><span>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.</span><br><span></span><br><span>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.</span><br><span></span><br><span>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.</span><br><span></span><br><span>Do I explained myself clearly enough?</span><br><span>Sorry for my english.</span><br><span>Thank you in advance for helping</span><br><span>Cheers.</span><br><span></span><br><span></span><br><span></span><br><span>--</span><br><span>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></span><br><span>Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.</span><br><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></span><br><span>------------------------------------------------------------------</span><br><span>This e-mail and the documents attached are confidential and intended </span><br><span>solely for the addressee; it may also be privileged. If you receive </span><br><span>this e-mail in error, please notify the sender immediately and destroy it. </span><br><span>As its integrity cannot be secured on the Internet, the Atos </span><br><span>group liability cannot be triggered for the message content. Although </span><br><span>the sender endeavours to maintain a computer virus-free network, </span><br><span>the sender does not warrant that this transmission is virus-free and </span><br><span>will not be liable for any damages resulting from any virus transmitted. </span><br><span></span><br><span>Este mensaje y los ficheros adjuntos pueden contener informacion confidencial </span><br><span>destinada solamente a la(s) persona(s) mencionadas anteriormente </span><br><span>pueden estar protegidos por secreto profesional. </span><br><span>Si usted recibe este correo electronico por error, gracias por informar </span><br><span>inmediatamente al remitente y destruir el mensaje. </span><br><span>Al no estar asegurada la integridad de este mensaje sobre la red, Atos </span><br><span>no se hace responsable por su contenido. Su contenido no constituye ningun </span><br><span>compromiso para el grupo Atos, salvo ratificacion escrita por ambas partes. </span><br><span>Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor </span><br><span>no puede garantizar nada al respecto y no sera responsable de cualesquiera </span><br><span>danos que puedan resultar de una transmision de virus. </span><br><span>------------------------------------------------------------------</span><br></div></body></html>