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

223
Views
leaflet.js: 5 TypeError no capturado: no se pueden leer las propiedades de undefined (leyendo 'recortar')

Creé un mapa con Leaflet y jQuery y quería agregar Clustergroups a mis Marcadores, pero recibo el error: leaflet.js:5 Uncaught TypeError: Cannot read properties of undefined (reading 'trim')

Aquí mi código:

 $.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); }

Traté de buscar el problema y encontré este https://github.com/Leaflet/Leaflet.markercluster/issues/724 pero nunca se resolvió el problema. También leí sobre diferentes tipos de problemas que tal vez sea el problema de jQuery que no puede definir las variables. Pero no sé dónde puede estar mi error, ¿alguien puede verlo? Gracias por adelantado

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Está utilizando dos veces () en la creación de marcadores.

Cambio:

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

a:

 let marker = L.marker([data[i].latitude, data[i].longitude]);
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!