Get radius of a circle from Openlayers 3

Asked

Viewed 31 times

1

Hello, I’m in need of getting the radius of a circle created in Openlayers 3. Does anyone know how to do?

Here has the example of the map with the possibility to create the circles.

1 answer

1


I found the following solution that worked very well:

draw.on('drawend', function(evt){
  var feature = evt.feature;
  var p = feature.getGeometry();
  var radius = p.getRadius();
  console.log(radius);
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.