map组件无法显示marker?
代码如下:
import React, { useState } from 'react'
function Main() {
console.log(window.$$global.latitude)
console.log(window.$$global.longitude)
const [markers, setMarkers] = useState([
{
id: 0,
latitude: window.$$global.latitude,
longitude: window.$$global.longitude,
width: '50px',
height: '50px',
// zIndex: 10,
// iconPath: './[email protected]'
iconPath: 'https://i.loli.net/2020/04/24/kLTiDMEtgl9ySnX.png'
}
])
return (
<wx-map
latitude={window.$$global.latitude}
longitude={window.$$global.longitude}
layer-style='1'
style={{
width: '100vw',
height: '100vh'
}}
markers={markers}
></wx-map>
)
}
export default Main
经纬度没问题,可显示不出来