服务器代理地图数据

This commit is contained in:
2026-06-06 12:01:46 +08:00
parent 9d3f007cb8
commit 563d609121
10 changed files with 618 additions and 49 deletions
+5 -1
View File
@@ -155,5 +155,9 @@ func mapTileSourceDTO(row mapTileSourceRecord) gin.H {
}
func publicMapTileSourceDTO(row mapTileSourceRecord) gin.H {
return gin.H{"id": row.ID, "name": row.Name, "url_template": row.URLTemplate, "attribution": row.Attribution, "max_zoom": row.MaxZoom}
hash := row.URLTemplateHash
if hash == "" {
hash = mapTileSourceHash(row.URLTemplate)
}
return gin.H{"id": row.ID, "name": row.Name, "url_template": "/api/map/" + hash + "?x={x}&y={y}&z={z}", "attribution": row.Attribution, "max_zoom": row.MaxZoom}
}