Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

## Unreleased

## Misc
### Misc

* add attribution in `/tilejson.json` response. Controled with `TITILER_DEFAULT_ATTRIBUTION` environment variable.
* enable `jinja2.autoescape` for HTML/XML templates (ref: https://jinja.palletsprojects.com/en/stable/api/#autoescaping)
* remove python 3.9 support


## 0.23.1 (2025-08-27)

### titiler.core
Expand Down
6 changes: 6 additions & 0 deletions src/titiler/core/titiler/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import abc
import logging
import os
import warnings
from typing import (
Any,
Expand Down Expand Up @@ -631,10 +632,13 @@ async def tileset_list(
]
query_string = f"?{urlencode(qs)}" if qs else ""

attribution = os.environ.get("TITILER_DEFAULT_ATTRIBUTION")

tilesets = []
for tms in self.supported_tms.list():
tileset = {
"title": f"tileset tiled using {tms} TileMatrixSet",
"attribution": attribution,
"dataType": "map",
"crs": self.supported_tms.get(tms).crs,
"boundingBox": collection_bbox,
Expand Down Expand Up @@ -808,6 +812,7 @@ async def tileset(
"boundingBox": collection_bbox,
"links": links,
"tileMatrixSetLimits": tilematrix_limit,
"attribution": os.environ.get("TITILER_DEFAULT_ATTRIBUTION"),
}
)

Expand Down Expand Up @@ -1010,6 +1015,7 @@ def tilejson(
"minzoom": minzoom if minzoom is not None else src_dst.minzoom,
"maxzoom": maxzoom if maxzoom is not None else src_dst.maxzoom,
"tiles": [tiles_url],
"attribution": os.environ.get("TITILER_DEFAULT_ATTRIBUTION"),
}

def map_viewer(self): # noqa: C901
Expand Down
1 change: 1 addition & 0 deletions src/titiler/core/titiler/core/templates/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
maxNativeZoom: data.maxzoom,
minZoom: data.minzoom,
bounds: L.latLngBounds([bottom, left], [top, right]),
attribution: data.attribution,
}
);

Expand Down
7 changes: 6 additions & 1 deletion src/titiler/core/titiler/core/templates/wmts.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
<ows:ServiceIdentification>
<ows:Title>{{ title }}</ows:Title>
<ows:Title>Web Map Tile Service by TiTiler</ows:Title>
<ows:ServiceType>OGC WMTS</ows:ServiceType>
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>TiTiler</ows:ProviderName>
<ows:ProviderSite xlink:href="https://developmentseed.org/titiler/"/>
<ows:ServiceContact/>
</ows:ServiceProvider>
<ows:OperationsMetadata>
<ows:Operation name="GetCapabilities">
<ows:DCP>
Expand Down
1 change: 1 addition & 0 deletions src/titiler/mosaic/titiler/mosaic/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ def tilejson(
"minzoom": minzoom if minzoom is not None else src_dst.minzoom,
"maxzoom": maxzoom if maxzoom is not None else src_dst.maxzoom,
"tiles": [tiles_url],
"attribution": os.environ.get("TITILER_DEFAULT_ATTRIBUTION"),
}

def map_viewer(self): # noqa: C901
Expand Down
Loading