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

166
Visualizações
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 à 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