第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Google Maps React 卡在“正在加載地圖...”

Google Maps React 卡在“正在加載地圖...”

富國滬深 2022-01-07 14:07:24
我創(chuàng)建了一個名為 MapContainer 的組件,我的 MapContainer.js 如下所示:import { Map, GoogleApiWrapper } from 'google-maps-react';import React from 'react';import '../css/MapContainer.css';const MapContainer = ({ t }) => (    <Map class="location_map"    google={t.google}    zoom={8}    initialCenter={{ lat: 47.444, lng: -122.176}}/>)export default GoogleApiWrapper({    apiKey: '...'})(MapContainer);然后我將此組件導(dǎo)入另一個名為 Details.js 的 .js。文件很長,所以我只放了與 MapContainer 相關(guān)的部分。import MapContainer from '../components/MapContainer';...然后在渲染部分:            <div class="polaroid_des">                <div class="container-list">                    <p class="polaroid_title">{t('details.location')}</p>                    <MapContainer t={t} />                </div>            </div>  我最終將其導(dǎo)出為:export default withTranslation()(Details);事實(shí)證明,當(dāng)我運(yùn)行我的網(wǎng)站時,我只會得到“正在加載地圖...”。發(fā)生了什么?
查看完整描述

2 回答

?
喵喵時光機(jī)

TA貢獻(xiàn)1846條經(jīng)驗(yàn) 獲得超7個贊

2天前有同樣的問題。該庫已過時,不再維護(hù)。我建議你google-map-react改用。我發(fā)現(xiàn)那個庫更可靠。

Github:https : //github.com/google-map-react/google-map-react

NPM:https : //www.npmjs.com/package/google-map-react


查看完整回答
反對 回復(fù) 2022-01-07
?
神不在的星期二

TA貢獻(xiàn)1963條經(jīng)驗(yàn) 獲得超6個贊

根據(jù)文檔,google必須從裝飾的組件道具中獲取實(shí)例。


import { Map, GoogleApiWrapper } from 'google-maps-react';

import React from 'react';

import '../css/MapContainer.css';


const MapContainer = ({ t, google }) => (

    <Map class="location_map"

    google={google}

    zoom={8}

    initialCenter={{ lat: 47.444, lng: -122.176}}/>

)


export default GoogleApiWrapper({

    apiKey: '...'

})(MapContainer);


查看完整回答
反對 回復(fù) 2022-01-07
  • 2 回答
  • 0 關(guān)注
  • 553 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號