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

66
Views
Ubicaciones de agrupamiento/dispersión con la misma ubicación GPS ol.layers

¿Podría ayudarme? Tengo 5 huertos que tienen la misma ubicación/coordenadas de GPS y cuando ejecuto mi proyecto, todos aparecen en el mismo lugar. Me gustaría dispersarlos/agruparlos en un círculo o de cualquier manera para que cada ícono espacio entre ellos, estoy usando capas abiertas y también intenté usar ol.source.Cluster pero me da errores, ¿hay una forma más sencilla de lograr esto? Consulte el código a continuación. Gracias

el siguiente código funciona pero los íconos aparecen en un solo lugar

 function getOrchardLocations(locationId) { if (orchards != null) map.removeLayer(orchards); orchards = new ol.layer.Vector({ source: new ol.source.Vector({ url: rootName+'/Home/Locations/GetOrchardLocations/' + locationId, format: new ol.format.GeoJSON() }), style: function (feature) { return iconStyleFunc(feature); } }); // console.log(feature); map.addLayer(orchards); ZoomPucOrchards(pucid); };

Estilo de icono

 function iconStyleFunc(feature) { var zIndex = 1; var iconName = feature.get("IconPath") || "blue.png"; iconStyle = [new ol.style.Style({ image: new ol.style.Icon(({ anchor: [0.5, 36], anchorXUnits: "fraction", anchorYUnits: "pixels", opacity: 1, src: "/img/icons/" + iconName, zIndex: zIndex })), text: new ol.style.Text({ text: getText(feature), font: '14px "Helvetica Neue",Helvetica,Arial,sans-serif', placement: 'point', fill: new ol.style.Fill({ color: '#fff' }), stroke: new ol.style.Stroke({ color: '#000', width: 1 }), }), zIndex: zIndex })]; return iconStyle; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede usar ol-ext, que es una extensión para openlayers. En ol-ext, cuando se selecciona el clúster, la interacción SelectCluster muestra los datos separados.

ol-ext

Código de ejemplo

Sitio web de ejemplo

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!