-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.ts
More file actions
21 lines (19 loc) · 652 Bytes
/
map.ts
File metadata and controls
21 lines (19 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { MapType } from "@/server/models/MapView";
import mapStyles, { hexMapStyle } from "../styles";
import type { MapConfig } from "@/server/models/Map";
import type { MapViewConfig } from "@/server/models/MapView";
export const getDataSourceIds = (mapConfig: MapConfig) => {
return new Set(
[mapConfig.membersDataSourceId]
.concat(mapConfig.markerDataSourceIds)
.filter(Boolean),
)
.values()
.toArray();
};
export const getMapStyle = (viewConfig: MapViewConfig) => {
if (viewConfig.mapType === MapType.Hex) {
return hexMapStyle;
}
return mapStyles[viewConfig.mapStyleName] || Object.values(mapStyles)[0];
};