Hi Robert,<br><br>For this specific application I have not included the modifyFeature control, but information on patch is helpful because I have another application that involves both controls. Unfortunatelly, this second application is too embedded in a CMS-like environment and it will require me some time to extract code and test it separately. But I am looking forward to do it.<br>
<br>Thank you for your involvement,<br>Adorian <br><br><br><br><br><div class="gmail_quote">On Tue, Nov 4, 2008 at 8:40 PM, Robert Sanson <span dir="ltr"><<a href="mailto:SansonR@asurequality.com">SansonR@asurequality.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div>Hi Adorian</div>
<div> </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> </div>
<div>See #1741. That would be good to know if the patch makes your problem<br>go away. Eric</div>
<div> </div>
<div>2008/10/16, Eric Lemoine <<a href="mailto:eric.c2c@gmail.com" target="_blank">eric.c2c@gmail.com</a>>:<br>> Hi. Do you also have a modify feature control? The select feature and<br>> modify feature controls are known not to play well together. There<br>
> already is a ticket about that, and patch attached to it. Eric<br>><br> Maybe you are experiencing something similar?</div>
<div> </div>
<div>Robert S<br><br>>>> "Adorian Ardelean" <<a href="mailto:mynature@gmail.com" target="_blank">mynature@gmail.com</a>> 4/11/2008 7:43 p.m. >>><div><div></div><div class="Wj3C7c"><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> polygon: new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),<br> polygoninfo: new OpenLayers.Control.SelectFeature(vectors, {hover: true, onSelect: serialize}),<br>
deletepolygon: new OpenLayers.Control.SelectFeature(vectors, {callbacks: {'click': deleteFeature}}),<br> regioninfo: new OpenLayers.Control.SelectFeature(regions, {callbacks: {'click': serialize}})<br>
};<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> polygon: new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),<br>
};<br><br>var polygoninfo = new OpenLayers.Control.SelectFeature(vectors, {hover: true, onSelect: serialize});<br>var deletepolygon = new OpenLayers.Control.SelectFeature(vectors, {callbacks: {'click': deleteFeature}});<br>
var regioninfo = new OpenLayers.Control.SelectFeature(regions, {callbacks: {'click': serialize}});<br><br>map.addControl(polygoninfo);<br>polygoninfo.activate();<br>map.addControl(deletepolygon);<br>deletepolygon.activate();<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> polygon: new OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),<br>
polygoninfo: new OpenLayers.Control.SelectFeature(vectors, {hover: true, onSelect: serialize}),<br> regioninfo: new OpenLayers.Control.SelectFeature(regions, {callbacks: {'click': serialize}})<br>
};<br><br>var deletepolygon = new OpenLayers.Control.SelectFeature(vectors, {callbacks: {'click': deleteFeature}});<br>map.addControl(deletepolygon);<br>deletepolygon.activate();<br><br>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><br>-- <br>Dr. Adorian Ardelean<br>coordinator of myNature Project<br><br><a href="http://mybiosis.info/nature/portal.php?pagename=firstpage" target="_blank">http://mybiosis.info/nature/portal.php?pagename=firstpage</a> [a Romanian biodiversity-database]<br>
<a href="http://mybiosis.info/nature/portal.php?pagename=adorian" target="_blank">http://mybiosis.info/nature/portal.php?pagename=adorian</a> [CV]<br><br><br></div></div></div><div class="Ih2E3d"><font style="background-color: rgb(255, 255, 255);">
<p align="center"><font style="background-color: rgb(255, 255, 255);">Click <a href="https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==" target="_blank">here</a> to report this email as spam.</font></p></font><br><br>
<table style="color: black;" bgcolor="white"><tbody><tr><td><br>------------------------------------------------------------------<br>
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.<br>
------------------------------------------------------------------</td></tr></tbody></table><br><br>
<p align="center"><font style="background-color: rgb(255, 255, 255);">This message has been scanned for malware by SurfControl plc. </font><a href="http://www.surfcontrol.com/" target="_blank"><font style="background-color: rgb(255, 255, 255);" color="#000000">www.surfcontrol.com</font></a></p>
</div></div>
</blockquote></div><br><br clear="all"><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>