Hello again,<br><br>as you can see in your request the output format of your request is <a href="http://10.0.80.41:7004/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Anetworkcoverage&QUERY_LAYERS=topp%3Anetworkcoverage&STYLES=&BBOX=72.96062%2C33.634027%2C73.097949%2C33.737024&FEATURE_COUNT=10&HEIGHT=600&WIDTH=800&FORMAT=image%2Fgif&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=130&Y=208" target="_blank">INFO_FORMAT=text%2Fhtml</a>. To get the info in json format you just need to make a template which will return text/html but formatted in the JSON way. You'll need to put this template in the folder of your layer inside data_dir folder of geoserver. After that, you'll have your response in JSON.<br>
This is my experience and i don't know if you have another way of achieving what you are trying to achieve. I've been working with Geoserver 1.7.6 and so i really don't know if more recent release have other options to do this.<br>
<br>Cheers,<br>Hugo<br><br><div class="gmail_quote">On Tue, Jun 8, 2010 at 1:59 PM, Imran Rajjad <span dir="ltr"><<a href="mailto:rajjad@gmail.com">rajjad@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
thanks for your reply, actually I had the json response working with<br>
geoserver in my previous client , which did not use any API , since<br>
now I`m using Openlayers. I made this wmsgetfeatureInfo object. Fire<br>
Bug shows a url like<br>
<br>
<a href="http://10.0.80.41:7004/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Anetworkcoverage&QUERY_LAYERS=topp%3Anetworkcoverage&STYLES=&BBOX=72.96062%2C33.634027%2C73.097949%2C33.737024&FEATURE_COUNT=10&HEIGHT=600&WIDTH=800&FORMAT=image%2Fgif&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=130&Y=208" target="_blank">http://10.0.80.41:7004/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Anetworkcoverage&QUERY_LAYERS=topp%3Anetworkcoverage&STYLES=&BBOX=72.96062%2C33.634027%2C73.097949%2C33.737024&FEATURE_COUNT=10&HEIGHT=600&WIDTH=800&FORMAT=image%2Fgif&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=130&Y=208</a><br>
<br>
when i copy paste this url seperately in a browser I get the response.<br>
I have gone through the docs. There is no example on how to query a<br>
wms layer with Json response. Do I need to specify some function in<br>
wmsgetfeatureinfo where the response should be received. However I<br>
will check this links, thanks a lot<br>
<br>
regards,<br>
Imran<br>
<div><div></div><div class="h5"><br>
On Tue, Jun 8, 2010 at 5:54 PM, Hugo <<a href="mailto:hfpmartins@gmail.com">hfpmartins@gmail.com</a>> wrote:<br>
> Hello Imran,<br>
><br>
> The problem you are facing has nothing to do with openlayers, it is though<br>
> related with geoserver. I'm not sure if current releases of geoserver<br>
> already present the json output format but you can always program a template<br>
> to return your results in json format. Check the following sites and if you<br>
> have further questions i think you'll have better chances of getting an<br>
> answer to this problem in the geoserver list.<br>
><br>
> <a href="http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates" target="_blank">http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates</a><br>
> <a href="http://geoserver.org/display/GEOSDOC/Freemarker+templates" target="_blank">http://geoserver.org/display/GEOSDOC/Freemarker+templates</a><br>
> <a href="http://docs.geoserver.org/stable/en/user/googleearth/tutorials/kmlplacemark/index.html" target="_blank">http://docs.geoserver.org/stable/en/user/googleearth/tutorials/kmlplacemark/index.html</a><br>
> <a href="http://freemarker.sourceforge.net/docs/index.html" target="_blank">http://freemarker.sourceforge.net/docs/index.html</a><br>
><br>
> Hope this can help.<br>
> Cheers,<br>
><br>
> Hugo Martins<br>
><br>
> On Tue, Jun 8, 2010 at 1:42 PM, Imran Rajjad <<a href="mailto:rajjad@gmail.com">rajjad@gmail.com</a>> wrote:<br>
>><br>
>> firebug is showing the following request parameters<br>
>><br>
>> BBOX 72.925254,33.54194,73.199912,33.747933<br>
>> FEATURE_COUNT 10<br>
>> FORMAT image/gif<br>
>> HEIGHT 600<br>
>> INFO_FORMAT text/html<br>
>> LAYERS topp:networkcoverage<br>
>> QUERY_LAYERS topp:networkcoverage<br>
>> REQUEST GetFeatureInfo<br>
>> SERVICE WMS<br>
>> SRS EPSG:4326<br>
>> STYLES<br>
>> VERSION 1.1.1<br>
>> WIDTH 800<br>
>> X 690<br>
>> Y 295<br>
>><br>
>> On Tue, Jun 8, 2010 at 5:18 PM, Imran Rajjad <<a href="mailto:rajjad@gmail.com">rajjad@gmail.com</a>> wrote:<br>
>> > Hi ,<br>
>> ><br>
>> > my WMSGetFeatureInfo control is not returning any json,, my code is as<br>
>> > below<br>
>> ><br>
>> > basicControl = {<br>
>> > click : new OpenLayers.Control.WMSGetFeatureInfo({<br>
>> > url: '<a href="http://10.0.80.41:7004/geoserver/wms" target="_blank">http://10.0.80.41:7004/geoserver/wms</a>',<br>
>> > title: 'Identify features by clicking',<br>
>> > layers: [network_wms],<br>
>> > queryVisible: true,<br>
>> > vendorParams: {<br>
>> > version: "1.1.1",<br>
>> > info_format: "text/plain",<br>
>> > },<br>
>> > format : new OpenLayers.Format.GeoJSON()})<br>
>> > };<br>
>> ><br>
>> ><br>
>> > basicControl.click.events.register("getfeatureinfo",<br>
>> > this, showInfo);<br>
>> > map.addControl(basicControl.click);<br>
>> ><br>
>> > function showInfo(evt) {<br>
>> > alert(evt); //<br>
>> > }<br>
>> ><br>
>> ><br>
>> > when I check in FireBug. the request is sent but there is no<br>
>> > responseTexT, what am i doing wrong here<br>
>> ><br>
>> > regards,<br>
>> > Imran<br>
>> ><br>
>> ><br>
>> > On Tue, Jun 8, 2010 at 1:20 PM, Imran Rajjad <<a href="mailto:rajjad@gmail.com">rajjad@gmail.com</a>> wrote:<br>
>> >> Hi,<br>
>> >><br>
>> >> I`m trying to create a box selection that selects features from a wms<br>
>> >> overlay , I need the response to be in JSON and I also want to append<br>
>> >> my cql filter to this request.<br>
>> >><br>
>> >> Can anyone point me to the documentation closer to this task?<br>
>> >><br>
>> >> regarsd,<br>
>> >> Imran<br>
>> >><br>
>> >> --<br>
>> >> I.R<br>
>> >><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > I.R<br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> I.R<br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
><br>
><br>
><br>
> --<br>
> Hugo Martins<br>
> FMV-UTL<br>
> CIISA-Epidemiologia e Saúde Pública Veterinária<br>
> Av. da Universidade Técnica<br>
> 1300-477 Lisboa<br>
> N 38°42'49.54", W 9°11'43.42"<br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<font color="#888888">I.R<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Hugo Martins<br>FMV-UTL<br>CIISA-Epidemiologia e Saúde Pública Veterinária<br>Av. da Universidade Técnica<br>1300-477 Lisboa<br>N 38°42'49.54", W 9°11'43.42"<br>