老师,请检查
来源:4-7 自由编程
慕桂英1352525
2021-07-16 22:22:03
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#container{
height:700px;
width:700px;
}
#insert{
position:absolute;
left:5px;
top:5px;
height:50px;
width:200px;
background:white;
}
</style>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=e0518a145a65b2ceff33e4fbd171e3ab&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>
</head>
<body>
<div id="container"></div>
<input id='insert' >
<script>
var map=new AMap.Map('container',{
center:[120,30],
zoom:16
});
var inp=new AMap.Autocomplete(
{input:'insert'}
)
var searchnode=new AMap.PlaceSearch({
map:map
})
AMap.event.addListener(inp,'select',function(e){
searchnode.search(e.poi.name)
})
</script>
</body>
</html>
1回答
同学你好,与要求有些不符,可以参考下方修改:


祝学习愉快~

祝学习愉快~
相似问题