Estoy tratando de redondear las coordenadas en mi archivo a 3 decimales en lugar de la longitud habitual en la que normalmente se encuentran. He estado probando el método ".toFixed(n)" pero sin resultados.
//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);Mis datos se ven así:
var controlLines = [ { "geometry":{ "type":"LineString", "coordinates":[ [ -3.231658, 51.687026 ], [ -3.231659, 51.687016 ] ] }, "type":"Feature", "properties":{ "User_ID":1002848324 } }, {...}]Cualquier consejo o respuesta sería muy apreciada.