http = 'https://maps.googleapis.com/maps/api/geocode/json?address='
                  
                  
                      let requestOptions = {
                  
                  
                          method: 'GET',
                  
                  
                          redirect: 'follow'
                  
                  
                      };
                  
                  
                  
                  
                  
                    try {
                  
                  
                      const response = await fetch(`${http}${address}&key=${credentials.mapKey}`, requestOptions)
                  
                  
                      const text = await response.text();
                  
                  
                      return text;
                  
                  
                    } catch(error) {
                  
                  
                      throw error;
                  
                  
                    }
                  
                  
                  }
                  
                  
                  
                  
                  
                  async function exec() {
                  
                  
                    const text = await addressFunctionJson("address");
                  
                  
                  }
                  
                  
                
спасибо, мужик! 👍
работает. спасибо учту
Обсуждают сегодня