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

174
Views
Leaflet.glify: los polígonos no se representan correctamente

Tengo un conjunto de datos que contiene miles de espacios de estacionamiento de automóviles que quiero mostrar en un mapa. Sin embargo, cuando uso la función L.glify.shapes , ¿los polígonos no se representan correctamente? ¿Hay alguna manera de que pueda resolver este problema?

¿O alguien puede recomendar una biblioteca diferente que sea más adecuada para representar grandes cantidades de datos en un mapa de folleto? Muchas gracias

Puedes ver el código aquí: https://codepen.io/RayL1/pen/WNzbddJ

 let map = L.map('map', {maxZoom: 30}).setView([ 51.524676, -0.181212], 22); let data = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.181100, 51.524730 ], [ -0.181155, 51.524703 ], [ -0.181169, 51.524714 ], [ -0.181114, 51.524741 ], [ -0.181100, 51.524730 ] ] ] } }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.181158, 51.524702 ], [ -0.181212, 51.524676 ], [ -0.181226, 51.524687 ], [ -0.181172, 51.524713 ], [ -0.181158, 51.524702 ] ] ] } }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.181214, 51.524675 ], [ -0.181268, 51.524649 ], [ -0.181282, 51.524660 ], [ -0.181228, 51.524686 ], [ -0.181214, 51.524675 ] ] ] } }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.181271, 51.524648 ], [ -0.181325, 51.524622 ], [ -0.181339, 51.524633 ], [ -0.181285, 51.524659 ], [ -0.181271, 51.524648 ] ] ] } } ] }

Así es como debería verse:

 L.geoJSON(data, { style:{ "color": "black", "weight":4, "fill":false, "opacity":0.8 } }).addTo(map);

ingrese la descripción de la imagen aquí

Así sale:

 L.glify.shapes({ map: map, data: data, border:true, color:{ r:0, g:0, b:245 } });

ingrese la descripción de la imagen aquí

Diferencia:

ingrese la descripción de la imagen aquí

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!