diff --git a/ogc/tiles/main.go b/ogc/tiles/main.go index 3c6ee9fb..4f57ea46 100644 --- a/ogc/tiles/main.go +++ b/ogc/tiles/main.go @@ -145,6 +145,8 @@ func (t *Tiles) Tile() http.HandlerFunc { " Mapbox Vector Tiles (?f=mvt) tiles are supported", http.StatusBadRequest) return } + } else { + tileCol = tileCol[:len(tileCol)-4] // remove .pbf extension } // ogc spec is (default) z/row/col but tileserver is z/col/row (z/x/y) diff --git a/ogc/tiles/main_test.go b/ogc/tiles/main_test.go index 652c9cc1..49a292e8 100644 --- a/ogc/tiles/main_test.go +++ b/ogc/tiles/main_test.go @@ -144,10 +144,10 @@ func TestTiles_Tile(t *testing.T) { }, }, { - name: "NetherlandsRDNewQuad/5/10/15.pbf", + name: "NetherlandsRDNewQuad/5/10/15", fields: fields{ configFile: "ogc/tiles/testdata/config_minimal_tiles.yaml", - url: "http://localhost:8080/tiles/:tileMatrixSetId/:tileMatrix/:tileRow/:tileCol.pbf", + url: "http://localhost:8080/tiles/:tileMatrixSetId/:tileMatrix/:tileRow/:tileCol", tileMatrixSetID: "NetherlandsRDNewQuad", tileMatrix: "5", tileRow: "10", @@ -158,6 +158,21 @@ func TestTiles_Tile(t *testing.T) { statusCode: http.StatusBadRequest, }, }, + { + name: "NetherlandsRDNewQuad/5/10/15.pbf", + fields: fields{ + configFile: "ogc/tiles/testdata/config_minimal_tiles.yaml", + url: "http://localhost:8080/tiles/:tileMatrixSetId/:tileMatrix/:tileRow/:tileCol", + tileMatrixSetID: "NetherlandsRDNewQuad", + tileMatrix: "5", + tileRow: "10", + tileCol: "15.pbf", + }, + want: want{ + body: "/NetherlandsRDNewQuad/5/15/10.pbf", + statusCode: http.StatusOK, + }, + }, { name: "different uriTemplateTiles", fields: fields{ diff --git a/ogc/tiles/templates/tiles/NetherlandsRDNewQuad.go.html b/ogc/tiles/templates/tiles/NetherlandsRDNewQuad.go.html index f97c8b6d..a43d43a4 100644 --- a/ogc/tiles/templates/tiles/NetherlandsRDNewQuad.go.html +++ b/ogc/tiles/templates/tiles/NetherlandsRDNewQuad.go.html @@ -18,7 +18,7 @@

NetherlandsRDNewQuad

tile-url="{{ .Config.BaseURL }}/tiles/NetherlandsRDNewQuad" zoom="12" center-x="5.3896944" center-y="52.1562499" - xy-swap="true"> + xy-swap="false">

Tile matrix set limits