<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>逆地理编码</title>
<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.6&key=7145c3fe598de11b84149f5f1924d625&plugin=AMap.Geocoder"></script>
<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body>
<button type="button" onclick="regeocoder()">定位</button>
<span id="result"></span>
<script type="text/javascript">
&nb
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>逆地理编码</title>
<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.6&key=7145c3fe598de11b84149f5f1924d625&plugin=AMap.Geocoder"></script>
<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body>
<button type="button" onclick="regeocoder()">定位</button>
<span id="result"></span>
<script type="text/javascript">
&nb

这篇博客展示了如何在网页中使用高德地图API获取用户的当前位置,并进行逆地理编码,将经纬度转换为详细地址。通过加载地图、启用定位服务、监听定位完成事件以及调用逆地理编码函数,实现了在页面上显示用户位置的功能。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



