Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

83
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda