Skip to content

Commit

Permalink
feat(SebmGoogleMap): support keyboardShortcuts opt
Browse files Browse the repository at this point in the history
Closes #236
  • Loading branch information
sebholstein committed Mar 21, 2016
1 parent 553842a commit 1a14570
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/directives/google-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {MouseEvent} from '../events';
providers: [GoogleMapsAPIWrapper, MarkerManager],
inputs: [
'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel',
'backgroundColor', 'draggableCursor', 'draggingCursor'
'backgroundColor', 'draggableCursor', 'draggingCursor', 'keyboardShortcuts'
],
outputs: ['mapClick', 'mapRightClick', 'mapDblClick', 'centerChange'],
host: {'[class.sebm-google-map-container]': 'true'},
Expand Down Expand Up @@ -92,11 +92,19 @@ export class SebmGoogleMap implements OnChanges,
*/
draggingCursor: string;

/**
* If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are
* enabled by default.
*/
keyboardShortcuts: boolean = true;

/**
* Map option attributes that can change over time
*/
private static _mapOptionsAttributes: string[] =
['disableDoubleClickZoom', 'scrollwheel', 'draggableCursor', 'draggingCursor'];
private static _mapOptionsAttributes: string[] = [
'disableDoubleClickZoom', 'scrollwheel', 'draggableCursor', 'draggingCursor',
'keyboardShortcuts'
];

/**
* This event emitter gets emitted when the user clicks on the map (but not when they click on a
Expand Down Expand Up @@ -136,7 +144,8 @@ export class SebmGoogleMap implements OnChanges,
disableDefaultUI: this.disableDefaultUI,
backgroundColor: this.backgroundColor,
draggableCursor: this.draggableCursor,
draggingCursor: this.draggingCursor
draggingCursor: this.draggingCursor,
keyboardShortcuts: this.keyboardShortcuts
});
this._handleMapCenterChange();
this._handleMapZoomChange();
Expand Down
1 change: 1 addition & 0 deletions src/services/google-maps-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ export interface MapOptions {
backgroundColor?: string;
draggableCursor?: string;
draggingCursor?: string;
keyboardShortcuts?: boolean;
}

0 comments on commit 1a14570

Please sign in to comment.