谷歌地图默认中心点怎么改?
这个是下载的一段代码,改编成在地图上取经纬度,返回给其他页面,但是默认的中心点事广东,我想改成青岛的,在哪改?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head><title>
无标题页
</title>
<style type="text/css">v\:* {behavior:url(#default#VML);}</style>
<style type="text/css">div{font-size:12px;font-family: Arial;}h1,h3{padding:0;margin: 5px;font-size: 16px;}</style>
</head>
<body onload="initialize()" onunload="GUnload()">
<div style="width:850px; padding: 10px 0; margin: 0 auto;">
<div>
//是不是在下面这段代码里改啊?里面有center字样
<script src=" http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA7nPTPXCvzWYxyKdmbFQfTxRfh1ef-GeSz5gtCVpCKOPebNr1YhR23M_jRfeqAugNMsW3pZQJAwfCFw" type="text/javascript"></script><script type="text/javascript">eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return' \\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp(' \\b'+e(c)+'\\b','g'),k[c]);return p;}('3 1,R,O,N,Q,P;5 K(){a(J()){a(!m.l("8")){n("M[8] L p r");W}1=0 V(m.l("8"));3 x=Y.X;3 y=S.U;3 k=13;1.T(0 I(x,y),k);1.v(u);1.7(0 t());1.7(0 A());1.7(0 F(0 b(E,w)));1.7(0 C());3 4=0 j();4.D="G://B.H.s/z/1m.1p";4.1o=0 b(1r,c);4.1q=0 b(1k,c);4.1j=0 d(9,c);4.1l=0 d(9,2);4.1s=0 d(18,1u);3 16=0 j(4);f.i(1,"19",5(q,h){a(!q){1.17();3 6=0 14(h,{10:Z});3 g=5(o){11{1g(o.1f(),o.1i(),1.1h())}1e(e){n(\'1b p r\')}6.1a("1d")};f.i(6,"1c",5(){1.12()});f.i(6,"15",5(){g(1t.1v())});1.1n(6);g(h)}})}}',62,94,'new|map||var|baseIcon|function|markera|addControl|showmymap||if|GSize|34|GPoint||GEvent|_showpoint|pt|addListener|GIcon|big|getElementById|document|alert||is|overlay|null|com|GLargeMapControl|G_NORMAL_MAP|setMapType|150|||mapfiles|GScaleControl|www|GMapTypeControl|shadow|200|GOverviewMapControl|http|google|GLatLng|GBrowserIsCompatible|initialize|object|dom|mapshowmsg2|mapshowmsg1|mapshowmsg4|mapshowmsg3|mapshowmsg0|113|setCenter|2964|GMap2|return|1103|23|true|draggable|try|closeInfoWindow||GMarker|dragend|letteredIcon|clearOverlays||click|openInfoWindowHtml|callback|dragstart|自定义标注点消息|catch|lat|getCurrentPoint|getZoom|lng|iconAnchor|37|infoWindowAnchor|shadow50|addOverlay|iconSize|png|shadowSize|20|infoShadowAnchor|this|25|getPoint'.split('|'),0,{}))
</script>
<script type="text/javascript">
function getCurrentPoint(x, y, z)
{
document.getElementById('returnjsvalue').innerHTML = "纬度X:" + x + " 经度Y:" + y;
Text1.value=x;
Text2.value=y;
}
function Button1_onclick()
{
location.href="../m_register2.aspx?x="+""+Text1.value+"&y="+Text2.value+"";
}
</script>
<div id="showmymap" style="margin: 0 auto; width: 700px; height: 500px;"></div>
</div>
<div>
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
<input id="Text1" type="text" />
<input id="Text2" type="text" /></div>
<div style="text-align: center; padding: 10px;"><span id="returnjsvalue" visible="false" style="color:Green; font-size: 13px; font-weight: bold;"></span></div>
</div>
</body>
</html>
麻烦说的详细点~~
[解决办法]
看不懂哦,麻烦高手帮看看,设置谷歌地图中心点是这样的。map.setCenter(new GLatLng(39.917, 116.397), 14);new GLatLng(39.917, 116.397)这个是中心点,14是地图缩放比例。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google 地图 JavaScript API 示例: 简单的地图</title> <script src="http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA&hl=zh-CN" type="text/javascript"></script> <script type="text/javascript"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(39.917, 116.397), 14); } } </script> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width: 500px; height: 300px"></div> </body></html>