File tree 1 file changed +16
-14
lines changed
src/components/Main/traffic
1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ const LocationAggregatorMap = ({ off, useExistToken }) => {
67
67
68
68
if ( ENVConfig ) {
69
69
// 取得MapBox金鑰
70
- var mapbox_api_key = ENVConfig . mapbox . token ;
70
+ var mapbox_api_key = ENVConfig . mapbox . token
71
71
var mapbox_style = ENVConfig . mapbox . style ;
72
72
73
73
// 取得 Polstar北宸科技地圖服務 API 金鑰
@@ -606,19 +606,21 @@ const LocationAggregatorMap = ({ off, useExistToken }) => {
606
606
touchAction = 'unset'
607
607
>
608
608
{ /* 以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
+ }
622
624
</ DeckGL >
623
625
{ /* 搜尋輸入框 */ }
624
626
< 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' >
You can’t perform that action at this time.
0 commit comments