[OpenLayers-Users] Get Feature Info in pop up from geoserver
Sukuchha Shrestha
sukuchha at yahoo.de
Fri May 6 04:49:45 EDT 2011
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110506/348a56a6/attachment-0001.html
More information about the Users
mailing list