feat: add global query manager
1 unresolved thread
1 unresolved thread
Objective:
As a user I would like to have ability to open map, zoom to some place and refresh page with seeing the same place as before. The same should work for someone else if I send them my link.
What has been done:
- Added transferring query params data to redux store
- Added transferring redux store data to query params with debounce time
- Done improvements of map config management: utils has been divided into separate hooks (cleanup) and number of rerenders has been minimized (optimization)
- Added map instance listeners in which there is a map position listener. In the future it will be also used for plugins and global event bus
What has been done additionally:
- Done improvements of user map position management. Position has been divided into initial and last. Initial is used only on initialization of the map and last is constantly following a real used position in the map instance with debounce. Redux can’t handle large amounts of actions so this value is only a reference and can’t be exactly the same as the real one in the map instance, right now used only in the query manager.
- Done improvements for initMapData action, in the new version it is handling also additional checks of model/background id existence
Added
latLngToPoint
util which is an universal util for transforming lat/lng position to cartesian coordinates - BREAKING: middleware is no longer listening for initMapData action due to changes in use of getUpdatedMapData util - it is now used directly in the action so middleware is not needed.
Important information
- There are a lot of test files lacking in the DRAFT version
- This PR is very big. IMO amount of changes here are probably were too big than expected BUT its superb important to remember most of these changes are reusable: utils, middleware, data, event listeners - and so we would need implement them in the future
Merge request reports
Activity
Filter activity
1 import { setMapData } from '@/redux/map/map.slice'; 2 import { MapSize } from '@/redux/map/map.types'; 3 import { AppDispatch } from '@/redux/store'; 4 import { Point } from '@/types/map'; 5 import { latLngToPoint } from '@/utils/map/latLngToPoint'; 6 import { toLonLat } from 'ol/proj'; 7 import { ObjectEvent } from 'openlayers'; 8 9 /* prettier-ignore */ 10 export const onMapPositionChange = 11 (mapSize: MapSize, mapPosition: Point, dispatch: AppDispatch) => changed this line in version 2 of the diff
- Resolved by Adrian Orłów
- Resolved by Adrian Orłów
- Resolved by Adrian Orłów
- Resolved by Adrian Orłów
- Resolved by Adrian Orłów
- Resolved by Adrian Orłów
- Resolved by Adrian Orłów
added 1 commit
- 087f0a7d - feat: extract set map position action from the set map data action
added 9 commits
-
087f0a7d...9515488f - 8 commits from branch
development
- 87ff1616 - Merge remote-tracking branch 'origin/development' into feature/global-query-manager
-
087f0a7d...9515488f - 8 commits from branch
mentioned in commit 8260206f
mentioned in merge request !146 (merged)
Please register or sign in to reply