字体编辑标记集

问题描述 投票:2回答:1

是否可以在传单标记群集上仅编辑字体及其大小?没有改变主图标?

在那种情况下,我将不得不放线?

var clusterGroup = L.markerClusterGroup();
{

function estiloIcon(feature, latlng) {
    return L.marker(latlng, {
        icon: myIcon
    })
};
var geojsonLayer = new L.geoJson(geo, {
    pointToLayer: estiloIcon

})

clusterGroup.addLayer(geojsonLayer); 
}
map.addLayer(clusterGroup);
}
leaflet markerclusterer leaflet.markercluster
1个回答
0
投票

所以我已经在“MasterCluster.Default.css”的档案中找到了答案。在文件的底部有修改字体的行

    @font-face {
    font-family: 'freesans'; /*a name to be used later*/
    src: url('./freesansbold.ttf'); /*URL to font*/
}
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
    }
.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;

    text-align: center;
    border-radius: 15px;
    font: 16px "freesans", Arial, Helvetica, sans-serif;
    text-shadow: 1px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1px 1px #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
    }

这是编辑的行

© www.soinside.com 2019 - 2024. All rights reserved.