ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
681 stars 230 forks source link

Draw Circle, but got Polygon #379

Closed dio-el-claire closed 3 years ago

dio-el-claire commented 3 years ago

Draw circle. In drawEnd event got a Polygon in the features version: 0.12.0-rc.14

ghettovoice commented 3 years ago

Hello @dio-el-claire , that's right because there is no Circle geometry in GeoJSON spec.

So I can't serialize ol/geom/Circle to the plain GeoJSON. Circle can be represented only as circular Polygon. If you need to know circle radius and center there is a special property vl_circle inside GeoJSON feature properties. And also you can get ol/Feature instance from the event, it will have geometry of ol/geom/Circle type.

There is example https://jsfiddle.net/ghettovoice/Ln9qr135/4/

dio-el-claire commented 3 years ago

Thanks a lot!