我想使用leaflet
,但我的地图显示不正确。
我有一张重复的卡片马赛克。
你能帮我吗?
我的TS:
@ViewChild('map') mapContainer: ElementRef;
map: any;
ionViewDidLoad() {
this.loadMap();
}
loadMap(){
this.map = leaflet.map("map").fitWorld();
leaflet.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
attributions: '*',
id: 'mapbox.streets',
maxZoom: 18,
zoomOffset: 1,
accessToken: '*'
}).addTo(this.map);
}
我的HTML:
<div id='map' style='width: 100%; height: 100%;'></div>
我有导入的CSS:
<link href='https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.css' rel='stylesheet'>