无法显示带有传单的地图

时间:2018-12-19 17:18:27

标签: ionic-framework ionic3 leaflet

我想使用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'>

0 个答案:

没有答案