Css 不显示L.divIcon传单的自定义字体

Css 不显示L.divIcon传单的自定义字体,css,fonts,leaflet,Css,Fonts,Leaflet,使用icomoon互联网服务创建自定义图标字体,在传单地图上显示这些字体时遇到困难。不知怎的,我找不到图标,我错过了什么!?我有地图上的数据,因为我可以打开弹出窗口,问题是没有图标可见 我把字体文件夹放在正确的位置,样式表已经加载 这是icomoon的CSS的一部分,我在一个custom-style.CSS中使用了它 @font-face { font-family: 'icomoon'; src: url('myplace/customer/fonts/icomoon.eot?bf4cat'

使用icomoon互联网服务创建自定义图标字体,在传单地图上显示这些字体时遇到困难。不知怎的,我找不到图标,我错过了什么!?我有地图上的数据,因为我可以打开弹出窗口,问题是没有图标可见

我把字体文件夹放在正确的位置,样式表已经加载 这是icomoon的CSS的一部分,我在一个custom-style.CSS中使用了它

@font-face {
font-family: 'icomoon';
src:  url('myplace/customer/fonts/icomoon.eot?bf4cat');
src:  url('myplace/customer/fonts/icomoon.eot?bf4cat#iefix') format('embedded-opentype'),
url('myplace/customer/fonts/icomoon.ttf?bf4cat') format('truetype'),
url('myplace/customer/fonts/icomoon.woff?bf4cat') format('woff'),
url('myplace/customer/fonts/icomoon.svg?bf4cat#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}

[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-bb .path1:before {
  content: "\e900";
  color: rgb(35, 31, 32);
}
.icon-bb .path2:before {
  content: "\e901";
  margin-left: -1em;
  color: rgb(0, 0, 0);
}
.icon-bb .path3:before {
  content: "\e902";
  margin-left: -1em;
  color: rgb(0, 0, 0);
} etc....
然后我创建了一个函数来查找客户名称并给他们一个类名

function getCustomer(x){
        x === 'customerBB'          ? 'icon- icon-bb' :
        x === 'customerCA'          ? 'icon- icon-ca' :
        x === 'customerCE'          ? 'icon- icon-ce' :
                                      'leaflet-div-icon'; //default blue icon if no match
然后使用函数根据feature.properties.customer\u name中的结果返回className

    var setDivIcon = function(feature){
      return {
        className: getCustomer(feature.properties.customer_name)
      };        
    }

   var customerIcon = L.divIcon(setDivIcon);
稍后,我使用pointToLayer将GeoJSON添加到地图中

    customerLayer = L.geoJson(json, {

    pointToLayer: function(feature, latlng) {
    var time = feature.properties.timeMean_numb;
    var point
       
      if (time < 0.167){
        point = L.marker(latlng, {icon: L.divIcon(setDivIcon(feature)) }).addTo(time_1);
      }
       else if (time >= 0.167 && time <= 0.334){
        point = L.marker(latlng, {icon: L.divIcon(setDivIcon(feature)) }).addTo(time_2);
      }
customerLayer=L.geoJson(json{
pointToLayer:功能(特性、latlng){
变量时间=feature.properties.timeMean\u numb;
var点
如果(时间<0.167){
point=L.marker(latlng,{icon:L.divIcon(setDivIcon(feature))}).addTo(time_1);
}

否则如果(time>=0.167&&time在您的fontface规则中,您缺少一些src:?这可以解释它们没有被提取的原因

没有区别,仍然是相同的问题查找您的中的错误,并特别检查浏览器开发工具的网络部分是否请求了
myplace/customer/fonts/icomon.eot
文件。您是否能够ve图标显示在普通的
、外部传单中?鉴于您的CSS示例,我希望需要类path1/2/3。然后在传单DivIcon的上下文中,您可能需要将这些类名应用于DivIcon的子元素,而不是直接应用于DivIcon本身。至于DivIcon内容,请参阅con中的无错误sole,我现在确实得到了一个传单默认的蓝色圆圈。当在devtools中使用元素选择器时,我有以下内容:
code
code
我想我必须深入研究icomoon文档“如何”@IvanSanchez确实查看了网络部分,不幸的是,看不到任何关于icomoon.eot的信息。也许我需要一种不同的方法来解决这个问题。。。