我想在绘制一个框(ol.interaction.DragBox)时使用拖动平移(ol.interaction.DragPan),以便我可以选择当前不在视口中的区域。有没有办法这样做?
使用jsfiddle示例,我可以绘制一个拖动框,但不知道如何使用拖动它。
// a DragBox interaction used to select features by drawing boxes
var dragBox = new ol.interaction.DragBox({
condition: ol.events.condition.platformModifierKeyOnly
});
map.addInteraction(dragBox);
dragBox.on('boxend', function() {
// features that intersect the box are added to the collection of
// selected features
var extent = dragBox.getGeometry().getExtent();
});