只有在google-maps div区域显示的带有缩放控件的白色 [英] Only white color with zoom control shown in google-maps div area
问题描述
我尝试使用CHtmlView :: Navigate2方法在我的桌面应用程序中嵌入地图,浏览本地网页,这是一个简单的google-maps示例html。
html文件源如下。
<!DOCTYPE html>
< html>
< head>
< title>< / title>
< meta name =viewportcontent =initial-scale = 1.0>
< meta charset =utf-8>
< style>
html,body {
height:100%;
保证金:0;
padding:0;
}
#map {
height:100%;
}
< / style>
< / head>
< body>
< div id =map>< / div>
< script>
var map;
函数initMap(){
map = new google.maps.Map(document.getElementById('map'),{
center:{lat:-34.397,lng:150.644},
zoom:8
});
}
< / script>
< script src =https://maps.googleapis.com/maps/api/js?callback=initMap
async defer>< / script>
< / body>
< / html>
带有google-maps JavaScript API简单地图示例的html文件在Internet Explorer中正常显示,但只有白色彩色地图与我的CHtmlView窗口中的变焦控制。
我观察到,如果在我的测试应用程序中快速放大/缩小地图,有时地图会立即显示然后立即消失。
经过一天的挖掘问题...
最后我找出根本原因可能是应用于嵌入MS Web浏览器控制的IE版本。
首先,我从 Google Map API官方社区支持频道。
停止支持Internet Explorer 8
我们希望通知您,我们计划于2015年8月31日前停止支持Google Maps JavaScript API v3的Internet Explorer 8(IE8)。
然后我搜索了一个相关页面,其中提到了如何指定MS Web浏览器控件的IE版本( Rick Strahl的网络博客)
最终,我解决了我的问题通过应用注册表黑客从上面的问题链接^^祝愿这个挖掘旅程有助于遇到同样问题的人,祝你好运
I try to embed a map in my desktop application by using CHtmlView::Navigate2 method to browse local webpage which is a simple google-maps sample html. The html file source as the following.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?callback=initMap"
async defer></script>
</body>
</html>
The html file with google-maps JavaScript API simple map sample was displayed properly with Internet Explorer but only white color map with vaild zoom control in my CHtmlView window. And I observe that if quickly zoom in/out the map in my test application sometimes the map show up then disappear immediately.
After all-day digging to the issue...
Finally I figure out the root cause might be the IE version applied to the embed MS Web Browser Control.
First of all, I have caught related information from Google Map API official community support channel.
Discontinue support of Internet Explorer 8
We would like to inform you that we are planning to discontinue support of Internet Explorer 8 (IE8) for the Google Maps JavaScript API v3 around August 31st 2015.
And then I googled to a related page which mentions how to specify IE version of MS Web Browser Control.(Rick Strahl's Web Blog)
Eventually, I solved my problem by applying Registry Hacks from above link^^
Wish this digging journey is helpful for someone encountered the same problem, Good luck.
这篇关于只有在google-maps div区域显示的带有缩放控件的白色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!