<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">thanks Arnd<font style="font-size: 10pt;" size="2">,<font style="font-size: 10pt;" size="2"> I added your suggestion and it still comp<font style="font-size: 10pt;" size="2">lains about <font style="font-size: 10pt;" size="2">the same <font style="font-size: 10pt;" size="2">but after some a couple of clicks <font style="font-size: 10pt;" size="2">or bo<font style="font-size: 10pt;" size="2">xes</font></font><font style="font-size: 10pt;" size="2"> it sends the request</font></font></font></font></font>, however the <font style="font-size: 10pt;" size="2">sent bbox </font>is still in UTM<font style="font-size: 10pt;" size="2">, where could the problem be? here you can take a look at the code:</font><br id="FontBreak"></font></font><br><font style="font-size: 10pt;" size="2">var <font style="font-size: 10pt;" size="2">my<font style="font-size: 10pt;" size="2">c</font></font>ontrol = function(){</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> var protocol = new OpenLayers.Protocol.HTTP({</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> url: 'http://www.<font style="font-size: 10pt;" size="2">r2d2</font><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">.starwars<font style="font-size: 10pt;" size="2">/</font></font></font></font><font style="font-size: 10pt;" size="2"></font>',</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> format: new OpenLayers.Format.GeoJSON({</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> ignoreExtraDims: true,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> 'internalProjection': new OpenLayers.Projection('EPSG:900913'),</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> 'externalProjection': new OpenLayers.Projection('EPSG:4326')</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> })</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> });</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> OpenLayers.Control.myGetFeature = OpenLayers.Class(OpenLayers.Control.GetFeature,{</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> selectBox: function(position){</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> var opts = OpenLayers.Control.GetFeature(position);</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> var baseSRSutm = this.map.getprojectionObject();</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> console.log('this is the baseSRSutm' + baseSRSutm);</font><font style="font-size: 10pt;" size="2"> <b><--- <font style="font-size: 10pt;" size="2">this <font style="font-size: 10pt;" size="2">console.log d<font style="font-size: 10pt;" size="2">oesnt appear in fi<font style="font-size: 10pt;" size="2">rebug</font></font></font></font></b><br></font><font style="font-size: 10pt;" size="2"> var layerSRSdd = new OpenLayers.Projection('EPSG:4326');</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> opts.params.bbox = this.map.getExtent().transform(baseSRSutm,layerSRSdd).toBBOX(null,firstLayer.reverseAxisOrder());</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> console.log('this is the opts.params.bbox' + opts.params.bbox); </font><font style="font-size: 10pt;" size="2"> <b><--- <font style="font-size: 10pt;" size="2">this console.log <font style="font-size: 10pt;" size="2">d<font style="font-size: 10pt;" size="2">oesnt appear in firebug</font></font></font></b></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> return opts;</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> },</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> CLASS_NAME: "OpenLayers.Control.myGetFeature"</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> });</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> return new OpenLayers.Control.myGetFeature({</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> protocol: protocol,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> box: true,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> click: true,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> single: false,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> clickTolerance: 10,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> eventListeners:{</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> // </font><font style="font-size: 10pt;" size="2">Ma<font style="font-size: 10pt;" size="2">y the Force b<font style="font-size: 10pt;" size="2">e with you</font></font><br></font><font style="font-size: 10pt;" size="2"> }</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> });</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> };</font><br><br><font style="font-size: 10pt;" size="2">because the console.log doesnt appear in firebug, I think the problem is in the OpenLayers.Control.myGetFeature and OpenLayers.Class. It seems to me that the "selectBox" function is the one I need, but the subclass itself is not read by the return.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Gery</font><font style="font-size: 10pt;" size="2"> </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">__________________________________________________________________________________________</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Piensa en el medio ambie</font><font style="font-size: 10pt;" face="Arial" size="2">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size: 10pt;" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><div><hr id="stopSpelling"><font style="font-size: 10pt;" size="2">From: arnd.wippermann@web.de</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">To: gamejihou@hotmail.com</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">CC: openlayers-users@lists.osgeo.org</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Subject: AW: [OpenLayers-Users] OpenLayers.Class withOpenLayers.Control.GetFeature</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Date: Wed, 30 Jan 2013 23:34:13 +0100</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
</font><style><!--
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Calibri;font-size:12pt;}
--></style><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"><font style="" color="#0000ff" face="Arial"><span class="ecx921433022-30012013">try
this:</span></font></span></font></div><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" color="#0000ff" size="2"><font face="Arial"><span class="ecx203531117-30012013"><font style="" color="#0000ff">...</font></span><br><span class="ecx203531117-30012013"></span></font><font face="Arial"><font style="" color="#000000">opts.params.bbox =<span class="ecx203531117-30012013">
...</span><br>return opts;<br>}<span class="ecx921433022-30012013">,</span></font><br><span class="ecx921433022-30012013"><font style="" color="#000000">C</font></span>LASS_NAME:
"OpenLayers.<font color="#366092">myGetFeature</font>"</font></font></div><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" size="2"><span class="ecx921433022-30012013"></span></font><font style="font-size: 10pt;" color="#0000ff" face="Arial" size="2">}<span class="ecx921433022-30012013">);</span></font></div><font style="font-size: 10pt;" size="2"><span class="ecx921433022-30012013"></span></font><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span class="ecx921433022-30012013"><font style="" color="#0000ff" face="Arial">It seems, that a class needs a CLASS_NAME.</font></span></font></div><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" size="2"><span class="ecx921433022-30012013"></span></font><font style="font-size: 10pt;" size="2"> </font></div><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" size="2"><span class="ecx921433022-30012013"><font style="" color="#0000ff" face="Arial">Arnd</font></span></font></div><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" class="ecxOutlookMessageHeader" align="left" lang="de">
<hr tabindex="-1">
<font style="font-size: 10pt;" face="Tahoma" size="2"><b>Von:</b> Gery . [mailto:gamejihou@hotmail.com]
<br><b>Gesendet:</b> Mittwoch, 30. Januar 2013 18:53<br><b>An:</b>
arnd.wippermann@web.de<br><b>Cc:</b>
openlayers-users@lists.osgeo.org<br><b>Betreff:</b> RE: AW: [OpenLayers-Users]
OpenLayers.Class withOpenLayers.Control.GetFeature<br></font><font style="font-size: 10pt;" size="2"><br></font></div><font style="font-size: 10pt;" size="2">
</font><font style="font-size: 10pt;" size="2">
</font><div dir="ltr"><font style="font-size: 10pt;" size="2">Thanks for th</font><font style="font-size: 10pt;" size="2">at Arnd, now it
stops complaining about</font><font style="font-size: 10pt;" size="2"> the </font><font style="font-size: 10pt;" size="2">missing "}", but now it appears
"</font><font style="font-size: 10pt;" size="2"><span class="ecxerrorMessage">TypeError:
this.CLASS_NAME is undefined", what and where should I put
there?</span></font><font style="font-size: 10pt;" size="2"><br id="ecxFontBreak"></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">__________________________________________________________________________________________</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Piensa
en el medio ambie</font><font style="font-size: 10pt;" face="Arial" size="2">nte - mantenlo en la pantalla. NO lo imprimas
si NO es necesario.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Think green - keep it on the screen. Do NOT print if it is NOT
necessary.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die
Umwelt</span></span></font><font style="font-size: 10pt;" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es
NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig
ist</span><span>.</span></span></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
</font><div><font style="font-size: 10pt;" size="2">
</font><font style="font-size: 10pt;" size="2">
</font><hr id="ecxstopSpelling"><font style="font-size: 10pt;" size="2">
From: arnd.wippermann@web.de</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">To: gamejihou@hotmail.com</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">CC:
openlayers-users@lists.osgeo.org</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Subject: AW: [OpenLayers-Users]
OpenLayers.Class withOpenLayers.Control.GetFeature</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Date: Wed, 30 Jan 2013
18:13:50 +0100</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
</font><style><!--
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Calibri;font-size:12pt;}
--></style><font style="font-size: 10pt;" size="2">
</font><div dir="ltr" align="left"><font style="font-size: 10pt;" size="2"><span lang="DE"><span class="ecx203531117-30012013"><font style="" color="#0000ff" face="Arial">Hi,</font></span><br><span class="ecx203531117-30012013"></span> <br><span class="ecx203531117-30012013">move 'return opts;' into the function
body:</span><br></span></font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"><font style="" color="#0000ff" face="Arial">...</font></span></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"></span></font><font style="font-size: 10pt;" size="2">opts.params.bbox =</font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"> ...</span></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">return opts;</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">}</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"><font style="" color="#0000ff" face="Arial">to get rid of
the error.</font></span></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"></span></font><font style="font-size: 10pt;" size="2"> </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"><font style="" color="#0000ff" face="Arial">Arnd</font></span></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span class="ecx203531117-30012013"></span></font><font style="font-size: 10pt;" size="2"> </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font>
<hr tabindex="-1">
<font style="font-size: 10pt;" face="Tahoma" size="2"><b>Von:</b> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <b>Im Auftrag von </b>Gery
.<br><b>Gesendet:</b> Mittwoch, 30. Januar 2013 16:52<br><b>An:</b>
openlayers-users@lists.osgeo.org<br><b>Betreff:</b> [OpenLayers-Users]
OpenLayers.Class withOpenLayers.Control.GetFeature<br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font></div><font style="font-size: 10pt;" size="2">
</font><font style="font-size: 10pt;" size="2">
</font><div dir="ltr"><font style="font-size: 10pt;" size="2">Hi
all,</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">I'm wondering i</font><font style="font-size: 10pt;" size="2">f someone could point me in the right
direction</font><font style="font-size: 10pt;" size="2"> to force the BBO</font><font style="font-size: 10pt;" size="2">X
of OpenLayers.C</font><font style="font-size: 10pt;" size="2">ontrol</font><font style="font-size: 10pt;" size="2">.GetFeature to be alwa</font><font style="font-size: 10pt;" size="2">ys in long/lat</font><font style="font-size: 10pt;" size="2"> coordinates</font><font style="font-size: 10pt;" size="2">. </font><font style="font-size: 10pt;" size="2">I'm tryin</font><font style="font-size: 10pt;" size="2">g
to get this with </font><font style="font-size: 10pt;" size="2">OpenLayers.</font><font style="font-size: 10pt;" size="2">Class</font><font style="font-size: 10pt;" size="2">, so
the new control will </font><font style="font-size: 10pt;" size="2">inherit
OpenLayers.Control.GetFeature </font><font style="font-size: 10pt;" size="2">with </font><font style="font-size: 10pt;" size="2">just the smal</font><font style="font-size: 10pt;" size="2">l modification in BBOX. This</font><font style="font-size: 10pt;" size="2"> is</font><font style="font-size: 10pt;" size="2"> what I</font><font style="font-size: 10pt;" size="2">'ve
done:</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">OpenLayers.Control.myGetFeature =
OpenLayers.Class(OpenLayers.Control.GetFeature,{ </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
selectBox: function(position){ </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
var opts = OpenLayers.Control.GetFeature(position);
</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> var baseSRSutm =
this.map.getprojectionObject(); </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
var layerSRSdd = new OpenLayers.Projection('EPSG:4326');
</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> opts.params.bbox =
this.map.getExtent().transform(baseSRSutm,layerSRSdd).toBBOX(null,firstLayer.reverseAxisOrder());
</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> }</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">
return opts; </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> });
</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"> </font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">but </font><font style="font-size: 10pt;" size="2">I'</font><font style="font-size: 10pt;" size="2">m getting that s</font><font style="font-size: 10pt;" size="2">ome "}" are </font><font style="font-size: 10pt;" size="2">missing</font><font style="font-size: 10pt;" size="2">. Is this the right wa</font><font style="font-size: 10pt;" size="2">y to use OpenLa</font><font style="font-size: 10pt;" size="2">yers.Class to do what I want?</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Any hel</font><font style="font-size: 10pt;" size="2">p is much appreciated</font><font style="font-size: 10pt;" size="2">.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Gery</font><font style="font-size: 10pt;" size="2"><br id="ecxFontBreak"></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">__________________________________________________________________________________________</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Piensa
en el medio ambie</font><font style="font-size: 10pt;" face="Arial" size="2">nte - mantenlo en la pantalla. NO lo imprimas
si NO es necesario.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2">Think green - keep it on the screen. Do NOT print if it is NOT
necessary.</font><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die
Umwelt</span></span></font><font style="font-size: 10pt;" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es
NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig
ist</span><span>.</span></span></font><br></div></div></div></div> </div></body>
</html>