我需要向我的 Pin 图添加自定义图像,但 Pin 元素不排除图像。 我还需要能够根据某些标准在图像之间切换,因此我会得到混合的 pin 图像。
尝试过这个:
`
<Image src="/pin-icon.png" alt="Pin Icon" layout="fill" objectFit="contain"/>
</Pin>
`
但什么也没得到。 如果有人可以帮我找到解决方案。
这里的问题看起来像是您正在尝试使用 Pin comp 中不直接支持的组件。相反,请尝试使用 HTML img 标签或任何其他支持的方法
尝试使用这样的东西
<Pin background={'#FBBC04'} glyphColor={'#575'} borderColor={'#000'}>
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
<img
src="/pin-icon.png"
alt="Pin Icon"
style={{
width: '100%',
height: '100%',
objectFit: 'contain',
}}
/>
</div>
</Pin>