You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.4 KiB
54 lines
1.4 KiB
2 months ago
|
<!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>图标点标记</title>
|
||
|
<link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
|
||
|
<style>
|
||
|
html,
|
||
|
body,
|
||
|
#container {
|
||
|
height: 100%;
|
||
|
width: 100%;
|
||
|
}
|
||
|
|
||
|
.amap-icon img {
|
||
|
width: 30px;
|
||
|
height: 30px;
|
||
|
border: 2px solid #fff !important;
|
||
|
box-sizing: border-box;
|
||
|
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
|
||
|
border-radius: 50% !important;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="container"></div>
|
||
|
<script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=932d4222e3ba09d24dec0309bdc780c3">
|
||
|
</script>
|
||
|
<script type="text/javascript">
|
||
|
// 创建地图实例
|
||
|
var map = new AMap.Map("container", {
|
||
|
zoom: 13,
|
||
|
center: [116.4, 39.92],
|
||
|
resizeEnable: true
|
||
|
});
|
||
|
|
||
|
// 以 icon URL 的形式创建一个途经点
|
||
|
var viaMarker = new AMap.Marker({
|
||
|
position: new AMap.LngLat(116.38, 39.92),
|
||
|
// 图标尺寸
|
||
|
size: new AMap.Size(30, 30),
|
||
|
// 图标的取图地址
|
||
|
icon: 'https://lbqny.migugu.com/admin/anmo/technician/default_technician.png',
|
||
|
// 图标所用图片大小
|
||
|
imageSize: new AMap.Size(30, 30),
|
||
|
});
|
||
|
|
||
|
// 将 markers 添加到地图
|
||
|
map.add([viaMarker]);
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|