Key Map Detection on Google Maps

Is there a way to detect keypress only when the Google Maps canvas is in focus?

The Maps API V3 JavaScript API has built-in keyboard shortcuts. When a user clicks or drags a map, the map becomes in focus and responds to keyboard shortcuts. If you click anywhere outside the map canvas, these shortcuts will no longer work.

I would like to expand some of these shortcuts (in particular, the arrow keys) to perform additional actions.

+5
source share
1 answer

You can disable keyboard shortcuts on Google Maps, like here.

https://developers.google.com/maps/documentation/javascript/reference?hl=en#MapOptions

.

+3

All Articles