Skip to content

Commit

Permalink
修改参数名称
Browse files Browse the repository at this point in the history
  • Loading branch information
zlzforever committed Apr 29, 2024
1 parent c6eee62 commit fbb2d47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/ZMap/Infrastructure/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ ______ _____
/// WMTS 缓存文件的 Key
/// </summary>
/// <param name="layers"></param>
/// <param name="cqlFilter"></param>
/// <param name="filter"></param>
/// <param name="format"></param>
/// <param name="tileMatrixSet"></param>
/// <param name="tileMatrix"></param>
/// <param name="tileRow"></param>
/// <param name="tileCol"></param>
/// <returns></returns>
public static string GetWmtsPath(string layers, string cqlFilter, string format, string tileMatrixSet,
public static string GetWmtsPath(string layers, string filter, string format, string tileMatrixSet,
string tileMatrix, int tileRow,
int tileCol)
{
var layerKey = layers.Replace(',', '_');
var cqlFilterKey = string.IsNullOrWhiteSpace(cqlFilter)
var cqlFilterKey = string.IsNullOrWhiteSpace(filter)
? string.Empty
: MurmurHashAlgorithmUtility.ComputeHash(Encoding.UTF8.GetBytes(cqlFilter));
: MurmurHashAlgorithmUtility.ComputeHash(Encoding.UTF8.GetBytes(filter));

var imageExtension = GetImageExtension(format);
return Path.Combine(AppContext.BaseDirectory, "cache", "wmts",
Expand Down
10 changes: 5 additions & 5 deletions src/ZServer.API/Controllers/WMTSController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ public class WMTSController(IClusterClient clusterClient, ILogger<WMTSController
/// <param name="tileCol"></param>
/// <param name="format"></param>
/// <param name="tileMatrixSet"></param>
/// <param name="cqlFilter"></param>
/// <param name="filter"></param>
/// <returns></returns>
[HttpGet]
public async Task GetAsync([Required] [FromQuery(Name = "layer"), StringLength(100)] string layers,
[StringLength(100)] string style,
[Required, StringLength(50)] string tileMatrix, [Required] int tileRow, [Required] int tileCol,
string format = "image/png",
[Required, StringLength(50)] string tileMatrixSet = "EPSG:4326",
[FromQuery(Name = "CQL_FILTER"), StringLength(1000)]
string cqlFilter = null)
[FromQuery(Name = "Z_FILTER"), StringLength(2048)]
string filter = null)
{
#if !DEBUG
// 使用相同的缓存路径
var path = Utility.GetWmtsPath(layers, cqlFilter, format, tileMatrixSet, tileMatrix, tileRow, tileCol);
var path = Utility.GetWmtsPath(layers, filter, format, tileMatrixSet, tileMatrix, tileRow, tileCol);

if (System.IO.File.Exists(path))
{
Expand All @@ -67,7 +67,7 @@ public async Task GetAsync([Required] [FromQuery(Name = "layer"), StringLength(1
var friend = clusterClient.GetGrain<IWMTSGrain>(key);
var result =
await friend.GetTileAsync(layers, style, format, tileMatrixSet, tileMatrix, tileRow, tileCol,
cqlFilter,
filter,
new Dictionary<string, object>
{
{ "TraceIdentifier", HttpContext.TraceIdentifier }
Expand Down

0 comments on commit fbb2d47

Please sign in to comment.