<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV>Hi Adorian</DIV>
<DIV>&nbsp;</DIV>
<DIV>Do you remember Eric Lemoine saying that the selectFeature and modifyFeature controls don't behave well together - there is a patch for that:</DIV>
<DIV>&nbsp;</DIV>
<DIV>See #1741. That would be good to know if the patch makes your problem<BR>go away. Eric</DIV>
<DIV>&nbsp;</DIV>
<DIV>2008/10/16, Eric Lemoine &lt;<A href="mailto:eric.c2c@gmail.com">eric.c2c@gmail.com</A>&gt;:<BR>&gt; Hi. Do you also have a modify feature control? The select feature and<BR>&gt; modify feature controls are known not to play well together. There<BR>&gt; already is a ticket about that, and patch attached to it. Eric<BR>&gt;<BR>&nbsp;Maybe you are experiencing something similar?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert S<BR><BR>&gt;&gt;&gt; "Adorian Ardelean" &lt;mynature@gmail.com&gt; 4/11/2008 7:43 p.m. &gt;&gt;&gt;<BR>Hi Robert,<BR><BR>Thank you for your reply! I have a very similar way to load the geoJSON file and handle the controls outside map div. Except that I put part of code for loading geoJSON in a function: I want only one GeoJSON layer in which I load/switch an indeterminate number of GeoJSON files. This part is working well.<BR><BR>In this project I have actually two vector layers: One which is used just for drawing things on map (temporarily) and the other one which is the GeoJSON layer. For both vector layers I've declared distinct SelectFeature controls with intention of calling a "featureinfo" function. Beside this I include a draw polygon and delete feature control (the last one is again a SelectFeature control actually). It seems that functionality was affected by the way I have declared the controls, and one of the controls "did not like" going with the others.<BR><BR>In the end I found a "solution" and the thing is working now. I currently have no idea why it did not work and why is now working. But I am happy with the result.<BR>See below two code versions of how I declare controls:<BR><BR>example 1 :<BR>controls = {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polygon: new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polygoninfo: new OpenLayers.Control.SelectFeature(vectors, {hover: true, onSelect: serialize}),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">deletepolygon: new OpenLayers.Control.SelectFeature(vectors, {callbacks: {'click': deleteFeature}}),</DEFANGHTML_SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; regioninfo: new OpenLayers.Control.SelectFeature(regions, {callbacks: {'click': serialize}})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR><BR>example 1 is not working: delete and select functions do not work for both vector layers (vectors and regions). only draw polygon works corectly.<BR><BR>example 2:<BR>controls = {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polygon: new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR><BR>var polygoninfo = new OpenLayers.Control.SelectFeature(vectors, {hover: true, onSelect: serialize});<BR><DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">var deletepolygon = new OpenLayers.Control.SelectFeature(vectors, {callbacks: {'click': deleteFeature}});</DEFANGHTML_SPAN><BR>var regioninfo = new OpenLayers.Control.SelectFeature(regions, {callbacks: {'click': serialize}});<BR><BR>map.addControl(polygoninfo);<BR>polygoninfo.activate();<BR><DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">map.addControl(deletepolygon);</DEFANGHTML_SPAN><BR defanghtml_style="color: rgb(0, 102, 0);"><DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">deletepolygon.activate();</DEFANGHTML_SPAN><BR>map.addControl(regioninfo);<BR>regioninfo.activate();<BR><BR>example 2 is working only partially. All controls work except regioninfo.<BR><BR>example 3:<BR>controls = {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polygon: new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; polygoninfo: new OpenLayers.Control.SelectFeature(vectors, {hover: true, onSelect: serialize}),<DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)"></DEFANGHTML_SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; regioninfo: new OpenLayers.Control.SelectFeature(regions, {callbacks: {'click': serialize}})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR><BR><DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">var deletepolygon = new OpenLayers.Control.SelectFeature(vectors, {callbacks: {'click': deleteFeature}});</DEFANGHTML_SPAN><BR><DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">map.addControl(deletepolygon);</DEFANGHTML_SPAN><BR defanghtml_style="color: rgb(0, 102, 0);"><DEFANGHTML_SPAN style="COLOR: rgb(0,102,0)">deletepolygon.activate();<BR><BR><DEFANGHTML_SPAN style="COLOR: rgb(0,0,0)">example 3 is working well. all functions are doing what they are supposed to do. Personally I would prefer version 1 of code. However, since version 3 does the job I am glad that I could pass this point. It must be something I do wrong when I declare callbacks or...I don't know....<BR><BR>Thank you again for your input,<BR>Adorian<BR></DEFANGHTML_SPAN></DEFANGHTML_SPAN><BR>-- <BR>Dr. Adorian Ardelean<BR>coordinator of myNature Project<BR><BR><A href="http://mybiosis.info/nature/portal.php?pagename=firstpage">http://mybiosis.info/nature/portal.php?pagename=firstpage</A> [a Romanian biodiversity-database]<BR><A href="http://mybiosis.info/nature/portal.php?pagename=adorian">http://mybiosis.info/nature/portal.php?pagename=adorian</A> [CV]<BR><BR><BR></DIV><FONT style="BACKGROUND-COLOR: #ffffff">
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">Click <A href="https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==">here</A> to report this email as spam.</FONT></P></FONT><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The&nbsp;contents&nbsp;of&nbsp;this&nbsp;email&nbsp;are&nbsp;confidential&nbsp;to&nbsp;AsureQuality.&nbsp;If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&nbsp;error&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;immediately&nbsp;and&nbsp;delete&nbsp;the&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments.&nbsp;The&nbsp;opinions&nbsp;expressed&nbsp;in&nbsp;this&nbsp;email&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;those&nbsp;of&nbsp;AsureQuality.&nbsp;This&nbsp;message&nbsp;has&nbsp;been&nbsp;scanned&nbsp;for&nbsp;known&nbsp;viruses&nbsp;before&nbsp;delivery.&nbsp;AsureQuality&nbsp;supports&nbsp;the&nbsp;Unsolicited&nbsp;Electronic&nbsp;Messages&nbsp;Act&nbsp;2007.&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;wish&nbsp;to&nbsp;receive&nbsp;similar&nbsp;communications&nbsp;in&nbsp;future,&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;of&nbsp;this&nbsp;message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>