项目需求:显示所有的点,每个点可以拖动,拖动到相应的位置保存。
import Translate from "ol/interaction/Translate"; // Translate 不要加{}
import Collection from "ol/Collection"; // Collection 不要加{}
var translate = new Translate({
features: new Collection([feature]); // feature是new的ol/Feature存储的数据
});
this.map.addInteraction(translate);