Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8021 | Rev 10120 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 8021 Rev 9779
Línea 25... Línea 25...
25
function SearchLocationInput({ googleApiKey, setValue, value, updateData }) {
25
function SearchLocationInput({ googleApiKey, setValue, value, updateData }) {
Línea 26... Línea 26...
26
 
26
 
27
    const autoCompleteRef = useRef(null);
27
    const autoCompleteRef = useRef(null);
Línea 28... Línea 28...
28
    const [data, setData] = useState({})
28
    const [data, setData] = useState({})
29
 
29
 
30
    function handleScriptLoad(updateQuery, autoCompleteRef, setData) {
30
    function handleScriptLoad(updateQuery, autoCompleteRef) {
31
        autoComplete = new window.google.maps.places.Autocomplete(
31
        autoComplete = new window.google.maps.places.Autocomplete(
32
            autoCompleteRef.current,
32
            autoCompleteRef.current,
33
            { types: ["(cities)"] }
33
            { types: ["(cities)"] }
Línea 88... Línea 88...
88
 
88
 
89
 
89
 
90
    useEffect(() => {
90
    useEffect(() => {
91
        loadScript(
91
        loadScript(
92
            `https://maps.googleapis.com/maps/api/js?key=${googleApiKey}&libraries=places`,
92
            `https://maps.googleapis.com/maps/api/js?key=${googleApiKey}&libraries=places`,
93
            () => handleScriptLoad(setValue, autoCompleteRef, setData)
93
            () => handleScriptLoad(setValue, autoCompleteRef)
Línea 94... Línea 94...
94
        );
94
        );
95
    }, []);
95
    }, []);