Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Feb 15, 2024
1 parent a116c55 commit 90ca57a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions titiler/cmr/templates/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@
]
}
} else {
// Avoid bounds overflow and limit to the max TileMatrixSet bbox
bounds = [
Math.max(bounds[0], {{ tms.bbox.left }}),
Math.max(bounds[1], {{ tms.bbox.bottom }}),
Math.min(bounds[2], {{ tms.bbox.right }}),
Math.min(bounds[3], {{ tms.bbox.top }}),
]

geo = {
"type": "FeatureCollection",
"features": [bboxPolygon(bounds)]
Expand All @@ -122,15 +130,8 @@
// Bounds crossing dateline
if (bounds[0] > bounds[2]) {
bounds[0] = bounds[0] - 360
} else {
// Avoid bounds overflow and limit to the max TileMatrixSet bbox
bounds = [
max(bounds[0], tms.xy_bbox.left),
max(bounds[1], tms.xy_bbox.bottom),
min(bounds[2], tms.xy_bbox.right),
min(bounds[3], tms.xy_bbox.top),
]
}

var left = bounds[0],
bottom = bounds[1],
right = bounds[2],
Expand Down

0 comments on commit 90ca57a

Please sign in to comment.