带有Googple Map的Web浏览器 [英] Web Browser with Googple Map
问题描述
我有一个脚本文件Map.html,如下所示:
<!DOCTYPE HTML PUBLIC - // W3C // DTD HTML 4.0 Transitional // EN>
< html>
< head>
< title> Google地图< / title>
< script src =http://maps.google.com/maps/api/js?v=3&sensor=false&libraries=geometrytype =text / javascript><<< ; /脚本>
< script type =text / javascript>
var map;
var markersArray = [];
window.onload = function()
{
var latlng = new google.maps.LatLng(29.99300,68.99414);
var options =
{
zoom:5,
center:latlng,
mapTypeId:google.maps.MapTypeId.ROADMAP,
scaleControl:true
};
map = new google.maps.Map(document.getElementById(divmap),options);
}
< / script>
< / head>
< body>
< div id =divmap>< / div>
< / body>
< / html>
和Visual Studio 2010中的一个窗体窗体。在窗体上,我放置了一个Web浏览器控件和窗体加载代码如下:
private void Form1_Load(object sender,EventArgs e)
{
String strMapPath = @C:\WebBrowserWithGoogpleMap\Map.html;
webBrowser1.Navigate(new Uri(strMapPath));
}
请帮忙,如何摆脱这个问题。
这个问题刚刚在另一个问题中得到解答。这似乎是事实,WPF WebBrowser使用旧版本的IE。
请参阅 scaleControl在.net中不能正确显示给出的答案
I am working on Desktop application C# .Net. On my form I am using Web Browser Control to open Google Map (Using API 3.0) Google map is showing perfectly but the problem is "Kilometer Scale" is showing blank.
I have a script file Map.html, showing below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Google Maps</title>
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false&libraries=geometry" type="text/javascript"></script>
<script type="text/javascript">
var map;
var markersArray = [];
window.onload = function ()
{
var latlng = new google.maps.LatLng(29.99300, 68.99414);
var options =
{
zoom: 5,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scaleControl: true
};
map = new google.maps.Map(document.getElementById("divmap"), options);
}
</script>
</head>
<body>
<div id="divmap"></div>
</body>
</html>
and a windows form in Visual studio 2010. On form I have placed a Web Browser control and on form load code is given below:
private void Form1_Load(object sender, EventArgs e)
{
String strMapPath = @"C:\WebBrowserWithGoogpleMap\Map.html";
webBrowser1.Navigate(new Uri(strMapPath));
}
Please help, how to get rid from this problem.
This issue has just been answered in another question. It seems to be the fact that WPF WebBrowser uses an old version of IE.
See scaleControl not displaying correctly in .net for the answer given there
这篇关于带有Googple Map的Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!