修改交互不起作用

时间:2015-06-17 10:36:52

标签: javascript openlayers-3

在Select交互中修改与pointerMove条件的互动会产生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 个答案:

答案 0 :(得分:0)

因此,基于评论和修改,“如何抓住拖动完成时刻”的答案是:您可以对此事件采取一些措施:

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

    console.info(evt);
    //some action

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