我正在尝试实现一个传单地图API,但我不能让它出现。我正在跟踪这个链接。term=desclink-传单-样本

我的代码map.component.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js"></script>
<style>
#map {position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
</style>
</head>
<body>
<div id="map">
<a href="https://www.maptiler.com" style="position:absolute;left:10px;bottom:10px;z-index:999;"><img src="https://api.maptiler.com/resources/logo.svg" alt="MapTiler logo"></a>
</div>
<p><a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a></p>
<script>
var map = L.map('map').setView([0, 0], 1);
L.tileLayer('https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=cCaw1Q6a8s1Bm4tJPpTq',{
tileSize: 512,
zoomOffset: -1,
minZoom: 1,
attribution: "\u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e",
crossOrigin: true
}).addTo(map);
</script>
</body>
</html>map.component.css
html { height:100%; }
body { position:absolute; top:0; bottom:0; right:0; left:0; }发布于 2022-08-11 15:11:46
将html更改为:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" />
<script
src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js"></script>
<style>
#map {position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
</style>
</head>
<body>
<div id="map">
<a href="https://www.maptiler.com"
style="position:absolute;left:10px;bottom:10px;z-index:999;"><img
src="https://api.maptiler.com/resources/logo.svg" alt="MapTiler logo"></a>
</div>
<p><a href="https://www.maptiler.com/copyright/"
target="_blank">© MapTiler</a> <a
href="https://www.openstreetmap.org/copyright" target="_blank">©
OpenStreetMap contributors</a></p>
<script>
var map = L.map('map').setView([0, 0], 1);
L.tileLayer('https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=cCaw1Q6a8s1Bm4tJPpTq',{
tileSize: 512,
zoomOffset: -1,
minZoom: 1,
attribution: "\u003ca href=\"https://www.maptiler.com/copyright" /
"target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca" /
"href=\"https://www.openstreetmap.org/copyright" /
"target=\"_blank\"\u003e\u0026copy; OpenStreetMap" /
"contributors\u003c/a\u003e",
crossOrigin: true
}).addTo(map);
</script>
</body>
</html>你的titleLayer有\n个角色。
如果你想用角度来处理传单,最好的解决办法是使用有角度的传单。
https://stackoverflow.com/questions/73322762
复制相似问题