提交 d82c21a3 编写于 作者: K kinghzking

Thu Nov 9 16:09:00 CST 2023 inscode

上级 a82fb128
...@@ -4,27 +4,33 @@ ...@@ -4,27 +4,33 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<title>Document</title> <title>Document</title>
<style>
html, body, #map { height: 100%; }
</style>
</head> </head>
<body> <body>
<div id="map"></div> <div id="map"></div>
<script> <script>
var map = L.map('map').setView([51.505, -0.12], 13); var map = new L.Map('map', {
L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiZ3Jhc2giLCJhIjoiY2ludGVncmF0aW9uaW50biJ9.307npnHiWXDn9B37olXTLnA', { center: new L.LatLng(39.86,116.45),
attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>', zoom: 4
maxZoom: 18, });
minZoom: 10 L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '夜猫逐梦 @CartoDB Positron',
maxZoom: 18
}).addTo(map); }).addTo(map);
var polyline = L.polyline([[51.505, -0.12], [51.515, -0.125]], { var polyline = L.polyline([[39.92,116.46], [31.213,121.445]], {
color: 'red', color: 'red',
weight: 3 weight: 3
}).addTo(map); }).addTo(map);
var animation = new L.Animate(polyline, {
positions: [[51.505, -0.12], [51.515, -0.125]], var bj = L.marker([39.92,116.46]).bindPopup('这里是北京');
opacity: 0.5, var sh = L.marker([31.213,121.445]).bindPopup('这里是上海');
ease: 'linear' var gz = L.marker([23.16,113.23]).bindPopup('这里是广州');
}).run(); var cities = L.layerGroup([bj, sh, gz]).addTo(map);
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册