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

136
Views
Issues displaying OpenWeatherMap with leaflet

I am practicing on a simple weather app using OWM. I am fetching the coordinates and pass them to a function to display a map using leaflet.

Here is my code

function drawMap(lat,lon){

    const mymap = L.map('map').setView([lat, lon],3);

    L.tileLayer(`https://tile.openweathermap.org/map/temp_new/3/1/1.png?appid=${apiKey}`).addTo(mymap);

}

My issues are :

-Zoom level is required by leaflet but it's also in the openweather URL so i don't know if i need to put the same or not -in the url, i'm supposed to put x and y tile coordinates , I don't really understand the required X and Y values and the OWM API doc doesn't really elaborate on those.

Right now , using the values 3/6/1 for example, i get Result

The zoom is just the same tiles over and over and you can't make out anything so obviously I'm doing something wrong

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I don't really understand what you are describing but normaly you would set template strings in the Tile-Url that can are replaced by leaflet:

L.tileLayer(`https://tile.openweathermap.org/map/temp_new/{z}/{x}/{y}.png?appid=${apiKey}`).addTo(mymap);
about 4 years ago · Juan Pablo Isaza Report
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!