I am looking for a way to draw circles within the WKT format using Openlayers. I know that the WKT standard doesn’t support circles but someone said that you might be able to use a point wkt and then set a radius for it (for android but might work for other things as well). my question is thus how do I do that in Openlayers if it is possible?
link to what Tom said https://stackoverflow.com/a/58430532
This is how I made a polygon
let polyFeature = new ol.format.WKT().readFeature(polygonWKT, {
// Must use both projections in order to draw the feature with the wkt format
dataProjection : "EPSG:4326",
featureProjection: map.getView().getProjection() // Can at least get the standard projection and not have to fiddle with that
});
vectorSource.addFeature(polyFeature);
I’m asking this question to see if I can make the drawing/saving of the coordinates simpler. Right now, I have the coordinates in a string “coord1, coord2;” and have to split them when using a polygon and then convert them back into that string format when saving the coordinates. With wkt I can just throw the string into the Openlayers function and I’m done so if I can kind of do the same with the circle then that would be great.
What I use Openlayers v6 (some version of that) vanilla js, php