Skip to content
Snippets Groups Projects
map.constants.ts 889 B
import { PROJECT_ID } from '@/constants';
import {
  DEFAULT_CENTER_POINT,
  DEFAULT_MAX_ZOOM,
  DEFAULT_MIN_ZOOM,
  DEFAULT_TILE_SIZE,
} from '@/constants/map';
import { Point } from '@/types/map';
import { MapData } from './map.types';

export const MAIN_MAP = 'Main map';

export const MAP_DATA_INITIAL_STATE: MapData = {
  projectId: PROJECT_ID,
  meshId: '',
  modelId: 0,
  backgroundId: 0,
  overlaysIds: [],
  position: DEFAULT_CENTER_POINT,
  show: {
    legend: false,
    comments: false,
  },
  size: {
    width: 0,
    height: 0,
    tileSize: DEFAULT_TILE_SIZE,
    minZoom: DEFAULT_MIN_ZOOM,
    maxZoom: DEFAULT_MAX_ZOOM,
  },
  openedMaps: [{ modelId: 0, modelName: MAIN_MAP, lastPosition: { x: 0, y: 0, z: 0 } }],
};

export const MIDDLEWARE_ALLOWED_ACTIONS: string[] = ['map/setMapData', 'map/initMapData'];
export const DEFAULT_POSITION: Point = { x: 0, y: 0, z: 0 };