我想删除或隐藏 LayersControl,因为我使用外部菜单更改了地图的图层。这可能吗?我有这个代码:
HTML
<div leaflet
[leafletOptions]="leafletOptions"
[leafletBaseLayers]="baseLayers"
(leafletMapReady)="onMapReady($event)">
</div>
TS
leafletOptions: L.MapOptions = {
zoom: 6,
maxZoom: 19,
zoomControl: false,
center: L.latLng(40.4166395, -3.7046087)
};
baseLayers: { [layerName: string]: L.Layer } = {
'OSM': this.mapService.baseMaps.OSM,
'Catastro': this.mapService.baseMaps.Catastro
};
我该怎么做才能使地图不显示允许我更改基础图层的框?提前致谢。
编辑:我可以用 CSS 样式来做,但如果有更好的方法,我更喜欢它