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

80
Views
Dynamicaly change leafletjs tilelayer

How can i load new images for TileLayer after changing date in request?

or

How I can update already created TileLayers with new date option?

I have TileLayers from OpenWeatherMap requests is generated with this code

openweathermap_overlay = new L.TileLayer(
    "http://maps.openweathermap.org/maps/2.0/weather/{op}/{z}/{x}/{y}?appid={API_key}",
   {
      API_key: key,
      date: date,
      op: op_key
   })

In my mind it must be something like here: https://openweathermap.org/weathermap?basemap=map&cities=false&layer=radar&lat=56.9510&lon=24.1064&zoom=5

While you drag date you can see that tiles changing Of course i have tried something like this:

date: getDate(),

And this doesn't work.

Great Thanks for every advice.

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

0

Ok It was so easy.

var url = "http://maps.openweathermap.org/maps/2.0/weather/{op}/{z}/{x}/{y}?appid={API_key}&opacity={opacity}&date="
openweathermap_overlay = new L.TileLayer(
   url+date,
   {
      API_key: key,
      op: op_key
   })
openweathermap_overlay.setUrl(url+new_date)
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!