Merge pull request #137 from twpayne/alt-shift-rotate

Use Alt+Shift to rotate by default, fixes #21
This commit is contained in:
Tom Payne committed 2013-01-20 10:38:24 -08:00
commit 202df34e71
3 files changed
+15 -3

No files matched your search

+12
View File
@@ -20,6 +20,18 @@ ol.interaction.condition.altKeyOnly = function(browserEvent) {
};
/**
* @param {goog.events.BrowserEvent} browserEvent Browser event.
* @return {boolean} True if only the alt and shift keys are pressed.
*/
ol.interaction.condition.altShiftKeysOnly = function(browserEvent) {
return (
browserEvent.altKey &&
!browserEvent.platformModifierKey &&
browserEvent.shiftKey);
};
/**
* @param {goog.events.BrowserEvent} browserEvent Browser event.
* @return {boolean} True if only the no modifier keys are pressed.
+2 -2
View File
@@ -893,8 +893,8 @@ ol.Map.createInteractions_ = function(mapOptions) {
var rotate = goog.isDef(mapOptions.rotate) ?
mapOptions.rotate : true;
if (rotate) {
interactions.push(
new ol.interaction.DragRotate(ol.interaction.condition.altKeyOnly));
interactions.push(new ol.interaction.DragRotate(
ol.interaction.condition.altShiftKeysOnly));
}
var doubleClickZoom = goog.isDef(mapOptions.doubleClickZoom) ?