<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns1="" xmlns:ns0="urn:schemas-microsoft-com:office:smarttags">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoSignature, li.MsoSignature, div.MsoSignature
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:3.0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
p.StyleArial10ptBefore5ptAfter5pt, li.StyleArial10ptBefore5ptAfter5pt, div.StyleArial10ptBefore5ptAfter5pt
        {margin-top:5.0pt;
        margin-right:0in;
        margin-bottom:5.0pt;
        margin-left:0in;
        font-size:10.0pt;
        font-family:Arial;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 77.95pt 1.0in 77.95pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Good Day Everyone<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>I want to make use of the GetFeatureInfo functionality, but I want to
do so by clicking a button on the map panel. Below is the coding that I am
using. I click on the button and when I click on a feature point I get the
following error displayed below in firebug. FYI, I am using OpenLayers 2.7. Can
someone please help me with this?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><b><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-weight:bold'>ERROR:<o:p></o:p></span></font></b></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>this.callbacks is undefined<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>OpenLayers.js (line 662)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><b><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-weight:bold'>SOURCE CODE:<o:p></o:p></span></font></b></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> var featureInfo;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> // build the featureInfo (aka query tool/button)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> featureInfo = new OpenLayers.Control(<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
{title: "Query map features", <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
displayClass: "olControlFeatureInfo"});<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> // register events to the featureInfo tool<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> featureInfo.events.register("activate", featureInfo,
function() { toggleQueryMode();
});
<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> featureInfo.events.register("deactivate", featureInfo,
function() { toggleQueryMode(); });<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>panel.addControls([featureInfo]);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> // support GetFeatureInfo<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> queryEventHandler = new OpenLayers.Handler.Click({'map': map,
'click': function(e) { doGetFeatureInfo(e); } });<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> function toggleQueryMode()
{ <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> if(featureInfo.active) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> queryEventHandler.activate();<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> } else {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
queryEventHandler.deactivate();<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> function doGetFeatureInfo(e) {<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> document.getElementById('nodelist').innerHTML =
"Loading... please wait...";<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> var url = map.layers[0].getFullRequestString(<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
{REQUEST: "GetFeatureInfo",<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
EXCEPTIONS: "application/vnd.ogc.se_xml",<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
BBOX: map.getExtent().toBBOX(),<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
X: e.xy.x,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
Y: e.xy.y,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
INFO_FORMAT: 'text/html',<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
QUERY_LAYERS: map.layers[0].params.LAYERS,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
FEATURE_COUNT: 50,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
WIDTH: map.size.w,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
HEIGHT: map.size.h},<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>
"http://10.128.78.27:8080/geoserver/gwc/service/wms");<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> OpenLayers.loadURL(url, '', this, setHTML, setHTML);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> OpenLayers.Event.stop(e);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'> }<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Thanks<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Raj.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
</div>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>State Information Technology Age</title>
<style>
<!--
p
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman"}
div.Section1
        {page:Section1;}
p.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
-->
</style>
</head>
<body>
<div class="Section1">
        <table class="MsoNormalTable" cellSpacing="0" cellPadding="0" border="0" id="table1">
                <tr>
                        <td style="padding: 0cm; background: white" bgColor="white">
                        <p><font face="Arial" color="#2265a8" size="1"> </font><font face="Arial" color="#2265a8" size="1">
<span style="font-size: 7.5pt; color: #2265a8; font-family: Arial">
</span></font></p>
<font face="Arial" color="#2265a8" size="1"><span style="font-size: 7.5pt; color: #2265a8; font-family: Arial"><hr
color="#cccccc" SIZE="0"><font size="2">
                        <span lang="EN-US" style="font-size: 8.5pt; font-weight: 700">State
                        Information Technology Agency (Proprietary) Limited</span></font><font face="Arial" color="#2265a8"
style="font-size: 8.5pt"><span style="color: #2265a8; font-family: Arial">
                        ? </span></font><font size="2">
                        <span lang="EN-US" style="font-size: 8.5pt">Reg No<font color="blue"><span style="color: blue">
                        </span></font></span></font></span></font>
                        <font face="Arial" color="#2265a8" style="font-size: 8.5pt">
                        <span style="color: #2265a8; font-family: Arial"><span lang="EN-ZA">
                        1999/001899/07,<br>
                        </span>459 Tsitsa Street, Erasmuskloof, Pretoria, South Africa ? PO
                        Box 26100, Monument Park, 0105, South Africa<br>
                        Tel: +27 12 482 3000 ? Fax +27 12 482 2100 ?
                        <a style="color: blue; text-decoration: underline" href="http://www.sita.co.za/">
                        <font color="#0082d6"><span style="color:
#0082d6">www.sita.co.za</span></font></a></span></font><font face="Arial" color="#797171" size="1"><span style="font-size:
7.5pt; color: #797171; font-family: Arial"><hr color="#cccccc" SIZE="0">
</span></font><span style="color: #797171; font-family: Arial"> <font face="Arial" color="#797171" style="font-size:
8.5pt"><b>Directors</b>
: Ms Z P Manase (Chairperson), Ms M O Williams (Deputy Chairperson), Ms
C B Clark, Mr C C W Kruger, Mr M A Luthuli, Ms M Makhekhe-Mokhuane,
Ms R Sekese Company
Secretary: Ms E Strydom </font></span><b> <span style="font-size: 7.5pt; color: #797171; font-family: Arial"><font
face="Arial" color="#797171" size="1">
<hr color="#cccccc" SIZE="0">
                        </b>
                        <font face="Arial" color="#797171" style="font-size: 8.5pt">
                        <span style="color: #797171; font-family: Arial"><b>E-mail
                        Disclaimer:</b> This email and any attachments thereto may contain
                        confidential and proprietary information and is intended for the
                        recipient only. If you are not the intended recipient, kindly delete
                        the entire communication and notify the sender thereof immediately
                        as the information contained in this communication is protected by
                        law and may be privileged. You are further reminded that copying,
                        distribution or disclosure of the contents of this email may be
                        unlawful and result in legal action against you, in the case of you
                        not being the intended recipient. As information sent by email is
                        corruptible, SITA does not accept responsibility for such
                        corruption, destruction, loss or interference of whatsoever kind and
                        howsoever caused.<b><p></span></font></font></span><b>
                        </p>
                        <p> </td>
                </tr>
        </table>
        <p class="MsoNormal"><font face="Arial" size="3">
        <span style="font-size: 8.5pt"> </span></font></div>
</body>
</html>
</body>
</html>