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

242
Views
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 answers
Answer question

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 Report
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!