Google Map 显示当前IP所在位置
?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript" src="http://fw.qq.com/ipaddress" charset="GBK"></script> <script type="text/javascript" src="http://www.google.com/jsapi?key=abc"></script> <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=true&key=abc"></script> <script type="text/javascript">function loadMaps(address) { var map = new google.maps.Map2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); var geocoder = new GClientGeocoder(); geocoder.getLatLng(address,function(point) { if (!point) {alert(address + " not found");map.setCenter(new GLatLng(35.8616600, 104.1953970), 4); } else {map.setCenter(point, 12);var marker = new GMarker(point);map.addOverlay(marker);marker.openInfoWindowHtml(address); }} );}function init() { loadMaps(IPData[2]);} </script> </HEAD> <BODY onload="init()" onunload="GUnload()"> <div id="map" style="width: 800px; height: 600px"></div> </BODY></HTML>1 楼 flyliying 2010-08-20 不错,试了一下