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

84
Views
Cambiar dinámicamente la capa de mosaico de leafletjs

¿Cómo puedo cargar nuevas imágenes para TileLayer después de cambiar la fecha en la solicitud?

o

¿Cómo puedo actualizar TileLayers ya creados con una nueva opción de fecha?

Tengo solicitudes de TileLayers de OpenWeatherMap generadas con este código

 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 })

En mi opinión, debe ser algo como aquí: https://openweathermap.org/weathermap?basemap=map&cities=false&layer=radar&lat=56.9510&lon=24.1064&zoom=5

Mientras arrastra la fecha, puede ver que los mosaicos cambian. Por supuesto, he intentado algo como esto:

 date: getDate(),

Y esto no funciona.

Genial Gracias por cada consejo.

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

0

Bien, fue tan fácil.

 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!