[OpenLayers-Users] custom getFeatureInfo control / problem with layer pixels

Mario Nuñez Jimenez mario.nunez at atosresearch.eu
Fri Feb 15 02:13:56 PST 2013


Hello Gery,
I am just trying to do my own getFeatureInfo control by capturing the click on map event.

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.

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).

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.

Cheers,
Mario.

-----Original Message-----
From: Gery . [mailto:gamejihou at hotmail.com] 
Sent: jueves, 14 de febrero de 2013 20:45
To: Mario Nuñez Jimenez
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] custom getFeatureInfo control / problem with layer pixels

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.

Sent from my iBath

On Feb 14, 2013, at 19:12, "negroscuro" <mario.nunez at atosresearch.eu> wrote:

Hello,
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.

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.

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.

Do I explained myself clearly enough?
Sorry for my english.
Thank you in advance for helping
Cheers.



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/custom-getFeatureInfo-control-problem-with-layer-pixels-tp5034389.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
------------------------------------------------------------------
This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive 
this e-mail in error, please notify the sender immediately and destroy it. 
As its integrity cannot be secured on the Internet, the Atos 
group liability cannot be triggered for the message content. Although 
the sender endeavours to maintain a computer virus-free network, 
the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted. 

Este mensaje y los ficheros adjuntos pueden contener informacion confidencial 
destinada solamente a la(s) persona(s) mencionadas anteriormente 
pueden estar protegidos por secreto profesional. 
Si usted recibe este correo electronico por error, gracias por informar 
inmediatamente al remitente y destruir el mensaje. 
Al no estar asegurada la integridad de este mensaje sobre la red, Atos 
no se hace responsable por su contenido. Su contenido no constituye ningun 
compromiso para el grupo Atos, salvo ratificacion escrita por ambas partes. 
Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor 
no puede garantizar nada al respecto y no sera responsable de cualesquiera 
danos que puedan resultar de una transmision de virus. 
------------------------------------------------------------------


More information about the Users mailing list