我跟隨下面的你管教程,并試圖學習地圖框。我導入了github項目并使用了令牌,但仍然沒有顯示地圖。你能讓我知道如何修理它嗎?提供以下堆棧利茲
https://www.youtube.com/watch? v = jjatzkpmoi
https://stackblitz.com/edit/github-h2sep1?文件=.env.local,src%2FApp.js
<ReactMapGL
{...viewport}
mapboxApiAccessToken={process.env.REACT_APP_MAPBOX_TOKEN}
mapStyle="mapbox://styles/leighhalliday/cjufmjn1r2kic1fl9wxg7u1l4"
onViewportChange={viewport => {
setViewport(viewport);
}}
>
{parkDate.features.map(park => (
<Marker
key={park.properties.PARK_ID}
latitude={park.geometry.coordinates[1]}
longitude={park.geometry.coordinates[0]}
>
<button
className="marker-btn"
onClick={e => {
e.preventDefault();
setSelectedPark(park);
}}
>
<img src="/skateboarding.svg" alt="Skate Park Icon" />
</button>
</Marker>
))}
REACT _ APP _ MAPBOX _ TOKEN = & quotPK . eyj 1 ijoicmfqa 3 vtyxj 0 mdgilchijoiy 2 xpzmuybjfxmtrkyjntbzvxyw 11 azhmbij 9 . u 2 yjyzcyxi 87d 0 cf w0 KD 5 q & quot;
上一篇es6 引入json
下一篇python 自動化游戲