我正在将一个 Web 应用程序从 Mapbox.js 重写为 Mapbox GL js。使用标准的“mapbox://styles/mapbox/streets-v8”样式,我在哪里可以找到所有工作标记图标的列表?
这是我的代码:
m.map.addSource("markers", {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": ["-75.532965", "35.248018"]
},
"properties": {
"title": "Start",
"marker-symbol": "entrance",
"marker-size": "small",
"marker-color": "#D90008"
}
}
}
});
m.map.addLayer({
"id": "markers",
"type": "symbol",
"source": "markers",
"layout": {
"icon-image": "{marker-symbol}-15", //but monument-15 works
"text-field": "{title}",
"text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"],
"text-offset": [0, -1.6],
"text-anchor": "top"
}
});
我读到所有 Maki 图标都应该可用于默认没有图标的样式: https ://github.com/mapbox/mapbox-gl-styles/issues/241 但它们中的大多数都不起作用。尺寸也有问题 - 对于 Maki 来说,它们是 -small、-medium 和 -large,现在我看到 -11 和 -15。
我只需要使用一些基本的标记图标。