ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 百度地图 [TOC] ## 选择地图坐标 ![](https://box.kancloud.cn/ad5ddbbbdd21cd0d8a5350d8efb63eea_604x616.png) ``` <buttoon class="btn btn-default" onclick="showmap()">打开地图</buttoon> <script> require(['hdjs']) function showmap() { require(['hdjs'], function (hdjs) { hdjs.map('', function (res) { //返回值是数组 console.log("地址:" + res.address + ";经度" + res.lng + ";纬度:" + res.lat); }); }); } </script> ``` ## 设置地图坐标 ``` <buttoon class="btn btn-default" onclick="showmap()">显示上海市</buttoon> <script> require(['hdjs']) function showmap() { require(['hdjs'], function (hdjs) { hdjs.map({lng:121.480237,lat:31.236305}, function (res) { //返回值是数组 console.log("地址:" + res.address + ";经度" + res.lng + ";纬度:" + res.lat); }); }); } </script> ```