I am looking for a sample code for rotate and resize vectors in Openlayers 4, but I can not find anything about it. I found this sample code http://dev.openlayers.org/examples/modify-feature.html but its version Openlayers 2.

I've done this so far

   var modify = new ol.interaction.Modify({source: source});

  var catch;
  var typeSelect = document.getElementById('type');

  function addInteractions() {
    catch = new ol.interaction.Snap({source: source});

I can't find a function like this


1 Answer 1


Perhaps these stackoverflow answers could be useful for vector feature rotation

How to rotate feature in openlayer 3?

How to change the rotation point (Feature) on the map after it is created and added to map?

ol3-rotate-feature is a plugin for OpenLayers 3 that should provide a rotate vector features interaction.


The Translate Features example using ol.interaction.Translate demonstrates dragging interaction for vector layers. Check the api doc for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.