Skip to content

feat: add global query manager

Adrian Orłów requested to merge feature/global-query-manager into development

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

Loading