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

234
Vistas
leaflet.js:5 Uncaught TypeError: Cannot read properties of undefined (reading 'trim')

I've created a map with Leaflet and jQuery and I wanted to add Clustergroups to my Markers but I am getting the error : leaflet.js:5 Uncaught TypeError: Cannot read properties of undefined (reading 'trim')

Here my code:

  $.get(url).done(function (data) {


            var markers = L.markerClusterGroup();
            for (let i = 0; i < data.length; i++) {
                var title = "hi";

                let marker = L.marker(([data[i].latitude, data[i].longitude]));
                marker.bindPopup(title);
                markers.addLayer(marker);
               
            }
            mymap.addLayer(markers);

        }

I tried to search for the problem and found this https://github.com/Leaflet/Leaflet.markercluster/issues/724 but the problem was never answered. Also i read about different types of problems that it is maybe the problem of jQuery that it cannot define the variables. But I dont't know where my mistake could be, can anyone see it? Thanks in advance

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are useing twice () in marker creation.

Change:

let marker = L.marker(([data[i].latitude, data[i].longitude]));

to:

let marker = L.marker([data[i].latitude, data[i].longitude]);
about 4 years ago · Juan Pablo Isaza Denunciar
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