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

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