[OpenLayers-Users] Get Feature Info in pop up from geoserver

Ivan Grcic ivan.grcic at geo-solutions.it
Fri May 6 05:02:29 EDT 2011


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 <sukuchha at yahoo.de> 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
> Users at lists.osgeo.org
> 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

-------------------------------------------------------


More information about the Users mailing list