Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
Error downloading openstreetmap tile on react-native

I'm making a react-native application and I need to allow to use the map without internet. For this I download the tiles on the mobile with react-native-fs. I don't understand the following error:

[Error: Unable to resolve host "tile.openstreetmap.org": No address associated with hostname]

On postman I have to put a Host field in the header but in the doc I don't have this field indicated : https://operations.osmfoundation.org/policies/tiles/

postman request

request:

    RNFS.downloadFile({
      fromUrl: link,
      toFile:
        dir +
        '/' +
        splitLink[splitLink.length - 3] +
        '/' +
        splitLink[splitLink.length - 2] +
        '/' +
        splitLink[splitLink.length - 1],
      headers: {
        'User-Agent': 'android',
      },
    })
      .promise.then(response => {
        console.log('response', response);
        if (response.statusCode === 200) {
          return console.log('FILES UPLOADED!', response);
        } else {
          console.log('SERVER ERROR');
        }
      })
      .catch(err => {
        console.log('err', err);
      });

I think it's the Host field that's missing in my request but I can't find what value to put.

Thanks for your help :)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda