老师,请检查

来源: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回答

好帮手慕言

2021-07-17

同学你好,与要求有些不符,可以参考下方修改:
http://img.mukewang.com/climg/60f24dc409445c9f03800152.jpg

http://img.mukewang.com/climg/60f24dd609a952ab04250540.jpg

http://img.mukewang.com/climg/60f24e0a093726ff05560222.jpg

祝学习愉快~

http://img.mukewang.com/climg/60f24df0096395a006270238.jpg

祝学习愉快~

0

0 学习 · 6815 问题

查看课程