... 不支持谷歌地图 Javascript API。使用其他浏览器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47360438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 07:19:46  来源:igfitidea点击:

... google maps Javascript API not supported. Use another Browser

javascriptgoogle-mapsgoogle-maps-api-3browsernotsupportedexception

提问by Peter Hanhart

I am using two different third party programs (different companies) that apparently use the Google Maps Javascript API. When they load the map, the world map is shown, but an Error message is displayed: "Der von Ihnen verwendete Browser wird von Google Maps Javascript API nicht unterstützt. Verwenden Sie einen anderen Browser". (Translation: The browser you are using is not supported by Google Maps Javascript API. Use another browser). I am using Windows 7 and Internet Explorer 11.0.48. Early 2017 the programs were working correctly. I changed the default browser to Chrome using the option provided by chrome, but the error still appears. Is there a workaround on the user side? Regards Peter

我正在使用两个不同的第三方程序(不同的公司),它们显然使用了 Google Maps Javascript API。当他们加载地图时,会显示世界地图,但会显示错误消息:“Der von Ihnen verwendete Browser wird von Google Maps Javascript API nicht unterstützt. Verwenden Sie einen anderen Browser”。(翻译:Google Maps Javascript API 不支持您使用的浏览器。使用其他浏览器)。我使用的是 Windows 7 和 Internet Explorer 11.0.48。2017 年初,这些程序运行正常。我使用 chrome 提供的选项将默认浏览器更改为 Chrome,但错误仍然出现。用户方面有解决方法吗?问候彼得

One of the programs is downloadable from http://www.codres.de/google-map-saver(GMS.NET), the other one came with a GPS logger from Canmore GPS on CD ROM and dates from 2013. Both show the same behaviour, GMS.NET after clicking the button "Go to location", GPS Photo Tagger right after start up. The english error message is "You are using a browser that is not supported by the Google Maps JavaScript API. Consider changing your browser. Learn More, Dismiss". When I click "Learn more" I am told that IE 11 is my current browser. When I click an internet link in an e-mail Google Chrome is used (as default browser). It seems to me that the JavaScript API does not recognise Chrome as the default browser. IE11 is not run in compatibility mode. The Notebook I am using runs Windows 7 64bits.

其中一个程序可从http://www.codres.de/google-map-saver(GMS.NET)下载,另一个程序在 CD ROM 上带有来自 Canmore GPS 的 GPS 记录器,日期为 2013 年。两者都显示了相同的行为,GMS.NET 在单击“转到位置”按钮后,在启动后立即 GPS 照片标记器。英文错误消息是“您使用的浏览器不受 Google Maps JavaScript API 支持。请考虑更换您的浏览器。了解详情关闭”。当我点击“了解更多”时,我被告知 IE 11 是我当前的浏览器。当我点击电子邮件中的互联网链接时,使用谷歌浏览器(作为默认浏览器)。在我看来,JavaScript API 确实如此无法将 Chrome 识别为默认浏览器。IE11 未在兼容模式下运行。我使用的笔记本运行 Windows 7 64 位。

I clicked the link in geocodezip's response. This sample works correctly calling Chrome (even when I copy the code into MS Word). When I open the link in IE11 it also works correctly. Is it possible to define the InternetExplorer as default browser in the Javascript API? This might be the reason for the different behaviour of the geocodezip sample and my programs. In this case the programs would have to be mended.

我点击了 geocodezip 响应中的链接。此示例可以正确调用 Chrome(即使我将代码复制到 MS Word 中)。当我在 IE11 中打开链接时,它也能正常工作。是否可以在 Javascript API 中将 InternetExplorer 定义为默认浏览器?这可能是 geocodezip 示例和我的程序行为不同的原因。在这种情况下,必须修改程序。

回答by Robert Mihai Ionas

Look here https://developers.google.com/maps/documentation/javascript/versions

看这里 https://developers.google.com/maps/documentation/javascript/versions

<script async defer src="https://maps.googleapis.com/maps/api/js?v=3.31&key=YOUR_API_KEY&callback=initMap">

see v=3.31 latest is now 3.32 and if is not specified it will use the latest

见 v=3.31 最新版现在是 3.32,如果没有指定,它将使用最新版

And here https://console.developers.google.com/apis/credentials/key/check all api restrictions enter image description here

在这里 https://console.developers.google.com/apis/credentials/key/检查所有 api 限制 在此处输入图片说明

回答by Benno

I had the same issue with users on Windows 7 IE and no Chrome browser installed.

我在 Windows 7 IE 上遇到了同样的问题,但没有安装 Chrome 浏览器。

Added the following line :

添加了以下行:

<meta http-equiv="X-UA-Compatible" content="IE=11" /> 

Which seems to have resolved.

这似乎已经解决了。

回答by Hazzit

It seems a number of programs show this error since late 2017. The underlying problem here seems to be that they are all using an embedded webbrowser relying on IE technology. This embedded webbrowser needs to signal the proper IE version to the Google Maps JS library. Unfortunately, only the programmers of that software can do this. Adding the following to the page's source usually helps:

自 2017 年末以来,似乎有许多程序显示此错误。这里的潜在问题似乎是它们都使用依赖 IE 技术的嵌入式网络浏览器。此嵌入式网络浏览器需要向 Google Maps JS 库发送正确的 IE 版本信号。不幸的是,只有该软件的程序员才能做到这一点。将以下内容添加到页面的源代码通常会有所帮助:

<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 

回答by Onur

It seems that Google has dropped support for legacy systems (like Windows 7, earlier versions of IE) in Javascript API even with v3. It was working until this month, and what i also noticed that adding "v=3" string to maps api URL is no longer helping IE clients to run it without error. It's not a good behaviour of Google that there are older clients using v3 api with older IE verions which were working perfectly until this month.

似乎谷歌已经放弃了在 Javascript API 中对遗留系统(如 Windows 7,早期版本的 IE)的支持,即使是v3 也是如此。它一直工作到本月,我还注意到将“v=3”字符串添加到映射 api URL 不再帮助 IE 客户端无错误地运行它。谷歌的一些老客户使用 v3 api 和旧的 IE 版本,这些版本直到本月都运行良好,这不是谷歌的一个好行为。