Skip to content
Snippets Groups Projects

feat(map): add render components and tests

Merged Adrian Orłów requested to merge feature/add-map-render-components into development
1 unresolved thread

Objective:

Create map rendering components, logic and unit tests

What has been done:

  • map rendering utils
  • map viewer component
  • unit tests

What has not been done (intentionally):

  • connection to the API service (size of the PR)
  • unit tests for utils that will be connected to the API service, they are based on mocks only so tests won't serve their purpose

Additionally:

Edited by Adrian Orłów

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
  • Tadeusz Miesiąc
  • Tadeusz Miesiąc
  • Tadeusz Miesiąc
  • 13 try {
    14 VALID_MAP_SIZE_SCHEMA.parse(mapSize);
    15 } catch (e) {
    16 // TODO: need to rething way of handling parsing errors, for now let's leave it to console.log
    17 // eslint-disable-next-line no-console
    18 console.error('Error parsing map size', e);
    19 return LATLNG_FALLBACK;
    20 }
    21
    22 const { pointOrigin, pointShifted } = getPointOriginAndShifted(point, mapSize);
    23 const pixelsPerLonDegree = mapSize.tileSize / 360;
    24 const pixelsPerLonRadian = mapSize.tileSize / (2 * Math.PI);
    25
    26 const lng = (pointShifted.x - pointOrigin.x) / pixelsPerLonDegree;
    27 const latRadians = (pointShifted.y - pointOrigin.y) / -pixelsPerLonRadian;
    28 const lat = radiansToDegrees(2 * Math.atan(Math.exp(latRadians)) - Math.PI / 2);
  • Tadeusz Miesiąc approved this merge request

    approved this merge request

  • I went through open layers docs, maybe it will be good idea to make quick tour with you Adrian and talk the code through

  • mateuszmiko approved this merge request

    approved this merge request

  • Adrian Orłów added 8 commits

    added 8 commits

    • f8b8786d - fix(map): move @testing-library/react to dev depends
    • 53d809a0 - fix(tests): add resize observer mock as a global
    • 0e350fc8 - fix(tests): add resize observer mock as a global
    • b64ca935 - fix(tests): add rule disable for actWait test util
    • fecf722b - feat(map): improve readability and tests of point offset util
    • 302ed1e1 - feat(map): improve readability of point to lat lng util
    • 38b68875 - feat(map): improve usage of selectors and types in map module
    • ac14c550 - feat(map): improve hook and tests of useOlMap

    Compare with previous version

  • Adrian Orłów changed the description

    changed the description

  • Adrian Orłów added 1 commit

    added 1 commit

    • 52ef7073 - test: fix transformIgnorePatterns not configured in test commands

    Compare with previous version

  • Tadeusz Miesiąc
  • Tadeusz Miesiąc
  • I find it difficult to check your PR. We need to talk about how OL works and what is behind the logic of implementation. Code itself looks clean to me, but as I said - I can not check the logic atm

  • Adrian Orłów added 41 commits

    added 41 commits

    • 52ef7073...926fd3fd - 40 commits from branch development
    • f6a39f44 - Merge remote-tracking branch 'origin/development' into feature/add-map-render-components

    Compare with previous version

  • Adrian Orłów enabled an automatic merge when the pipeline for f6a39f44 succeeds

    enabled an automatic merge when the pipeline for f6a39f44 succeeds

  • Adrian Orłów mentioned in commit 1f1cf84b

    mentioned in commit 1f1cf84b

  • merged

  • Please register or sign in to reply
    Loading