09
2013
04

百度地图给定两个经纬度坐标测算出他们之间的直线距离

 <html>    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
            body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
            #l-map{height:100%;width:78%;float:left;border-right:2px solid #bcbcbc;}
            #r-result{height:100%;width:20%;float:left;}
        </style>
        <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"> //百度地图引用工具
        </script>
        <script type="text/javascript" src="http://api.map.baidu.com/library/DistanceTool/1.2/src/DistanceTool_min.js"> //地图测算工具引用
        </script>
        <script type="text/javascript" src="js/jquery-1.5.1.min.js"> //引用js的jquery文件
        </script>
        <title>
            鼠标测距
        </title>
    </head>
    
    <body>
        <div id="allmap" style="width:800px;"> //显示地图的div层
        </div>
    </body>

«1»