Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

358
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!