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

229
Views
leaflet Map : how can i put internal path of tileLayer

Im looking for a way to integrate the tileLayer in the map but with internal path, not with an external path like this :

https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png

This is my JS :

    import "leaflet";
    
    const $map = document.querySelector(".searchResult__map"),
      manifest = JSON.parse($map.dataset.manifest),
      map = L.map($map, { scrollWheelZoom: false }).setView(
        [45.7693171, 2.5910832], 6
      ),
      layerTile = "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",

//This is Not working :
//layerTile = "../../../../img/tile/{z}/{x}/{y}{r}.png",

      layerAttribution = window.location.pathname.includes("/en/")
      ? '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>'
      : '&copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>';
    
    L.tileLayer(layerTile, {
      attribution: layerAttribution,
    }).addTo(map);
    
    for (const [id, data] of Object.entries(manifest)) {
      const $popin = document.querySelector(
        `.searchResult__mapPopins .villageCard--popin[data-id="${id}"]`
      );
    
   
      L.marker([data.lat, data.lng])
        .addTo(map)
        .bindPopup($popin.innerHTML);
    }
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!