我的谷歌地图(静态html与JS)不会突然显示? [英] My google map (static html with JS) won't show up suddenly?
问题描述
但今天早上突然地图不会显示?我真的不知道
原本是否有效,现在它突然无法工作?
是否有任何API更新导致此问题?
有人可以帮我看看我的html文件如下吗?
您可以尝试将以下HTML代码复制并粘贴到文件并保存为html文件
,然后单击以打开HTML文件,地图不会显示出来?
< html>
< head>
< meta http-equiv =content-typecontent =text / html; charset = utf-8/>
< link rel =stylesheettype =text / csshref =style.css>< / link>
src =http://maps.google.co.jp/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA&hl= JA 类型= 文本/ JavaScript的>< /脚本>
< script type =text / javascript>
var stzoom = 13;
var map;
函数init(){
if(GBrowserIsCompatible()){
map = new GMap2(document.getElementById(map_canvas));
var mapui = map.getDefaultUI();
mapui.maptypes.physical = false;
map.setUI(mapui);
map.setCenter(new GLatLng(0,0),0);
bounds = new GLatLngBounds();
var polyOptions = {geodesic:true};
函数addIcon(图标){
icon.iconSize = new GSize(48,48);
icon.shadowSize =新的GSize(48,48);
icon.iconAnchor =新的GPoint(24,45);
icon.infoWindowAnchor = new GPoint(24,24); }
var newIcon = new GIcon();
newIcon.image =C:/ Program Files / TransTechnology / Enjoy ARES / Image / goal.png;
addIcon(newIcon);
var newIcon1 =新的GIcon();
newIcon1.image =C:/ Program Files / TransTechnology / Enjoy ARES / Image / start.png;
addIcon(newIcon1);
var newIcon2 =新的GIcon();
newIcon2.image =start.png;
addIcon(newIcon2);
var point0 =新GLatLng(37.85383,138.9178);
var marker0 = new GMarker(point0,{icon:newIcon1});
map.addOverlay(marker0);
var point1 =新GLatLng(37.85387,138.9179);
var marker1 = new GMarker(point1,{icon:newIcon});
map.addOverlay(marker1);
var polyline0 =新的GPolyline([新的GLatLng(37.85383,138.9178),
新的GLatLng(37.85374,138.9176),
新的GLatLng(37.85365,138.9175),
新的GLatLng 37.85355,138.9173),
新GLatLng(37.85347,138.9171),
新GLatLng(37.85336,138.9169),
新GLatLng(37.85326,138.9167),
新GLatLng(37.85317, (37.85305,138.9163),
新GLatLng(37.85297,138.9161),
新GLatLng(37.8529,138.9159),
新GLatLng(37.85279,138.9157) ,
新GLatLng(37.85269,138.9155),
新GLatLng(37.85267,138.9157),
新GLatLng(37.85264,138.9159),
新GLatLng(37.85255,138.916),
新GLatLng(37.85291,138.9158),
新GLatLng(37.85302,138.916),
新GLatLng(37.85313,138.9162),
新GLatLng(37.85321,138.9164),
新GLatLng(37.85334,138.9167),
新GLatLng(37.85344,138.9169),
新GLatLng(37.85355,138.9172),
新GLatLng(37.8537,138.9174),
新GLatLng(37.85381,138.9177),
新GLatLng(37.85389,138.9179),
新GLa tLng(37.85404,138.9181),
新GLatLng(37.854,138.9181),
新GLatLng(37.85387,138.9179)],#ff0000,5,0.7,polyOptions);
map.addOverlay(polyline0);
bounds.extend(new GLatLng(37.84937,138.9032));
bounds.extend(new GLatLng(37.87642,138.9412));
map.setZoom(map.getBoundsZoomLevel(bounds));
map.setCenter(bounds.getCenter());
}
}
window.onload = init;
< / script>
< / head>
< body scroll = no>
< div id =map_canvasstyle =width:1024px; height:706px; position:absolute; left:0; top:0>
< font size =5color =#cc0000>
< div align =center>
< p>< marquee>< / marquee>< / p>
< p>< marquee>< / marquee>< / p>
< p>< marquee>< / marquee>< / p>
< p>< marquee>< / marquee>< / p>
< p>< marquee>< / marquee>< / p>
< p>< marquee>
我们很抱歉地图无法显示......
< / marquee>< / p>
< / font>< / div>
< / body>
< / html>
您使用的是Google maps v2,使用时间更长。因此,您必须 升级到Google地图V3
。
以下是一个简单的 <如何使用谷歌地图版本3的例子。
Till yesterday, the HTML map file generated by my PC application can show up. But suddenly this morning, the Map won't show? I really have no idea that originally it worked and suddenly the it won't work now? Is there any API update that causes this problem?
Can somebody help see my html file as below? you can try to copy and paste the following HTML code to a file and save as html file, then click to open the HTML file and the map just won't show up?
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css"></link>
<script
src="http://maps.google.co.jp/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA&hl=ja"type="text/javascript"></script>
<script type="text/javascript">
var stzoom=13;
var map;
function init(){
if (GBrowserIsCompatible()){
map=new GMap2(document.getElementById("map_canvas"));
var mapui = map.getDefaultUI();
mapui.maptypes.physical = false;
map.setUI(mapui);
map.setCenter(new GLatLng(0,0),0);
bounds = new GLatLngBounds();
var polyOptions = {geodesic:true};
function addIcon(icon) {
icon.iconSize = new GSize(48, 48);
icon.shadowSize = new GSize(48, 48);
icon.iconAnchor = new GPoint(24, 45);
icon.infoWindowAnchor = new GPoint(24, 24); }
var newIcon = new GIcon();
newIcon.image = "C:/Program Files/TransTechnology/Enjoy ARES/Image/goal.png";
addIcon(newIcon);
var newIcon1 = new GIcon();
newIcon1.image = "C:/Program Files/TransTechnology/Enjoy ARES/Image/start.png";
addIcon(newIcon1);
var newIcon2 = new GIcon();
newIcon2.image = "start.png";
addIcon(newIcon2);
var point0=new GLatLng(37.85383,138.9178);
var marker0=new GMarker(point0,{icon: newIcon1});
map.addOverlay(marker0);
var point1=new GLatLng(37.85387,138.9179);
var marker1=new GMarker(point1,{icon: newIcon});
map.addOverlay(marker1);
var polyline0= new GPolyline([new GLatLng(37.85383,138.9178),
new GLatLng(37.85374,138.9176),
new GLatLng(37.85365,138.9175),
new GLatLng(37.85355,138.9173),
new GLatLng(37.85347,138.9171),
new GLatLng(37.85336,138.9169),
new GLatLng(37.85326,138.9167),
new GLatLng(37.85317,138.9165),
new GLatLng(37.85305,138.9163),
new GLatLng(37.85297,138.9161),
new GLatLng(37.8529,138.9159),
new GLatLng(37.85279,138.9157),
new GLatLng(37.85269,138.9155),
new GLatLng(37.85267,138.9157),
new GLatLng(37.85264,138.9159),
new GLatLng(37.85255,138.916),
new GLatLng(37.85291,138.9158),
new GLatLng(37.85302,138.916),
new GLatLng(37.85313,138.9162),
new GLatLng(37.85321,138.9164),
new GLatLng(37.85334,138.9167),
new GLatLng(37.85344,138.9169),
new GLatLng(37.85355,138.9172),
new GLatLng(37.8537,138.9174),
new GLatLng(37.85381,138.9177),
new GLatLng(37.85389,138.9179),
new GLatLng(37.85404,138.9181),
new GLatLng(37.854,138.9181),
new GLatLng(37.85387,138.9179)],"#ff0000", 5, 0.7, polyOptions);
map.addOverlay(polyline0);
bounds.extend(new GLatLng(37.84937, 138.9032));
bounds.extend(new GLatLng(37.87642, 138.9412));
map.setZoom(map.getBoundsZoomLevel(bounds));
map.setCenter(bounds.getCenter());
}
}
window.onload=init;
</script>
</head>
<body scroll=no>
<div id="map_canvas" style="width: 1024px; height: 706px; position: absolute; left: 0; top: 0">
<font size="5" color="#cc0000">
<div align="center">
<p><marquee></marquee></p>
<p><marquee></marquee></p>
<p><marquee></marquee></p>
<p><marquee></marquee></p>
<p><marquee></marquee></p>
<p><marquee>
We are sorry that the map cannot be shown......
</marquee></p>
</font></div>
</body>
</html>
You're using Google maps v2, which is no longer in use. So you have to upgrade to Google maps V3
.
Here is a simple example of how to use Google maps version3.
这篇关于我的谷歌地图(静态html与JS)不会突然显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!