//解决icon图标不能显示问题
const getImageUrl = () => {
return new URL(`../assets/car-icon.png`, import.meta.url).href
}
const carMarker = new Feature({
name: 'Null Island',
population: 4000,
rainfall: 500,
geometry: new Point([113.0718384697969, 27.715201828109382])
})
const iconStyle = new Style({
image: new Icon({
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
width: 50,
src: getImageUrl()
})
})
vue3 openLayer添加图标不能显示问题
于 2024-08-29 17:11:32 首次发布