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

248
Visualizações
Showing more details ons leaflet map

Currently i'm implementing a leaflet map that serves map data from our own OSM server.

During the implementation I noticed that the details on the maps are not clearly visible. Street names are unclear and walking paths do not stand out.

We currently support a zoom level of 17. However, the tiles received are of high quality and show much more detail than leaflet does. If I zoom in further, the tiles unfortunately turn gray.

An implementation with OpenLayers looks clearer.

Is there a setting that solves this or that allows you to zoom in without showing gray tiles? I thought this was maxNativeZoom but if i put this field on 17, it still tries to show zoom level 18 tiles.

enter image description here

const osmLayer = new L.TileLayer(osmUrl,
    {
        attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
    });

const element = elemId[0].className + "-" + mapId;

const map = new L.Map(element,
    {
        maxZoom: 22,
        maxNativeZoom: 17,
        minZoom: 9
    });

map.addLayer(osmLayer);

return map;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I just moved the zoom settings to the tileLayer and that seems to work. The settings are properties of the tileLayer:

const osmLayer = new L.TileLayer(osmUrl,
    {
        maxZoom: 20,
        maxNativeZoom: 17,
        minZoom: 9,
        attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
    });

const element = elemId[0].className + "-" + mapId;

const map = new L.Map(element);

map.addLayer(osmLayer);

return map;
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