[OpenLayers-Users] Re: attribute data of a shape file(WMS)

Imran Rajjad rajjad at gmail.com
Thu Apr 26 07:46:36 EDT 2012


did you find this on your geoserver demo page?

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,
Styles: '',
Srs: 'EPSG:4326',
Layers: 'topp:myLayer',
WIDTH: map.size.w,
HEIGHT: map.size.h,
format: format};
updateFeatureInfoFilters(params);
OpenLayers.loadURL("http://myip:myport/geoserver/wms", params, this, setHTML,
setHTML);
OpenLayers.Event.stop(e);
});



//callback function
function setHTML(response){
document.getElementById('nodelist').innerHTML = response.responseText;
};

regards,
Imran

On Thu, Apr 26, 2012 at 4:39 PM, chamara prasanna <sacprasanna at gmail.com>wrote:

> I think i use wrong word to describe my problme.So i will ask again,Really
>> sorry for mistake
>
>
>  I am new to OpenLayers and I want to add
> OpenLayers.Control.WMSGetFeatureInfo to get feature
>
> info to website.But i can't figure out right method.
>
> I also see the source code of GeoServer OpenLayers page and still I can't
> find the syntax of OpenLayers.Control.WMSGetFeatureInfo code?
>
> I use geoserver,apache-tomcat-6.0.35 and open layer 2.10.Should i use
> proxy to call OpenLayers.Control.WMSGetFeatureInfo?
>
> This is my GeoServer WMS URL:
>
> http://localhost:8080/geoserver/sac/wms?
> service=WMS&
> version=1.1.0&
> request=GetMap&
> layers=sac:contour& <http://localhost:8080/geoserver/sac/wms?service=WMS&version=1.1.0&request=GetMap&layers=sac:contour&>
> styles=&
> bbox=187754.5,204980.703125,192031.40625,210022.890625&
> width=434&height=512&s
> rs=EPSG:5235&
> format=application/openlayers
>
> Pls give me sample code which calling
> OpenLayers.Control.WMSGetFeatureInfo? Thank you.
>
>>
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>


-- 
I.R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120426/47c3acb6/attachment.html


More information about the Users mailing list