3
<title>OpenLayers Feature Info Example</title>
4
<script src="../lib/OpenLayers.js"></script>
5
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
6
<link rel="stylesheet" href="style.css" type="text/css" />
7
<style type="text/css">
8
ul, li { padding-left: 0px; margin-left: 0px; }
12
<h1 id="title">Feature Info Example</h1>
17
Demonstrates sending a GetFeatureInfo query to an OWS. Returns information about a map feature in the side DIV.
20
<a id="permalink" href="">Permalink</a><br />
22
<div style="float:right;width:28%">
23
<h1 style="font-size:1.3em;">CIA Factbook</h1>
24
<p style="font-size:.8em;">Click a country to see statistics about the country below.</p>
28
<div id="map" class="smallmap"></div>
30
<script defer="defer" type="text/javascript">
31
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";
32
var map = new OpenLayers.Map('map', {'maxResolution':'auto'});
34
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
35
"http://world.freemap.in/cgi-bin/mapserv?map=/www/freemap.in/world/map/factbook.map", {'layers': 'factbook'} );
37
map.addControl(new OpenLayers.Control.Permalink('permalink'));
38
map.zoomToMaxExtent();
39
map.events.register('click', map, function (e) {
40
OpenLayers.Util.getElement('nodeList').innerHTML = "Loading... please wait...";
41
var url = wms.getFullRequestString({
42
REQUEST: "GetFeatureInfo",
43
EXCEPTIONS: "application/vnd.ogc.se_xml",
44
BBOX: wms.map.getExtent().toBBOX(),
47
INFO_FORMAT: 'text/html',
48
QUERY_LAYERS: wms.params.LAYERS,
49
WIDTH: wms.map.size.w,
50
HEIGHT: wms.map.size.h});
51
OpenLayers.loadURL(url, '', this, setHTML);
52
OpenLayers.Event.stop(e);
54
function setHTML(response) {
55
OpenLayers.Util.getElement('nodeList').innerHTML = response.responseText;