作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我设法设置了一个修改交互。
ol.interaction.Modify ( http://ol3js.org/en/master/apidoc/ol.interaction.Modify.html ) 的文档没有提到修改功能时触发的单个事件。
与 ol.interaction.Draw ( http://ol3js.org/en/master/apidoc/ol.interaction.Draw.html ) 不同,它运行良好。
修改要素后,我需要更新数据库中的坐标。
如何设置监听器?
最佳答案
我找到了解决方案。
高级解释在这里:http://boundlessgeo.com/2014/06/openlayers-editing-wfs-t/
基本上你不会听到修改交互中的变化(就像你在绘制交互中所做的那样)。相反,您可以聆听所选功能本身的变化。
这是一个简短的摘录:
// get the features from the select interaction
var selected_features = select_interaction.getFeatures();
// when a feature is selected...
selected_features.on('add', function(event) {
// get the feature
var feature = event.element;
// ...listen for changes on it
feature.on('change', function(event) {
// got it!
});
});
关于openlayers-3 - 打开第 3 层 : How to create listener for a modify interaction,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24726734/
我是一名优秀的程序员,十分优秀!