I am trying to find code for dragging a polygon (don't change) .... OL3
polygon is created by code (bbox for print area).
can someone enter the code?
var format = new ol.format.WKT();
var feature = format.readFeature(wkt2);
selectInteraction = new ol.interaction.Select({style: styles});
map.addInteraction(selectInteraction);
selectInteraction.getFeatures().push(feature);
modifyInteraction = new ol.interaction.DragAndDrop({
features: selectInteraction.getFeatures()
});
map.addInteraction(modifyInteraction);
vector = new ol.layer.Vector({
style: styles,
source: new ol.source.Vector({
features: [feature]
})
});
map.getLayers().insertAt(1000, vector);
source
share