<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"><LINK rel=stylesheet
href="BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}"></HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>
<DIV><FONT color=#000080 size=2>Hi:</FONT></DIV>
<DIV><FONT color=#000080> <FONT size=3> I am following the example of
getfeatureinfo-popup to write down the code. And I want to use geoservers
example to get the feature in my local computer like the example when click
the object I can see its feature in a popup window. However, I can't. I don't
know why. Please help me . Thanks a lot.</FONT></FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV>
<DIV><html></DIV>
<DIV> <head></DIV>
<DIV> <title>GetFeatureInfo Popup</title></DIV>
<DIV> <script src="openlayers/OpenLayers.js"></script></DIV>
<DIV> <link rel="stylesheet" href="source/style1.css" type="text/css" /></DIV>
<DIV> <link rel="stylesheet" href="source/style.css" type="text/css" /></DIV>
<DIV> <script></DIV>
<DIV> OpenLayers.ProxyHost = "proxy.cgi?url=";</DIV>
<DIV> </DIV>
<DIV> var map, info;</DIV>
<DIV> </DIV>
<DIV> function load() {</DIV>
<DIV> map = new OpenLayers.Map({</DIV>
<DIV> div: "map",</DIV>
<DIV> maxExtent: new OpenLayers.Bounds(143.834,-43.648,148.479,-39.573)</DIV>
<DIV> });</DIV>
<DIV></DIV>
<DIV> var political = new OpenLayers.Layer.WMS("State Boundaries",</DIV>
<DIV> "http://localhost:8081/geoserver/wms", </DIV>
<DIV> {'layers': 'topp:tasmania_state_boundaries', transparent: true, format: 'image/gif'},</DIV>
<DIV> {isBaseLayer: true}</DIV>
<DIV> );</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV> var water = new OpenLayers.Layer.WMS("Bodies of Water",</DIV>
<DIV> "http://localhost:8081/geoserver/wms", </DIV>
<DIV> {'layers': 'topp:tasmania_water_bodies', transparent: true, format: 'image/gif'},</DIV>
<DIV> {isBaseLayer: false}</DIV>
<DIV> );</DIV>
<DIV> //<FONT color=#ff0000>what's mean of
the red code?(I capy form the example)</FONT></DIV>
<DIV></DIV>
<DIV> <FONT
color=#ff0000>var highlight = new OpenLayers.Layer.Vector("Highlighted Features", {</FONT></DIV>
<DIV><FONT
color=#ff0000> displayInLayerSwitcher: false, </FONT></DIV>
<DIV><FONT
color=#ff0000> isBaseLayer: false </FONT></DIV>
<DIV> <FONT
color=#ff0000> });</FONT></DIV>
<DIV> </DIV>
<DIV> map.addLayers([political,water, highlight]); </DIV>
<DIV></DIV>
<DIV> info = new OpenLayers.Control.WMSGetFeatureInfo({</DIV>
<DIV> url: 'http://localhost:8081/geoserver/wms', </DIV>
<DIV> 'layers': 'topp:tasmania_water_bodies',</DIV>
<DIV> queryVisible: true,</DIV>
<DIV> eventListeners: {</DIV>
<DIV> getfeatureinfo: function(event) {</DIV>
<DIV> map.addPopup(new OpenLayers.Popup.FramedCloud(</DIV>
<DIV> "chicken", </DIV>
<DIV> map.getLonLatFromPixel(event.xy),</DIV>
<DIV> null,</DIV>
<DIV> event.text,</DIV>
<DIV> null,</DIV>
<DIV> true</DIV>
<DIV> ));</DIV>
<DIV> }</DIV>
<DIV> }</DIV>
<DIV> });</DIV>
<DIV> map.addControl(info);</DIV>
<DIV> info.activate();</DIV>
<DIV></DIV>
<DIV> map.addControl(new OpenLayers.Control.LayerSwitcher());</DIV>
<DIV> map.zoomToMaxExtent();</DIV>
<DIV> }</DIV>
<DIV></DIV>
<DIV> </script></DIV>
<DIV> </head></DIV>
<DIV> <body onload="load()"></DIV>
<DIV> <h1 id="title">Feature Info in Popup</h1></DIV>
<DIV></DIV>
<DIV> <div id="tags"></div></DIV>
<DIV></DIV>
<DIV> <p id="shortdesc"></DIV>
<DIV> Demonstrates the WMSGetFeatureInfo control for fetching information</DIV>
<DIV> about a position from WMS (via GetFeatureInfo request). Results</DIV>
<DIV> are displayed in a popup.</DIV>
<DIV> </p></DIV>
<DIV></DIV>
<DIV> <div id="map" class="smallmap"></div></DIV>
<DIV></DIV>
<DIV> <div id="docs"></div></DIV>
<DIV> </body></DIV>
<DIV></html></DIV></DIV>
<DIV><FONT color=#000080 size=2> <FONT
size=3> </FONT></FONT><FONT color=#000080></FONT></DIV>
<DIV><FONT color=#c0c0c0 size=2>2009-10-09 </FONT></DIV><FONT color=#000080
size=2>
<HR style="WIDTH: 100px" align=left color=#b5c4df SIZE=1>
</FONT>
<DIV><FONT color=#c0c0c0 size=2><SPAN>zhoujian_ab</SPAN>
</FONT></DIV></FONT></DIV></BODY></HTML>