From c27bcd86d3737e6ca96df1032149ca4b2d6ecc56 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 15 Oct 2015 13:49:06 +0200 Subject: [PATCH 1/2] Change the selection drag box colors --- examples/box-selection.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/box-selection.js b/examples/box-selection.js index 33af212a55..cba08fe62f 100644 --- a/examples/box-selection.js +++ b/examples/box-selection.js @@ -8,6 +8,7 @@ goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); goog.require('ol.source.OSM'); goog.require('ol.source.Vector'); +goog.require('ol.style.Fill'); goog.require('ol.style.Stroke'); goog.require('ol.style.Style'); @@ -45,8 +46,11 @@ var selectedFeatures = select.getFeatures(); var dragBox = new ol.interaction.DragBox({ condition: ol.events.condition.shiftKeyOnly, style: new ol.style.Style({ + fill: new ol.style.Fill({ + color: [255, 255, 255, 0.4] + }), stroke: new ol.style.Stroke({ - color: [0, 0, 255, 1] + color: [100, 150, 0, 1] }) }) }); From a04022e8dfcdcd58ff3f66483ec6f3edefe4acc1 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 15 Oct 2015 13:49:37 +0200 Subject: [PATCH 2/2] Use Ctrl key / Meta key to activate the selection drag box --- examples/box-selection.html | 2 +- examples/box-selection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/box-selection.html b/examples/box-selection.html index 4ea2ba536b..720fe11ded 100644 --- a/examples/box-selection.html +++ b/examples/box-selection.html @@ -5,7 +5,7 @@ shortdesc: Using a DragBox interaction to select features. docs: >

This example shows how to use a DragBox interaction to select features. Selected features are added to the feature overlay of a select interaction (ol.interaction.Select) for highlighting.

-

Use SHIFT+drag to draw boxes.

+

Use Ctrl+drag (Meta+drag on Mac) to draw boxes.

tags: "DragBox, feature, selection, box" ---
diff --git a/examples/box-selection.js b/examples/box-selection.js index cba08fe62f..ded817496a 100644 --- a/examples/box-selection.js +++ b/examples/box-selection.js @@ -44,7 +44,7 @@ var selectedFeatures = select.getFeatures(); // a DragBox interaction used to select features by drawing boxes var dragBox = new ol.interaction.DragBox({ - condition: ol.events.condition.shiftKeyOnly, + condition: ol.events.condition.platformModifierKeyOnly, style: new ol.style.Style({ fill: new ol.style.Fill({ color: [255, 255, 255, 0.4]