2

we have the following problem in a legacy (GMaps V2) application: we show a info window upon clicking on a marker. A pop-up is displayed and the user enters an annotation. If the user presses the shift key (for capitalizing letters), the map goes into "zoom mode" (the hand cursor changes into the arrow cursor, and, should the user move the mouse cursor outside the info window, he sees the red rubber-band rectanlge for zooming). Upon closing the window, the map is stuck in the zoom mode, with the red zoom rectangle showing. This only goes away after the user clicks, drags and the map zooms.

Is there a way to prevent the shift key to set the map mode? (I had a look at the KeyDragZoom library, but this didn't solve the problem.) I also tried many workaround for canceling the events, stop bubbling etc, to no avail.

Thanks in advance

4

2 回答 2

1

通过这种方式,您可以禁用键盘输入:

 var ui = map.getDefaultUI();
 ui.keyboard = false;
 map.setUI(ui); 
于 2012-04-13T13:07:28.220 回答
0

查看参考文档。您可以指定key哪个激活拖动缩放:

key String 按住以激活拖动缩放的热键,shift | 控制 | alt。请注意,altshift。

所以,我会尝试将其设置为nullor "alt"

于 2013-01-20T09:18:48.793 回答