Only start dragging when we are over a feature. r=tschaub (closes #3252)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11888 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-04-09 12:22:52 +00:00
parent 32f70d06c2
commit a3655cd66f
2 changed files with 23 additions and 3 deletions

View File

@@ -357,6 +357,24 @@
"onLeave called with expected feature");
}
function test_Control_DragFeature_click(t) {
t.plan(1);
var map = new OpenLayers.Map("map");
var layer = new OpenLayers.Layer.Vector();
map.addLayer(layer);
var feature = new OpenLayers.Feature.Vector();
feature.layer = layer;
var control = new OpenLayers.Control.DragFeature(layer);
map.addControl(control);
control.activate();
control.overFeature(feature);
control.handlers.feature.evt = {which: 1};
control.clickFeature(feature);
t.eq(control.handlers.drag.started, false, "click after over does not start drag handler");
}
</script>
</head>
<body>