Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SebmGoogleMap): support keyboardShortcuts opt #236

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}