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

69
Vistas
Rounding up coordinates from a geojson file for line plotting

I am trying to round up the coordinates in my file to 3 decimal places rather than the usual length they are normally at. I have been trying the ".toFixed(n)" method but with no results.

      //line css
      var lineStyle = {
        "color": "#ff3300",
        "weight": 1,
        "opacity": 0.5
      };

      //line display command
      var lineLayer = L.geoJSON(controlLines, function(feature, coordinates) {
        for (coordinates in feature) {
          return (+feature.coordinates).toFixed(3);
        }
      },
      {
        style: lineStyle
      }).addTo(map);

My data looks as so:

var controlLines = [
  {
     "geometry":{
        "type":"LineString",
        "coordinates":[
           [
              -3.231658,
              51.687026
           ],
           [
              -3.231659,
              51.687016
           ]
        ]
     },
     "type":"Feature",
     "properties":{
        "User_ID":1002848324
     }
  },
  {...}]

Any advice or answers would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
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