Windows Forms WebBrowser and Google Maps Api Not Displaying Map

泪湿孤枕 提交于 2019-12-13 05:23:08

问题


I am using the .net 4.51 Windows Forms VS 2015. Today all my apps using the WebBrowser control stopped loading Google maps or at least displaying it correctly. The Webbrowser is just blank.

I load the Google maps from:

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

If I zoom in and out quickly on the map the maps appears briefly flickering but wont show. Is anyone else experiencing this?


回答1:


I have the same problem to my desktop win32 application and just solved. Maybe you can try my observation, Good luck. (link)




回答2:


By adding the following meta tag in a header section solved this issue for me.

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




回答3:


This link

http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Versionwill sorts the problem but for long term maybe think about using the chrome control for .net

CefSharp



回答4:


I solved the problem!!!

In the link, i put the version v=3.21.

<script src="https://maps.googleapis.com/maps/api/js?v=3.21&signed_in=false"></script>


来源:https://stackoverflow.com/questions/33102137/windows-forms-webbrowser-and-google-maps-api-not-displaying-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!