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

165
Views
Do not refresh Mapbox tile source until map is idle

I am using Mapbox GL API V2.

I am loading 3rd party tiles like this:

    map.addSource('test', {
        'type': 'vector',
        "tiles": [
            "http://mytileserver/tiles/test/{z}/{x}/{y}"
        ]
    });

This works nicely - except as the user pans / drags the map the tiles are being loaded constantly. So much so that the tile server is having trouble keeping up.

I have added the following events to Mapbox:

map.on('movestart', () => {
    map.setLayoutProperty('test', 'visibility', 'none');
});

map.on('moveend', () => {
    map.setLayoutProperty('test', 'visibility', 'visible');
});

This works really well as it prevents the tiles from being loaded until the user has finished dragging the map. However, to achieve this it makes the existing tiles temporarily invisible until the map has stopped moving. This is not ideal.

Is there any way to keep the existing tiles on the screen as the map is being moved / panned - but (crucially) not actually update the tiles until the moveend event has occurred?

Thanks!

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!