【问题标题】:Windows Forms WebBrowser and Google Maps Api Not Displaying MapWindows Forms WebBrowser 和 Google Maps Api 不显示地图
【发布时间】:2017-02-10 21:00:42
【问题描述】:

我正在使用 .net 4.51 Windows Forms VS 2015。今天,我所有使用 WebBrowser 控件的应用程序都停止加载 Google 地图或至少无法正确显示它。网络浏览器是空白的。

我从以下位置加载 Google 地图:

<script type="text/javascript" src="http://maps.google.com/maps/api/js? sensor=false">

如果我在地图上快速放大和缩小,地图会短暂闪烁但不会显示。 有没有其他人遇到过这种情况?

【问题讨论】:

    标签: windows google-maps webbrowser-control


    【解决方案1】:

    我的桌面 win32 应用程序有同样的问题,刚刚解决。也许你可以试试我的观察,祝你好运。 (link)

    【讨论】:

      【解决方案2】:

      通过在标题部分添加以下元标记为我解决了这个问题。

      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;

      【讨论】:

      • 如果可能的话请举个例子
      【解决方案3】:

      这个链接

      http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Versionwill 对问题进行排序,但从长远来看,可能会考虑使用 .net 的镶边控件

      CefSharp
      

      【讨论】:

        【解决方案4】:

        我解决了这个问题!!!

        在链接中,我放了 v=3.21 的版本。

        &lt;script src="https://maps.googleapis.com/maps/api/js?v=3.21&amp;signed_in=false"&gt;&lt;/script&gt;

        【讨论】:

        • 使用 C# Web 浏览器为我工作。谢谢
        猜你喜欢
        • 2015-09-30
        • 1970-01-01
        • 1970-01-01
        • 2010-10-30
        • 2012-07-17
        • 1970-01-01
        • 1970-01-01
        • 2023-04-02
        • 1970-01-01
        相关资源
        最近更新 更多