[英]React Props not populated
嘗試學習 React 並遵循本教程: https://youtu.be/GDa8kZLNhJ4?t=3547 那里有一個 App.js 組件,它使 Travel Advisor API 調用填充數據 object: 以下道具傳遞給 Map 組件: 在 Map 組件中,它被傳遞給 GoogleMap ...
[英]React Props not populated
嘗試學習 React 並遵循本教程: https://youtu.be/GDa8kZLNhJ4?t=3547 那里有一個 App.js 組件,它使 Travel Advisor API 調用填充數據 object: 以下道具傳遞給 Map 組件: 在 Map 組件中,它被傳遞給 GoogleMap ...
[英]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 來顯示有關點擊律師的點擊 ...
[英]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 callback updating 'this' to update child props not working
我一直在遇到這個線程中提到的問題,當使用 ref 回調時,refs 在componentDidMount之后更新。 顯然,當您將 refs 傳遞給作為子項傳遞給組件的元素時,可能會發生這種情況,但我認為我已經用盡了所有其他選項。 我無法將它直接傳遞給組件( ComponentOne ),因為它是一個 ...
[英]Use google-map-react fitbounds useRef -> mapRef.current.fitBounds is not a function
賞金將在 7 天后到期。 此問題的答案有資格獲得+50聲望賞金。 Lucas Bodin想引起更多人對這個問題的關 ...
[英]How to draw Polyline with google-map-react?
每個人我都在使用 google-map-react 而不是 react-google-map。 你能幫我在兩點之間畫一條線嗎? ...
[英]GoogleMapReact : Next.js: TypeError: Cannot read properties of undefined (reading 'getChildren')
我正在使用 google-map-react 組件和 nextjs 開發一個基本的 nextjs 應用程序。 每次嘗試使用該組件時都會出現以下錯誤 TypeError:無法訪問屬性“getChildren”,n.props.dispatcher 未定義不知道該怎么辦..這似乎是我當前的 react ...
[英]google-map-react not loading- Uncaught TypeError: Cannot read properties of undefined (reading 'getChildren')
我一直在嘗試解決它一段時間。 我正在嘗試運行 google-map-react 的簡單示例。 但是,這不會加載地圖。 而是給出以下錯誤並且頁面為空白。 ...
[英]How to use google-map-react with Next.js?
我不確定我做錯了什么。 我正在嘗試在我的 Next.js 應用程序中使用google-map-react 。 我幾乎逐字復制了他們的 npm 頁面上的示例。 這是代碼:import React from "react"; import GoogleMapReact from "google-map ...
[英]Google map react
{?loading, ( <GoogleMapReact defaultZoom={isEqual(latLong? USLatLong): 4. 18} defaultCenter={latLong.lat && latLong?lng: latLong: USLatLon ...
[英]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 dynamic value not support?
我正在構建下一個 js 應用程序。 在這里,我面臨一個問題。 我有一個像這樣后端的 api- 這是我的組件- 這里的中心價值- 當我對 lat 和 lng 進行硬編碼時,地圖顯示完美。 但我想從后端信息中顯示中心緯度和 lng,例如- 然后它不顯示地圖。 它只顯示像圖像一樣的白屏 ...
[英]Is there a way to get the coordinates from this draggable marker using google-map-react?
我已經制作了標記,因此它可以在 map 上拖動。不過我正在嘗試從標記中獲取坐標,以便將它們保存到我的數據庫中。 下面是代碼,是否有一個 function,我可以從拖動標記時獲取坐標。 或者我應該使用另一個谷歌地圖反應庫。 ...
[英]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 not working in browser on iPhone/Android
我正在嘗試在 map 上安裝我的 position,它在我的 Google Chrome 計算機上運行良好,但是當模擬到 android/iPhone 時,例如在 iPhone 模擬器上使用自定義位置時沒有任何反應。 在我的實際 iPhone 上也嘗試過,但沒有任何運氣。 我能找到的所有在模擬器/真 ...
[英]google-map-react marker onclick not working
為了清楚起見,我正在使用 react-google-map https://www.npmjs.com/package/google-map-react 我清楚地遵循了文檔,並且能夠使其正常工作。 這是我的代碼。 由於某些原因。 標記 onClick 不會觸發。 所以當我點擊標記時。 什么都沒發生。 ...
[英]Disable bubbles on embedded google maps
知道如何在我的嵌入式谷歌 map 上禁用這些氣泡嗎? 我正在使用 react-google-map 將其嵌入到 react/typescript 應用程序中 這是我的代碼: ...
[英]Marker components not showing on Google Maps in React JS
我對 React JS 比較陌生。 但是,我似乎無法弄清楚為什么我的 GoogleMap 組件上沒有顯示標記。 “tasks”是我從數據庫中獲取的一個數組,它包含一個數組“userTrackers”。 我在這段代碼中使用的 console.log 命令會寫出我所期望的所有內容(不要擔心經度處的拼寫 ...
[英]How to display shared link in google map react
我正在使用react-google-maps ,我能夠根據lan和lat顯示位置,但我找不到任何使用共享鏈接顯示位置的方法,例如https://goo.gl/maps/YBuwmbwH21yUE19Z9 我想在谷歌 map 中顯示這個鏈接這是我的代碼: 請幫助我,謝謝 ...