Reputation: 3809
I'm using Openlayers 2.12 with Firefox 18.0.
I'm just adding an EditingToolbar to this example :
http://openlayers.org/dev/examples/select-feature-multilayer.html
So basically I change this :
map.addLayers([wmsLayer, vectors1, vectors2]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
selectControl = new OpenLayers.Control.SelectFeature
(
[vectors1, vectors2],
{
clickout: true, toggle: false,
multiple: false, hover: false,
}
);
map.addControl(selectControl);
selectControl.activate();
by adding one line :
map.addLayers([wmsLayer, vectors1, vectors2]);
map.addControl(new OpenLayers.Control.EditingToolbar(vectors2));
map.addControl(new OpenLayers.Control.LayerSwitcher());
selectControl = new OpenLayers.Control.SelectFeature
(
[vectors1, vectors2],
{
clickout: true, toggle: false,
multiple: false, hover: false,
}
);
map.addControl(selectControl);
selectControl.activate();
And now I can't select features (that I draw) correctly on any layers, got any leads ?
Upvotes: 1
Views: 942
Reputation: 455
If you have panel area for display controls, you can set 'allowDepress' attribute to deactivate by clicking the icon that represents them.
Upvotes: 0
Reputation: 2284
The problem that you have mentioned is derived from dragging handler activation when you adding Editing Toolbar to map.
map.addControl(new OpenLayers.Control.EditingToolbar(vectors2));
you have two ways to get rid of this problem.
first way:
add a new tool to activating and toggling select control.
second way:
try to set false
to drag prototype.
OpenLayers.Handler.Drag.prototype.stopDown = false;
i hope it helps you...
Upvotes: 1