I had this code for my turf-buffer :
var unidades = 'kilometers'
select2 = new ol.interaction.Select({
condition: ol.events.condition.click
});
map.addInteraction(select2);
select2.getFeatures().on('change:length', function(e){
var feature_buff = select2.getFeatures();
var geojson = new ol.format.GeoJSON();
for (var i=0;i<feature_buff.getLength();i++){
json.push(geojson.writeFeature(feature_buff.item(i)));
prueba.getSource().addFeature(geojson.readFeature(json[json.length-1]) );
polys_fc=JSON.parse(json[json.length-1]);
prueba.getSource().addFeatures(geojsonToFeatures(polys_fc, {
featureProjection: 'EPSG:3857'
}));
var buffer = turf.buffer(polys_fc, 100, unidades); // PROBLEM UNITS
prueba.getSource().addFeatures(geojsonToFeatures(buffer));
}
});
The error is not showing the actual kilometers and 10,000 km are not that image 1 and 100 km are not the image 2. I do not understand why this error because the buffer think this well done.
"meters"
, and setting the distances to 100000000 and 100000 respectively? – Gabor Farkas Jan 18 '16 at 9:37