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

146
Views
leafletjs setOpacity method transition?

Im trying to find a way to switch between map layers with transition.

Currently Im using the setOpacity method to switch between map layers which has helped to avoid the flickering that addLayer and removeLayer methods create. However I would like to be able to add some transition to ease the switch.

Was wondering if there is a way to do this? Thank you!

Update: I found a way to do so by adding a CSS class.

map2010.getContainer().className += `mapTransition`
map2022.getContainer().className += `mapTransition`

.mapTransition{
transition: opacity 0.7s ease;
}

Got the answer from here: https://gis.stackexchange.com/questions/195271/how-to-add-custom-css-class-to-leaflet-tilelayer

about 4 years ago · Juan Pablo Isaza
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!