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

172
Vistas
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
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