feat(submaps): Plugins Submaps (MIN-226)
1 unresolved thread
1 unresolved thread
Implemented getModels
and openMap
methods for plugins.
Get Models
To get data about all available submaps, plugins can use the getModels
method defined in window.minerva.map.data
. This method returns array with data about all submaps.
Example of getModels usage:
window.minerva.map.data.getModels();
Open Map
To open map, plugins can use the openMap
method defined in window.minerva.map
. This method takes one argument: an object with an id
property that indicates the map ID.
Example of openMap usage:
window.minerva.map.openMap({ id: 51 });
Edited by mateusz-winiarczyk
Merge request reports
Activity
Filter activity
assigned to @mateusz-winiarczyk
added 5 commits
-
27d39167...2fdb9af4 - 4 commits from branch
development
- d4d98e29 - Merge remote-tracking branch 'origin/development' into MIN-226-plugins-submaps
-
27d39167...2fdb9af4 - 4 commits from branch
- src/services/pluginsManager/map/openMap.ts 0 → 100644
3 import { modelsDataSelector } from '@/redux/models/models.selectors'; 4 import { store } from '@/redux/store'; 5 import { PluginsEventBus } from '../pluginsEventBus'; 6 7 export type OpenMapArgs = { 8 id: number; 9 }; 10 11 export const openMap = ({ id }: OpenMapArgs): void => { 12 const { getState, dispatch } = store; 13 const models = modelsDataSelector(getState()); 14 const openedMaps = mapOpenedMapsSelector(getState()); 15 const mapToOpen = models.find(model => model.idObject === id); 16 const currentModelId = mapModelIdSelector(getState()); 17 18 if (!mapToOpen) throw new Error('Map with provided id does not exist'); changed this line in version 4 of the diff
added 13 commits
-
d4d98e29...e4fd45c4 - 12 commits from branch
development
- 1821cff1 - Merge remote-tracking branch 'origin/development' into MIN-226-plugins-submaps
-
d4d98e29...e4fd45c4 - 12 commits from branch
added 1 commit
- a18cc4e8 - docs(errors): extract error messages constants and create docs for error messages
mentioned in commit 1bfc48af
Please register or sign in to reply