Hi, it seems that for some reason you are not getting any features back from you geoserver. (are you sure there are some features at requested point?)
This can also happen due to several things, but most likely your layer is not configured with correct spatial reference system, so geoserver doesnt return any feature at requested point. Cheers, Ivan On Fri, May 6, 2011 at 5:59 PM, Sukuchha Shrestha <[email protected]> wrote: > Hello ivan, > Thank you very much for pointing me towards the righ path. I tried to apply > as shown in that html but but i ran into the problem again. > Somehow my pop is not returning the get feature info but empty. I tried to > see with firebug and i found that the geoserver is actually returning > something. > <html> > <head> > <title>Geoserver GetFeatureInfo output</title> > </head> > <style type="text/css"> > table.featureInfo, table.featureInfo td, table.featureInfo th { > border:1px solid #ddd; > border-collapse:collapse; > margin:0; > padding:0; > font-size: 90%; > padding:.2em .1em; > } > table.featureInfo th { > padding:.2em .2em; > font-weight:bold; > background:#eee; > } > table.featureInfo td{ > background:#fff; > } > table.featureInfo tr.odd td{ > background:#eee; > } > table.featureInfo caption{ > text-align:left; > font-size:100%; > font-weight:bold; > text-transform:uppercase; > padding:.2em .2em; > } > </style> > <body> > > </body> > </html> > I guess this is header template that is there is geoserver. Ideally it > should come with content templete as well. > Any idea what is the problem here. > Thanks > Sukuchha > ________________________________ > Von: Ivan Grcic <[email protected]> > An: Sukuchha Shrestha <[email protected]> > CC: [email protected] > Gesendet: Freitag, den 6. Mai 2011, 11:02:29 Uhr > Betreff: Re: [OpenLayers-Users] Get Feature Info in pop up from geoserver > > Hi Sukuchha, > > You should use openlayers popup feature. > > This example is perfect for you : > http://openlayers.org/dev/examples/getfeatureinfo-popup.html > > Regards, > Ivan > > On Fri, May 6, 2011 at 10:49 AM, Sukuchha Shrestha <[email protected]> > wrote: >> Hello nice people, >> i am trying to display get feature info of WMS layers coming from my >> geoserver. I do not have much experience with open layers and geoserver as >> well. >> This is what geoserver preview layers give to me: >> // support GetFeatureInfo >> map.events.register('click', map, function (e) { >> document.getElementById('nodelist').innerHTML = >> "Loading... please wait..."; >> var params = { >> REQUEST: "GetFeatureInfo", >> EXCEPTIONS: "application/vnd.ogc.se_xml", >> BBOX: map.getExtent().toBBOX(), >> X: e.xy.x, >> Y: e.xy.y, >> INFO_FORMAT: 'text/html', >> QUERY_LAYERS: map.layers[0].params.LAYERS, >> FEATURE_COUNT: 50, >> Layers: 'sf:bugsites', >> Styles: '', >> WIDTH: map.size.w, >> HEIGHT: map.size.h, >> format: format}; >> >> OpenLayers.loadURL("http://localhost:8080/geoserver/wms", params, this, >> setHTML, setHTML); >> OpenLayers.Event.stop(e); >> }); >> } >> function setHTML(response){ >> document.getElementById('nodelist').innerHTML = >> response.responseText; >> }; >> >> But in my case, I want to display the getfeatureinfo not in a external div >> but on a openlayers right beside the where user have clicked. If, any one >> could provide me a working code to do this and explain in a coincise >> manner >> ?? >> Sorry if this is too basic stuff for some people ! I am in class 1 of >> openlayers and geoserver :)) >> Sukuchha >> >> _______________________________________________ >> Users mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/openlayers-users >> >> > > > > -- > ------------------------------------------------------- > Ivan Grcic > GeoSolutions S.A.S. > Software Engineer > > > Via Poggio alle Viti 1187 > 55054 Massarosa (LU) > Italy > > phone: +39 0584 962313 > fax: +39 0584 962313 > > http://www.geo-solutions.it > http://geo-solutions.blogspot.com/ > http://twitter.com/geosolutions_it > http://www.youtube.com/user/GeoSolutionsIT > > ------------------------------------------------------- > -- ------------------------------------------------------- Ivan Grcic GeoSolutions S.A.S. Software Engineer Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://twitter.com/geosolutions_it http://www.youtube.com/user/GeoSolutionsIT ------------------------------------------------------- ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
