显示IP查询位置地图的PHP程序

  • 软件分类: 国产软件 / 免费版 / 查询工具
  • 软件大小: 2.20MB
  • 运行环境: XP及以下/2003
  • 软件更新: 2008-4-19 19:46:39
  • 下载次数:
  • 软件评级:
  • 软件作者:
  • 软件编辑: chinacode
  • 软件演示: http://www.ipfox.com.cn/
  • 解压密码: www.chinacode.com
  • 加入收藏:
把查询地图显示和IP查询分开了,这样你可以很容易加到你原有的IP查询系统里!

原理:借助google maps显示其IP所在地地图位置。(需要申请个google的key)

文件:你自己的IP查询程序+一个HTML页即可


HTML文件2.htm代码
引用格式:http://www.ipfox.com.cn/2.htm?广东省深圳市罗湖区

2.htm代码:
复制内容到剪贴板
代码:
    <script src="http://ditu.google.com/maps?file=api&v=2.x&key=ABQIAAAAxrryO9ztNllJV478OHgoUhSldR1ND_txlcuxRl8_AG4iJh50ABTWAsb98SF8PpXkDnxpLXR4LWsFug&hl=zh-CN" type="text/javascript"></script>
    <script type="text/javascript">
    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
     geocoder = new GClientGeocoder();
           var address;
if (document.location.search == ""){
address= "";
}else{
address= document.location.search.substr(1);
}
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert("不能解析: " + address);
                         document.write("载入地址发生错误!请联系ipfox.com.cn管理员");
            } else {
              map.setCenter(point, 13);
                                                          var icon = new GIcon (G_DEFAULT_ICON, "ipfox.gif");
                                icon.iconSize = new GSize (32, 39);
              var marker = new GMarker(point, icon);
              map.addOverlay(marker);
                          map.enableScrollWheelZoom();
                                map.addControl(new GSmallMapControl());
                                map.addControl(new GScaleControl());
                                //map.addControl(new GMapTypeControl());
                                                                var txt = "<div style=\"font-family:Arial,Helvetica,Sans Serif;font-size:11px;text-align:center\">";
                                txt += "你所查询的IP所在地<br><font color=ff0000>";
                                txt += address+"</font><br>地理位置坐标<br>ipfox.com.cn为您提供"
                                txt += "<" + "/div>";
              marker.openInfoWindowHtml(txt);
            }
          }
        );
      }
       
      
      }
    }


    </script>
  </head>

  <body onLoad="initialize()" onUnload="GUnload()">
      <div id="map_canvas" style="width: 500px; height: 340px">正在载入IP地理位置图...</div>
大家也可以直接下载文件使用。
下载地址
下载说明
  • 为了达到最快的下载速度,推荐使用网际快车迅雷下载本站软件及源码资源。
  • 请一定升级到最新版WinRAR才能正常解压本站提供的软件及源码资源!
  • 如果您发现下载链接错误,请来信告知,谢谢!
  • 站内提供的所有资源包含破解及注册码均是由网上搜集,若侵犯了您的版权利益,敬请来信通知我们!
字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z