换了两家公司都提上需求要做这个定位的地图,今天整理了下把整页的源代码贴出来供大家参考下!其中的不足还请大家见谅,指出改正!
<!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>Document</title>
<link rel="stylesheet" href="https://cache.amap.com/lbs/static/main1119.css"/>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=a8e3f1d526511281bac2edf977a6ca03"></script>
<script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
<style type="text/css">
#mapContainer{
position: fixed;
top: 0;
left: 0;
overflow: auto;
margin-top: 0;
margin-bottom: 0;
background: #fff;
width: 100%;
height: 100%;
}
#mapContainer .search_wrap{
width: 100%;
height: 60px;
background: #fff;
background: linear-gradient(to right, #252A82 , #4AC4C9);
border-bottom: 2px solid #ccc;
z-index: 100;
}
#mapContainer .search_wrap input{
width: 70%;
height: 30px;
border-radius: 10px;
margin: 15px 15px;
overflow: hidden;
background: rgba(238,238,238,1) url(../images/inp-search.png) no