[英]Fontawsome as a custom marker for the react-google-maps/api component?
[英]How to add custom ico or SVG as marker icon in @react-google-maps/api
我正在使用@react-google-maps/api在我的 React Web 應用程序中顯示 Google Map。 根據他們的文檔,我添加了如下標記。
<Marker onLoad={onLoad} position={location} icon={{ // path: google.maps.SymbolPath.CIRCLE, url:'./../../assets/svg/location_marker.svg', scale: 7, }} />
但它似乎不起作用。 沒有顯示任何標記。 使用google.maps.SymbolPath.CIRCLE
作為path
將顯示標記圖標。 以前有人遇到過這個問題嗎? 有任何想法嗎?
添加了要求並解決了問題。
<Marker
onLoad={onLoad}
position={deliveryDestination}
icon={{
// path: google.maps.SymbolPath.CIRCLE,
url: (require('./../../assets/svg/location_marker.ico')),
fillColor: '#EB00FF',
scale: 7,
}}
/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.