根据经纬度输出(获取)位置名称

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>反地址解析</title>
<style type="text/css">
*{
    margin:0px;
    padding:0px;
}
body, button, input, select, textarea {
    font: 12px/16px Verdana, Helvetica, Arial, sans-serif;
}
p{
    width:603px;
    padding-top:3px;
    margin-top:10px;
    overflow:hidden;
}
</style>

<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp"></script>
<script>
get_address = function() {
    geocoder = new qq.maps.Geocoder({
        complete : function(result){
            console.log(result.detail.address);
        }
    });
    var latLng = new qq.maps.LatLng(39.98174,116.30631);
    geocoder.getAddress(latLng);    
}();
</script>
</head>
<body >
<div>
<input id="latLng" type="textbox" value="39.98174,116.30631">
<input type="button" value="search" οnclick="get_address()">
</div>
<div style="width:603px;height:300px" id="container"></div>
<p>输入坐标,点击search进行反地址解释,点击marker会弹出反查结果。</p>
</body>
</html>

转载于:https://www.cnblogs.com/langxi/p/4387365.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值