<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script language="javascript" type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>
<!--调用谷歌地图js,zoom缩放倍数,center中心,mapTypeId地图类型-->
<script type="text/javascript" src="http://ditu.google.com/maps/api/js?sensor=true"></script>
<script language="javascript">
          var geocoder;
           var map;
           function initialize() {
             geocoder = new google.maps.Geocoder();
             var latlng = new google.maps.LatLng(39.9493, 116.3975);
             var myOptions = {
               zoom: 15,
               center: latlng,
               mapTypeId: google.maps.MapTypeId.ROADMAP
             }
             var address = remote_ip_info.country+remote_ip_info.province+remote_ip_info.city;
document.getElementById('add').innerHTML = "欢迎来自:"+address+"的朋友!";
            var img='http://avatar.csdn.net/B/9/A/1_youacai.jpg';
             if (geocoder) {
               geocoder.geocode( { 'address': address}, function(results, status) {
                 if (status == google.maps.GeocoderStatus.OK) {
                   map.setCenter(results[0].geometry.location);
                   var marker = new google.maps.Marker({
                       map: map,
                       position: results[0].geometry.location,
                        title:'你现在的位置',
                      // icon:img
                   });
                 }
               });
             }
             map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
           }
           </script>
</head>
<body onload="initialize()">

  <div ></div>

   <div ></div>
</body>
</html>

相关文章:

  • 2021-12-26
  • 2022-12-23
  • 2021-07-31
  • 2021-06-13
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
猜你喜欢
  • 2021-10-31
  • 2021-09-22
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案