巨大的谷歌地图控件(可能的错误?) [英] Huge Google Maps Controls (Possible Bug?)

查看:24
本文介绍了巨大的谷歌地图控件(可能的错误?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次注意到我的 Google 地图控件在我自己的网络应用程序上不成比例地大(见下文).

最初我认为我的一些 CSS 是在控件上使用 Google 的 CSS;然而,访问谷歌自己的网页告诉我这件事对我来说并不是孤立的......

下面是他们的文档地图:

对我来说,大控件也出现在他们文档的每一页上.我尝试了不同的机器和不同的浏览器(Chrome 和 Firefox).

我还尝试了其他使用 Google Maps API 的网站,并在某些情况下看到了类似的现象.

还有其他人遇到同样的问题吗?

解决方案

事实证明这不是错误.在此处查看更多信息:

<块引用>

2018 年 8 月 13 日 03:56PM 每周报告问题 Google Maps JavaScript API频道 (3.34) 将使用更大的控件 UI.

随着我们看到各种设备上触摸操作的增加,我们调整了控件 UI 以适合手指触摸和鼠标点击.

可以通过将 API 加载为 v=quarterly 来选择退出,v=3、v=3.33 或 v=3.32.注意:对退休版本的请求将收到默认频道,请参阅1.

如果您对新控件 UI 有任何请求或其他问题请告诉我们.

1 https://issuetracker.google.com/112519576

在加载 API 时使用 v=quarterly、v=3、v=3.33 或 v=3.32 以使用较小的控件.

参考@Jonny van Beek 的回答,了解如何将 Google 地图的控件缩放到您选择的大小.

请参阅@garethdn 和@Peter(如下)的回答,了解如何用您自己的自定义控件替换 Google 的大型控件.

有关此问题的最新正确解决方案,请参阅@Dutchmanjonny 的帖子(如下).

I first noticed that my Google Maps Controls were disproportionally large on my own web app (seen below).

Initially I thought some of my CSS was playing with Google's CSS on the controls; however, visiting Google's own webpage told me this incident was not isolated to me...

Below is a map on their documentation: https://developers.google.com/maps/documentation/javascript/examples/control-positioning

The large controls appear on every page of their documentation for me as well. I tried different machines and different browsers (Chrome and Firefox).

I also tried other sites that used the Google Maps API and saw a similar phenomenon in some cases.

Is anyone else experiencing the same issues?

解决方案

Turns out this isn't a bug. See more here:

Aug 13, 2018 03:56PM Reported Issue Google Maps JavaScript API weekly channel (3.34) will be using the larger control UI.

As we are seeing increases of touch operations on various devices, we adjusted the control UI to fit for both finger touches and mouse clicks.

It's possible to opt out of this by loading the API with v=quarterly, v=3, v=3.33 or v=3.32. Note: requests to retired version will receive the default channel, see 1.

If you have any requests or other issues concerning the new control UI please let us know.

1 https://issuetracker.google.com/112519576

Use v=quarterly, v=3, v=3.33 or v=3.32 when loading the API to use smaller controls.

EDIT:

Refer to answer from @Jonny van Beek on how to scale Google map's controls to the size of your choosing.

Refer to answers from @garethdn and @Peter (below) to find out how to replace Google's large controls with your own custom controls.

Refer to @Dutchmanjonny's post (below) for latest and correct solution to this problem.

这篇关于巨大的谷歌地图控件(可能的错误?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆