forked from cemaden-educacao/WPD-MobileApp
analuizaff
3 years ago
6 changed files with 76 additions and 23 deletions
-
3src/App.js
-
4src/app/components/map/LeafLetMap.js
-
3src/app/components/map/Map.html
-
6src/app/components/map/OpenStreetMap.js
-
19src/app/context/MapRefContext.js
-
34src/app/screens/MapFormScreen.js
@ -0,0 +1,19 @@ |
|||
import React, { useState, createContext, useContext, useEffect } from "react" |
|||
|
|||
export const MapRefContext = createContext(); |
|||
|
|||
const MapRefProvider = ({ children }) => { |
|||
|
|||
//problema: as vzs renderiza antes de carregar a localização correta do usuário
|
|||
const [mapRef, setMapRef] = useState(); |
|||
|
|||
return ( |
|||
<MapRefContext.Provider value={{ |
|||
mapRef, |
|||
setMapRef, |
|||
}}> |
|||
{children} |
|||
</MapRefContext.Provider> |
|||
) |
|||
} |
|||
export default MapRefProvider; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue