Hi Adorian
Do you remember Eric Lemoine saying that the selectFeature and modifyFeature
controls don't behave well together - there is a patch for that:
See #1741. That would be good to know if the patch makes your problem
go away. Eric
2008/10/16, Eric Lemoine <[EMAIL PROTECTED]>:
> Hi. Do you also have a modify feature control? The select feature and
> modify feature controls are known not to play well together. There
> already is a ticket about that, and patch attached to it. Eric
>
Maybe you are experiencing something similar?
Robert S
>>> "Adorian Ardelean" <[EMAIL PROTECTED]> 4/11/2008 7:43 p.m. >>>
Hi Robert,
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.
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.
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.
See below two code versions of how I declare controls:
example 1 :
controls = {
polygon: new
OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),
polygoninfo: new OpenLayers.Control.SelectFeature(vectors, {hover:
true, onSelect: serialize}),
deletepolygon: new OpenLayers.Control.SelectFeature(vectors,
{callbacks: {'click': deleteFeature}}),
regioninfo: new OpenLayers.Control.SelectFeature(regions,
{callbacks: {'click': serialize}})
};
example 1 is not working: delete and select functions do not work for both
vector layers (vectors and regions). only draw polygon works corectly.
example 2:
controls = {
polygon: new
OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),
};
var polygoninfo = new OpenLayers.Control.SelectFeature(vectors, {hover: true,
onSelect: serialize});
var deletepolygon = new OpenLayers.Control.SelectFeature(vectors, {callbacks:
{'click': deleteFeature}});
var regioninfo = new OpenLayers.Control.SelectFeature(regions, {callbacks:
{'click': serialize}});
map.addControl(polygoninfo);
polygoninfo.activate();
map.addControl(deletepolygon);
deletepolygon.activate();
map.addControl(regioninfo);
regioninfo.activate();
example 2 is working only partially. All controls work except regioninfo.
example 3:
controls = {
polygon: new
OpenLayers.Control.DrawFeature(vectors,OpenLayers.Handler.Polygon),
polygoninfo: new OpenLayers.Control.SelectFeature(vectors, {hover:
true, onSelect: serialize}),
regioninfo: new OpenLayers.Control.SelectFeature(regions,
{callbacks: {'click': serialize}})
};
var deletepolygon = new OpenLayers.Control.SelectFeature(vectors, {callbacks:
{'click': deleteFeature}});
map.addControl(deletepolygon);
deletepolygon.activate();
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....
Thank you again for your input,
Adorian
--
Dr. Adorian Ardelean
coordinator of myNature Project
http://mybiosis.info/nature/portal.php?pagename=firstpage [a Romanian
biodiversity-database]
http://mybiosis.info/nature/portal.php?pagename=adorian [CV]
Click here ( https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== ) to
report this email as spam.
------------------------------------------------------------------
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.
------------------------------------------------------------------
This message has been scanned for malware by SurfControl plc.
www.surfcontrol.com
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users