Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

81
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda