问题标签 [keydragzoom]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1845 浏览

google-maps - 使用带有 Google Maps KeyDragZoom 的自定义控件 - 如何激活拖动缩放?

我正在使用 KeyDragZoom

http://google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/2.0.5/docs/examples.html

我想将控件放在页面上的其他位置,而不是在谷歌地图内。我不知道该怎么做。我什至可以在地图上设置一个按钮,它只会触发点击地图内的按钮。如何激活拖动缩放?

PS 我正在使用可视拖动缩放控件而不是使用像 shift 这样的键盘键。

0 投票
2 回答
219 浏览

google-maps - Preventing shift key from setting map into zoom mode

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

0 投票
2 回答
701 浏览

jquery - 如何在 GMAP3 中使用 KeyDragZoom?

文档显示 - http://google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/1.0/docs/examples.html

但是因为我使用的是gmap3,所以我不确定如何实现?这是我初始化地图的代码

有任何想法吗?干杯

0 投票
0 回答
1626 浏览

javascript - 谷歌地图矩形选择工具:如何在keydragzoom库中保持矩形显示

使用 keydragzoom 库,您可以将鼠标拖动到地图上以进行矩形选择,请参见此示例:http: //google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/2.0.9/examples /events.html

我想要的是使用它作为选择工具,即选择特定的矩形,并保持矩形(选择)显示。但是在结束鼠标拖动后,矩形总是消失。有什么办法可以用这个库来实现这一点?

我尝试将noZoom选项设置为true,但没有帮助。我知道我可以绘制自己的矩形,但是在选择新矩形等时需要处理情况。所以我想在这个库中做。