Skip to content

Commit

Permalink
add buffer to aoi (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago authored Nov 16, 2023
1 parent 0975890 commit 01968bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 0.15.6 (2023-11-16)

### titiler.core

* in `/map` HTML response, add Lat/Lon buffer to AOI to avoid creating wrong AOI (when data covers the whole world).

## 0.15.5 (2023-11-09)

### titiler.core
Expand Down
12 changes: 7 additions & 5 deletions src/titiler/core/titiler/core/templates/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
<script type="text/javascript">

const bboxPolygon = (bounds) => {
var LL_EPSILON = 1e-6
return {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[
[bounds[0], bounds[1]],
[bounds[2], bounds[1]],
[bounds[2], bounds[3]],
[bounds[0], bounds[3]],
[bounds[0], bounds[1]]
[bounds[0] + LL_EPSILON, bounds[1] + LL_EPSILON],
[bounds[2] - LL_EPSILON, bounds[1] + LL_EPSILON],
[bounds[2] - LL_EPSILON, bounds[3] - LL_EPSILON],
[bounds[0] + LL_EPSILON, bounds[3] - LL_EPSILON],
[bounds[0] + LL_EPSILON, bounds[1] + LL_EPSILON]
]]
},
'properties': {}
Expand Down Expand Up @@ -93,6 +94,7 @@
"features": [bboxPolygon(bounds)]
}
}
console.log(geo)

var aoi = L.geoJSON(geo, {
color: '#3bb2d0', fill: false
Expand Down

0 comments on commit 01968bb

Please sign in to comment.