Currently, we are trying to draw a polygon with javascript through the following map api and find the center point of that polygon.
I've done drawing a polygon.
I'm struggling to find the center point of this polygon.
Is there a way to find the center point through the next map api? Does anyone know the algorithm to find the center point?
algorithm javascript
Knowing the minimum/maximum 4 points of the polygon gives you the center point.
center.x = x1 + ((x2 - x1) / 2);
center.y = y1 + ((y2 - y1) / 2);
© 2024 OneMinuteCode. All rights reserved.