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

140
Views
Cómo agregar point_count dividido por algún valor al mapa

Usando Mapbox GL JS, quiero agregar al mapa la cantidad de marcadores en un grupo dividido por 10.

Puedo agregar los atributos point_count y point_count_abbreviated de la siguiente manera:

 map.addSource("uploaded-source", { type: "geojson", data: geoJSONcontent, cluster: true, clusterMaxZoom: 15, clusterRadius: 50, }); map.addLayer({ id: "cluster-count", type: "symbol", source: "uploaded-source", filter: ["has", "point_count"], layout: { "text-field": "{point_count_abbreviated}", "text-font": ["DIN Offc Pro Medium", "Arial Unicode MS Bold"], "text-size": 12, }, });

¿Cómo agrego point_count_abbreviated dividido por algún número al mapa?

Desafortunadamente, mi conocimiento de JS no es tan avanzado, probé cosas como:

 "text-field"://{point_count_abbreviated}/10 //String(Number("{point_count_abbreviated}")/10), //"{point_count_abbreviated}".slice(0, -1), //String(Number(['/', ["get", Number("{point_count_abbreviated}")], Number(10)]))
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Necesita una expresión Mapbox GL .

 "text-field": ["/", ["get", "point_count"], 10]

No estoy seguro de si necesita convertirse en una cadena. Si es así:

 "text-field": ["to-string", ["/", ["get", "point_count"], 10]]
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!