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

368
Visualizações
Hello Why am I getting InvalidArgumentError: H.Map (Argument #0 [object Object])

I get this error when I try to display the data.I would like to retrieve and display the stations around me.here is my code.I get this as an error nvalidArgumentError: H.map.AbstractMarker#setGeometry (Argument #0 [object Object])

const requestStations=()=>{
    
   var center=JSON.parse(localStorage.getItem('center'));  
   
   var url = `https://browse.search.hereapi.com/v1/browse?apiKey=f-jhHQAK5b0Fykw9GhBPn2XIhyLUq9INnxN5Er0aY28&at=${center.coordinates[1]},${center.coordinates[0]}&limit=5&categories=400-4100-0035`;

   return new Promise((resolve, reject) => {fetch(url, {
         method: 'get',
      }).then((response) =>
         response.json().then((response) => {

            let markerGroup = new H.map.Group();
            let markers=[];
            alert(response.items[0].title);
            console.log(response.items[1].title);
            response.items.forEach((station) => {
               let marker = new H.map.Marker({lat:station.access.lat,lng:station.access.lng});
               markerGroup.addObject(marker);
               //alert(JSON.stringify({lat:station.coord.lat,lng:station.coord.lon}));
               markers.push(marker);
            });
            
            map.addObject(markerGroup);
            map.getViewModel().setLookAtData({
               bounds: markerGroup.getBoundingBox()
            });
            resolve(markers)

         })).catch(error=>{
            alert(error);
            reject(error);
            console.log(error);}
         
      )});
      
  }
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