1
votes

The Modify interaction with pointerMove condition in the Select interaction gives TypeError: this.a[d] is undefined (c)};l.update=function(b,c){var d=ma(c);Wd(this.a[d].slice(0,4),b)||(this.remove...

ol.js str 342, col 728)

var point_source=new ol.source.Vector();
var PointVectorLayer = new ol.layer.Vector({
    source: point_source
});
var layers = [PointVectorLayer];      

select_interaction = new ol.interaction.Select({
    condition: ol.events.condition.pointerMove    
});
selected_points=select_interaction.getFeatures();   
    var modify_interaction = new ol.interaction.Modify({
    features: selected_points
});

var view = new ol.View({
    zoom: 10,       
    center: [8530308.307502387,5342345.99739733]//Каскелен          
});
var map = new ol.Map({
   interactions: ol.interaction.defaults().extend([
   select_interaction,   
   modify_interaction
]),
   controls: [new ol.control.Zoom()],
   layers: layers,
   target: 'map',
   view: view            
});

map.on('click', function(evt){    
   var click_point = new ol.Feature({
   geometry:  new ol.geom.Point(evt.coordinate)});
   point_source.addFeature(click_point);        
});
1
Run your script with ol-debug.js to get a more verbose msg. - Jonatas Walker
With ol-debug.js : "AssertionError: Assertion failed: uid (59) of value ([object Object]) does not exist" Any ideas? - MapUser
No error here with your script, perhaps you create a jsfiddle. - Jonatas Walker
The error occurs when drag a point selected by hover - jsfiddle.net/qpkgvq3u/5 - MapUser
But is this what you want? Drag a point? - Jonatas Walker

1 Answers

0
votes

So based on comments and modifications the answer to "How to catch the moment when drag is finished" is: you can do some action into this event:

app.Drag.prototype.handleUpEvent = function(evt) {

    console.info(evt);
    //some action

    this.coordinate_ = null;
    this.feature_ = null;
    return false;
};