Я использую Angular 6 и Leaflet. Я не понимаю, почему не могу определить свой css в моем компоненте ... Это мой код:
HTML
<div class = "custom-popup" id = "frugalmap">
CSS
.custom-popup .leaflet-popup-content-wrapper {
background:#2c3e50;
color:#fff;
font-size:160px;
line-height:24px;
border-radius: 0px;
}
.custom-popup .leaflet-popup-content-wrapper a {
color:rgba(255,255,255,0.1);
}
.custom-popup .leaflet-popup-tip-container {
width:30px;
height:15px;
}
.custom-popup .leaflet-popup-tip {
background: transparent;
border: none;
box-shadow: none;
}
TS
var customPopup = "<h4>CHU Nantes</h4>"
var customOptions = {'className' : 'custom' }
var CHUNantes= L.marker([47.21082, -1.55446], {icon: myIcon}).bindPopup(customPopup,customOptions).on('mouseover', function (e) { this.openPopup();});
мой css не работает, понимаете почему?



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Вам необходимо определить пользовательский маркер следующим образом и поместите CSS в global styles.css:
const myIcon = L.icon({
// place your icon url
iconUrl: 'https://unpkg.com/[email protected]/dist/images/marker-icon.png',
iconSize: [32, 37],
iconAnchor: [16, 37],
popupAnchor: [0, -28]
});
const customPopup = "<h4>CHU Nantes</h4>"
const customOptions = {'className' : 'custom-popup' }
const nantes= L.marker([47.21082, -1.55446], {icon: myIcon}).addTo(map);
nantes.bindPopup(customPopup,customOptions)
.on('mouseover', function (e) { this.openPopup()});
Что вы имеете в виду, что не можете определить свой CSS в компоненте? Вы можете использовать styleUrls