Simplify custom circle rendering

This commit is contained in:
Andreas Hocevar
2020-12-18 23:27:11 +01:00
committed by changqing
parent 3393de3c54
commit c4f5709349
3 changed files with 9 additions and 28 deletions

View File

@@ -11,10 +11,10 @@ const circleFeature = new Feature({
});
circleFeature.setStyle(
new Style({
renderer(coordinate, state) {
renderer(coordinates, state) {
// eslint-disable-next-line no-console
console.log('This circle is rendered by the code below.', Date.now());
const [x, y, x1, y1] = coordinate;
const [[x, y], [x1, y1]] = coordinates;
const ctx = state.context;
const dx = x1 - x;
const dy = y1 - y;