Changed example to follow our well known structure. Now it also works in IE.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9162 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-04-01 15:59:52 +00:00
parent bfc17248e9
commit f37ee550f4

View File

@@ -7,29 +7,13 @@
<style type="text/css">
ul, li { padding-left: 0px; margin-left: 0px; }
</style>
</head>
<body>
<h1 id="title">Feature Info Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates the WMSGetFeatureInfo control for fetching information about a position from WMS.
</p>
<a id="permalink" href="">Permalink</a><br />
<div style="float:right;width:28%">
<h1 style="font-size:1.3em;">South Africa</h1>
<p style="font-size:.8em;">Click on the map to get feature info.</p>
<div id="nodeList">
</div>
</div>
<div id="map" class="smallmap"></div>
<script defer="defer" type="text/javascript">
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";
var map = new OpenLayers.Map('map', {
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
var map, infocontrols, vegetation, highlightlayer;
function load() {
map = new OpenLayers.Map('map', {
maxExtent: new OpenLayers.Bounds(16.154,-34.953,33.327,-22.193)
});
@@ -51,13 +35,13 @@
{isBaseLayer: false}
);
var vegetation = new OpenLayers.Layer.WMS("Vegetation",
vegetation = new OpenLayers.Layer.WMS("Vegetation",
"http://geo.openplans.org/geoserver/wms",
{'layers': 'za:za_vegetation', transparent: true, format: 'image/png'},
{isBaseLayer: false}
);
var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {
highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {
displayInLayerSwitcher: false,
isBaseLayer: false,
styleMap: new OpenLayers.StyleMap({
@@ -69,7 +53,7 @@
}
);
var infoControls = {
infoControls = {
click: new OpenLayers.Control.WMSGetFeatureInfo('http://geo.openplans.org/geoserver/wms', {
title: 'Identify features by clicking',
layers: [vegetation],
@@ -98,6 +82,7 @@
infoControls.click.activate();
map.zoomToMaxExtent();
}
function showInfo(evt) {
if (evt.features && evt.features.length) {
@@ -140,6 +125,26 @@
// function toggle(key
</script>
</head>
<body onload="load()">
<h1 id="title">Feature Info Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates the WMSGetFeatureInfo control for fetching information about a position from WMS.
</p>
<a id="permalink" href="">Permalink</a><br />
<div style="float:right;width:28%">
<h1 style="font-size:1.3em;">South Africa</h1>
<p style="font-size:.8em;">Click on the map to get feature info.</p>
<div id="nodeList">
</div>
</div>
<div id="map" class="smallmap"></div>
<div id="docs">
</div>
<ul id="control">