Skip to content
Snippets Groups Projects

fix(vector-map): fix center point calculation

Merged Miłosz Grocholewski requested to merge fix/incorrect-center-point into development
1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 /* eslint-disable no-magic-numbers */
2 import { Coordinate } from 'ol/coordinate';
3
4 export default function getCenter(coords: Array<Coordinate>): Coordinate {
5 let minX = Infinity;
6 let minY = Infinity;
7 let maxX = -Infinity;
8 let maxY = -Infinity;
9
10 coords.forEach(([x, y]) => {
11 if (x < minX) minX = x;
12 if (x > maxX) maxX = x;
  • Miłosz Grocholewski deleted the feat/MIN-64-reaction-with-modification branch. This merge request now targets the development branch

    deleted the feat/MIN-64-reaction-with-modification branch. This merge request now targets the development branch

  • added 26 commits

    Compare with previous version

  • added 1 commit

    • 92e2989b - refactor(vector-map): change 'else if' to 'if' in the getCenter function

    Compare with previous version

  • mentioned in commit 281a064f

  • Please register or sign in to reply
    Loading