高德地图应用设置地图的中心点

发布时间:2025-12-09 11:51:16 浏览次数:2

<!DOCTYPE html><html lang="zh"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title></title><script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.11&key=key值"></script><style type="text/css">*{margin: 0;padding: 0;}#container{width: 100%;height: 100%;position: absolute;left: 0;top: 0;}#setZoomNode,#setCenterNode{width: 300px;height: 100px;position: absolute;z-index: 99;right: 20px;top: 20px;border: 1px solid black;box-shadow: 0 0 5px black;background: white;}</style></head><body><p ></p><p id='setCenterNode'>    <input type="" name="" id='xNode'>    <input type="" name="" id='yNode'>    <button id='btn'>确定</button></p><script>var map=new AMap.Map('container',{zoom:11,center:[121,30]});btn.onclick=function(){map.setCenter([xNode.value,yNode.value]);}</script></body></html>

设置xy轴地图中心点

中心点
需要做网站?需要网络推广?欢迎咨询客户经理 13272073477