-2

Is box selection supported in Guide4You?

If so, how to add that control?

Official Openlayers example: https://openlayers.org/en/latest/examples/box-selection.html?q=select

Thanks in advance!

Kind regards Sam

Sam
  • 23
  • 4

1 Answers1

0

It is not possible through the JS API, but you can do it using OpenLayers in conjunction with guide4you like this:

var dragBox = new DragBox();
map.addSupersedingInteraction('singleclick pointermove', dragBox);

// ... use drag Box. And when done call:
dragBox.setActive(false);
// you can reactivate it if you need it again

The addSupersedingInteraction will cause any other interaction that use 'singleclick' or 'pointermove' to be deactivated. As soon as you deactivate dragBox they will get turned on again.

If you are using an older version you need to add ol.interaction. before the DragBox class.

Simon Zyx
  • 6,503
  • 1
  • 25
  • 37