@@ -50,17 +50,70 @@ export type MapResponse = {
5050} ;
5151
5252export 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
66119const 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