@@ -33,12 +33,18 @@ def register(self, app: FastAPI) -> None:
3333 self .router .prefix = app .state .router_prefix
3434
3535 @self .router .get (
36- "/collections/{collection_id}/items/{item_id}/WebMercatorQuad /tilejson.json" ,
36+ "/collections/{collection_id}/items/{item_id}/{tileMatrixSetId} /tilejson.json" ,
3737 )
3838 async def tilejson (
3939 request : Request ,
40- collection_id : str = Path (description = "Collection ID" ),
41- item_id : str = Path (description = "Item ID" ),
40+ collection_id : Annotated [str , Path (description = "Collection ID" )],
41+ item_id : Annotated [str , Path (description = "Item ID" )],
42+ tileMatrixSetId : Annotated [
43+ str ,
44+ Path (
45+ description = "Identifier selecting one of the TileMatrixSetId supported."
46+ ),
47+ ],
4248 tile_format : Optional [str ] = Query (
4349 None , description = "Output image type. Default is auto."
4450 ),
@@ -83,7 +89,7 @@ async def tilejson(
8389 if key .lower () not in qs_key_to_remove
8490 ]
8591 return RedirectResponse (
86- f"{ self .titiler_endpoint } /collections/{ collection_id } /items/{ item_id } /WebMercatorQuad /tilejson.json?{ urlencode (qs )} "
92+ f"{ self .titiler_endpoint } /collections/{ collection_id } /items/{ item_id } /{ tileMatrixSetId } /tilejson.json?{ urlencode (qs )} "
8793 )
8894
8995 @self .router .get (
@@ -97,8 +103,8 @@ async def tilejson(
97103 )
98104 async def stac_viewer (
99105 request : Request ,
100- collection_id : str = Path (description = "Collection ID" ),
101- item_id : str = Path (description = "Item ID" ),
106+ collection_id : Annotated [ str , Path (description = "Collection ID" )] ,
107+ item_id : Annotated [ str , Path (description = "Item ID" )] ,
102108 ):
103109 """Get items and redirect to stac tiler."""
104110 qs = [(key , value ) for (key , value ) in request .query_params ._list ]
0 commit comments