JS获取经纬度的实现方法
<! - Copyright(c)2009 Google Inc。このサンプルを自由にコピーして使用できます。ライセンスはこちらをご覧ください:http://code.google.com/apis/ajaxsearch/faq/#license-> <!doctype html public "-// w3c // dtd xhtml 1.0 strict // en en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml" Xmlns:v = " http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> googleマップapiサンプル</title> <style type = "text/css"> @import url( "http://www.google.com/uds/cs/gseart.css"); @import url( "http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css"); </style> <script src = "http://maps.google.com/maps?file=api&v=2&key=abqiaaaaaaa1xbmidxx_btcy2_fkph06rragtyh6uml8madna0ykuwnna8vnxqeertaucfkyrr6owbovbxn7tdah5q" type = "text/javascript"> </script> <script src = "http://www.google.com/uds/api?file=uds.js&v=1.0" type = "text/javascript"> </script> <script src = "http://www.google.com type = "text/javascript"> </script> function initialize(){if(gbrowseriscompatible()){// Map36.1019825、103.6055232)var Map = new Gmap2(document.getElementbyid( "map_canvas")); map.setcenter(new Glatlng(36.1019825、103.6055232)、13); map.adddcontrol(new glargemapcontrol()); map.addcontrol(new gmaptypecontrol()); //検索コントロールをマップにバインドし、結果リストマップを抑制します。AddControl(new Google.maps.localsearch()、new gcontrolposition(g_anchor_bottom_right、new gsize(10,20))); }} gsearch.setonloadCallback(initialize); </script> </head> <body onload = "initialize()" onunload = "gunload()" style = "font-family:arial; border:0 none;"> <div id = "map_canvas"> </div> </html> </html>以上这篇js、希望能给大家一个参考、也希望大家多多支持武林网。