Skip to content

Commit b46932f

Browse files
committed
Debug
1 parent 44d5d14 commit b46932f

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/components/Main/traffic/map.jsx

+16-14
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const LocationAggregatorMap = ({ off, useExistToken }) => {
6767

6868
if (ENVConfig) {
6969
// 取得MapBox金鑰
70-
var mapbox_api_key = ENVConfig.mapbox.token;
70+
var mapbox_api_key = ENVConfig.mapbox.token
7171
var mapbox_style = ENVConfig.mapbox.style;
7272

7373
// 取得 Polstar北宸科技地圖服務 API 金鑰
@@ -606,19 +606,21 @@ const LocationAggregatorMap = ({ off, useExistToken }) => {
606606
touchAction='unset'
607607
>
608608
{/* 以MapBox地圖為基底 */}
609-
<Map
610-
className=""
611-
controller={true}
612-
mapboxAccessToken={mapbox_api_key}
613-
mapStyle={mapbox_style}
614-
onRender={(event) => event.target.resize()}
615-
>
616-
<Marker
617-
longitude={location ? location.longitude : initialViewState.longitude}
618-
latitude={location ? location.latitude : initialViewState.latitude}
619-
color="red"
620-
/>
621-
</Map>
609+
{
610+
mapbox_api_key && (<Map
611+
className=""
612+
controller={true}
613+
mapboxAccessToken={mapbox_api_key}
614+
mapStyle={mapbox_style}
615+
onRender={(event) => event.target.resize()}
616+
>
617+
<Marker
618+
longitude={location ? location.longitude : initialViewState.longitude}
619+
latitude={location ? location.latitude : initialViewState.latitude}
620+
color="red"
621+
/>
622+
</Map>)
623+
}
622624
</DeckGL>
623625
{/* 搜尋輸入框 */}
624626
<div className='fixed right-2 mt-2 flex flex-col md:flex-row flex-wrap md:flex-nowrap flex-auto justify-end items-end md:items-center w-auto sm:max-w-lg md:max-w-md lg:max-w-md'>

0 commit comments

Comments
 (0)