Skip to content

Commit c107a0d

Browse files
committed
Update icons
1 parent 075e4fd commit c107a0d

File tree

4 files changed

+277
-16
lines changed

4 files changed

+277
-16
lines changed

web/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@tanstack/react-router": "^1.97.1",
2929
"@tanstack/react-virtual": "^3.13.4",
3030
"@tanstack/router-plugin": "^1.97.1",
31+
"@types/leaflet": "^1.9.16",
3132
"@types/react": "^19.0.7",
3233
"@types/react-dom": "^19.0.3",
3334
"@vitejs/plugin-react": "^4.3.4",
@@ -36,13 +37,15 @@
3637
"classnames": "^2.5.1",
3738
"cx": "^25.3.1",
3839
"date-fns": "^4.1.0",
40+
"leaflet": "^1.9.4",
3941
"openapi-hooks": "0.0.3-alpha.3",
4042
"postcss": "^8.5.1",
4143
"postcss-nested": "^7.0.2",
4244
"qrcode.react": "^4.2.0",
4345
"react": "^19.0.0",
4446
"react-dom": "^19.0.0",
4547
"react-icons": "^5.5.0",
48+
"react-leaflet": "^5.0.0",
4649
"sonner": "^2.0.1",
4750
"tailwindcss": "^3.4.17",
4851
"typescript": "^5.7.3",

web/pnpm-lock.yaml

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/api/maps.ts

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,70 @@ export type MapResponse = {
5050
};
5151

5252
export type MapResult = {
53-
"id": "41d038d37cd64053a0900b973c185c2a",
54-
"type": "Procedural",
55-
"seed": 2031947583,
56-
"size": 4500,
57-
"saveVersion": 265,
58-
"imageUrl": "https://content.rustmaps.com/maps/265/41d038d37cd64053a0900b973c185c2a/map_raw_normalized.png",
59-
"tileBaseUrl": "https://content.rustmaps.com/maps/265/41d038d37cd64053a0900b973c185c2a/tiles-webp/{z}/{x}/{y}.webp",
60-
"imageIconUrl": "https://content.rustmaps.com/maps/265/41d038d37cd64053a0900b973c185c2a/map_icons.png",
61-
"thumbnail_url": "https://content.rustmaps.com/maps/265/41d038d37cd64053a0900b973c185c2a/thumbnail.webp",
62-
"undergroundOverlayUrl": "https://content.rustmaps.com/maps/265/41d038d37cd64053a0900b973c185c2a/tunnel/tiles/",
63-
"buildingBlockAreaUrl": "https://content.rustmaps.com/maps/265/41d038d37cd64053a0900b973c185c2a/building_block.json",
53+
id: string;
54+
_type: string;
55+
seed: number;
56+
size: number;
57+
save_version: number;
58+
image_url: string;
59+
title_base_url: string | null;
60+
image_icon_url: string;
61+
thumbnail_url: string;
62+
underground_overlay_url: string;
63+
building_block_area_url: string;
64+
is_staging: boolean;
65+
is_custom_map: boolean;
66+
is_for_sale: boolean;
67+
is_featured: boolean;
68+
has_custom_monuments: boolean;
69+
can_download: boolean;
70+
download_url: string | null;
71+
slug: string | null;
72+
monuments: Monument[];
73+
extra: {
74+
tileBaseUrl: string;
75+
displayName: string | null;
76+
purchaseUrl: string | null;
77+
landPercentageOfMap: number;
78+
biomePercentages: {
79+
s: number; // sand
80+
d: number; // desert
81+
f: number; // forest
82+
t: number; // tundra
83+
};
84+
islands: number;
85+
totalMonuments: number;
86+
largeMonuments: number;
87+
smallMonuments: number;
88+
tinyMonuments: number;
89+
safezones: number;
90+
caves: number;
91+
rivers: number;
92+
mountains: number;
93+
icebergs: number;
94+
iceLakes: number;
95+
lakes: number;
96+
canyons: number;
97+
oases: number;
98+
buildableRocks: number;
99+
heatMaps: HeatMap[];
100+
estimatedDeletionDate: string | null;
101+
};
102+
};
103+
104+
export type Monument = {
105+
type: string;
106+
sizeCategory: string;
107+
coordinates: {
108+
x: number;
109+
y: number;
110+
};
111+
iconPath: string;
112+
};
113+
114+
export type HeatMap = {
115+
name: string;
116+
url: string;
64117
};
65118

66119
const getMap = async (map_id: string) => {
@@ -73,5 +126,7 @@ export const useMap = (map_id: string) => {
73126
return useQuery({
74127
queryKey: ['map', map_id],
75128
queryFn: () => getMap(map_id),
129+
// staleTime: 1000 * 60 * 60 * 24, // 24 hours
130+
enabled: !!map_id,
76131
});
77132
}

0 commit comments

Comments
 (0)