I'm in the process of adding a some drawing tools to a map using OpenLayers v5. Once such task requires a custom drawing that is not covered in the docs or out of the box: concentric circles.
I don't really know where to start so I have two questions.
Can I somehow create a single geometry and use the geometryFunction
as demonstrated in the examples, or do I need to create multiple features, one for each circle?
And What exactly does a Geometry
need when being created as a standalone in order to work with OpenLayers? A collection of X,Y coordinates?
In an attempt to figure this out on my own, using the drawing example from the docs, I tried to grab the coords from the object, and then subsequently recreate it, and add it to the the source manually like below;
const feature = new Feature({
geometry: new Circle(
[
/**
* These are the nubmers that come out of a native Circle drawing
* when console.log'ing the feature.getGeomety.getFlatCoordinates().
* No idea if this is how I'd get or set those values.
*/
[-10448062.740758311, 4941309.912009362],
[ -9953141.960354999, 4941309.912009362],
]
)
});
source.addFeature(feature);
This does not error, but it fails to show the circle.