cost 213 ms
未填充 React Props

[英]React Props not populated

嘗試學習 React 並遵循本教程: https://youtu.be/GDa8kZLNhJ4?t=3547 那里有一個 App.js 組件,它使 Travel Advisor API 調用填充數據 object: 以下道具傳遞給 Map 組件: 在 Map 組件中,它被傳遞給 GoogleMap ...

如何在反應 class 組件中設置另一個 state 以將數據從初始 state 傳遞到

[英]How can I set another state to pass data to from the initial state in a react class component

誰能幫我解釋一下如何在這個組件中設置另一個 state: 基本上我想設置另一個 state 像: 然后使用 setter setSelectedAtt 來獲取 onclick function 上的律師數據,如下所示: 然后從那里我將使用 state selectedAtt 來顯示有關點擊律師的點擊 ...

'google-map-react' 中的標記如何根據道具的緯度和經度獲取其位置?

[英]How does a marker in 'google-map-react' get its location based on latitude and longitude from props?

根據https://www.npmjs.com/package/google-map-react ,map 上的標記從經度和緯度道具中獲取其在 map 上的位置。 在這種情況下, AnyReactComponent是 map 上的標記。 但是,基於 SimpleMap 組件上面定義的組件,它不會將 ...

React ref 回調更新“this”以更新子道具不起作用

[英]React ref callback updating 'this' to update child props not working

我一直在遇到這個線程中提到的問題,當使用 ref 回調時,refs 在componentDidMount之后更新。 顯然,當您將 refs 傳遞給作為子項傳遞給組件的元素時,可能會發生這種情況,但我認為我已經用盡了所有其他選項。 我無法將它直接傳遞給組件( ComponentOne ),因為它是一個 ...

GoogleMapReact:Next.js:TypeError:無法讀取未定義的屬性(讀取“getChildren”)

[英]GoogleMapReact : Next.js: TypeError: Cannot read properties of undefined (reading 'getChildren')

我正在使用 google-map-react 組件和 nextjs 開發一個基本的 nextjs 應用程序。 每次嘗試使用該組件時都會出現以下錯誤 TypeError:無法訪問屬性“getChildren”,n.props.dispatcher 未定義不知道該怎么辦..這似乎是我當前的 react ...

如何通過點擊事件指向 map 上的某個位置

[英]How do I point to a location on map with a click event

在 React 中,我正在嘗試使用 google-map-react 庫將 onClick 事件指向 map 上的標記到新位置。 我的 map 正在顯示,我在 map 上有一個按鈕,但我不確定如何在 map 上做一個標記指向我擁有的新坐標。 google-map-react 上的文檔不是很有幫助。 ...

谷歌地圖在默認中心值中反應問題?

[英]Google map in react problem in default center value?

我正在構建下一個 js 應用程序。 在這里,我面臨一個問題。 我有一個這樣的后端 api(在 getServerSideProps 的服務器端獲取的 api) 我正在構建下一個 js 應用程序。 在這里,我面臨一個問題。 我有一個像這樣后端的 api- "房間": [ { "id": "61 ...

Google Map React Defaultcenter 動態值不支持?

[英]Google Map React Defaultcenter dynamic value not support?

我正在構建下一個 js 應用程序。 在這里,我面臨一個問題。 我有一個像這樣后端的 api- 這是我的組件- 這里的中心價值- 當我對 lat 和 lng 進行硬編碼時,地圖顯示完美。 但我想從后端信息中顯示中心緯度和 lng,例如- 然后它不顯示地圖。 它只顯示像圖像一樣的白屏 ...

有沒有辦法使用 google-map-react 從這個可拖動標記獲取坐標?

[英]Is there a way to get the coordinates from this draggable marker using google-map-react?

我已經制作了標記,因此它可以在 map 上拖動。不過我正在嘗試從標記中獲取坐標,以便將它們保存到我的數據庫中。 下面是代碼,是否有一個 function,我可以從拖動標記時獲取坐標。 或者我應該使用另一個谷歌地圖反應庫。 ...

如何在反應 js 中使用谷歌地圖方向 api 添加自定義標記

[英]How to add custom markers using google maps directions api in react js

技術棧- Google Map 方向 Api、React JS 等。 問題陳述- 使用谷歌地圖方向 Api 我正在繪制 3 個引腳,即起點、航點和目的地。 我能夠 plot 所有這些,但無法為每一個添加自定義標記。 任何幫助/建議將不勝感激:- 代碼片段: - 謝謝 ...

React.js geo position 在 iPhone/Android 的瀏覽器中不起作用

[英]React.js geo position not working in browser on iPhone/Android

我正在嘗試在 map 上安裝我的 position,它在我的 Google Chrome 計算機上運行良好,但是當模擬到 android/iPhone 時,例如在 iPhone 模擬器上使用自定義位置時沒有任何反應。 在我的實際 iPhone 上也嘗試過,但沒有任何運氣。 我能找到的所有在模擬器/真 ...

谷歌地圖反應標記 onclick 不工作

[英]google-map-react marker onclick not working

為了清楚起見,我正在使用 react-google-map https://www.npmjs.com/package/google-map-react 我清楚地遵循了文檔,並且能夠使其正常工作。 這是我的代碼。 由於某些原因。 標記 onClick 不會觸發。 所以當我點擊標記時。 什么都沒發生。 ...

標記組件未在 React JS 中的 Google 地圖上顯示

[英]Marker components not showing on Google Maps in React JS

我對 React JS 比較陌生。 但是,我似乎無法弄清楚為什么我的 GoogleMap 組件上沒有顯示標記。 “tasks”是我從數據庫中獲取的一個數組,它包含一個數組“userTrackers”。 我在這段代碼中使用的 console.log 命令會寫出我所期望的所有內容(不要擔心經度處的拼寫 ...

如何在谷歌 map 中顯示共享鏈接

[英]How to display shared link in google map react

我正在使用react-google-maps ,我能夠根據lan和lat顯示位置,但我找不到任何使用共享鏈接顯示位置的方法,例如https://goo.gl/maps/YBuwmbwH21yUE19Z9 我想在谷歌 map 中顯示這個鏈接這是我的代碼: 請幫助我,謝謝 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM