【发布时间】:2017-06-27 22:31:39
【问题描述】:
在我的 Angular 2 应用程序之外使用相同的配置,传单加载正常,但这是 Angular 2 中发生的情况:
如果我移动地图,会加载不同的图块,但同样的问题仍然存在。
html:
<div class="leaflet-maps" id="map"></div>
组件:
let el = this._elementRef.nativeElement.querySelector('.leaflet-maps');
let map = L.map("map", {
zoomControl: false,
center: L.latLng(37.8, -96),
zoom: 5,
minZoom: 4,
maxZoom: 19
});
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
我已经通过以下方式加载了传单 css 文件:
styleUrls: ['./maps.component.scss']
我粘贴小册子css内容的地方
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
....
【问题讨论】:
标签: javascript css angular sass leaflet