Skip to content

Commit

Permalink
handle offline area bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
bastyen committed Jul 8, 2024
1 parent 3647bdb commit 6a286c1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export class MyOfflineDataComponent {
const maxZoom = 9;

const bounds = L.default.latLngBounds([
{ lat: 45.933960441921585, lng: 7.053222656250001 },
{ lat: 44.47299117260252, lng: 5.921630859375001 },
{ lat: area.bbox[0][0], lng: area.bbox[0][1] },
{ lat: area.bbox[1][0], lng: area.bbox[1][1] },
]);
const offlineLayer = tileLayerOffline(url, { attribution });
await this.offlineService.writeOrUpdateTilesInStore(
Expand Down Expand Up @@ -162,8 +162,8 @@ export class MyOfflineDataComponent {
const maxZoom = 9;

const bounds = L.default.latLngBounds([
{ lat: 45.933960441921585, lng: 7.053222656250001 },
{ lat: 44.47299117260252, lng: 5.921630859375001 },
{ lat: area.bbox[0][0], lng: area.bbox[0][1] },
{ lat: area.bbox[1][0], lng: area.bbox[1][1] },
]);
const offlineLayer = tileLayerOffline(url, { attribution });
await this.offlineService.removeTilesInStore(
Expand Down
30 changes: 24 additions & 6 deletions front-end/src/data/areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,54 @@
"id": 1,
"name": "Zone A",
"description": "tooltip",
"bbox": ""
"bbox": [
[45.933960441921585, 7.053222656250001],
[44.47299117260252, 5.921630859375001]
]
},
{
"id": 2,
"name": "Zone B",
"tooltip": "tooltip",
"bbox": ""
"bbox": [
[45.933960441921585, 7.053222656250001],
[44.47299117260252, 5.921630859375001]
]
},
{
"id": 3,
"name": "Zone C",
"tooltip": "tooltip",
"bbox": ""
"bbox": [
[45.933960441921585, 7.053222656250001],
[44.47299117260252, 5.921630859375001]
]
},
{
"id": 4,
"name": "Zone D",
"tooltip": "tooltip",
"bbox": ""
"bbox": [
[45.933960441921585, 7.053222656250001],
[44.47299117260252, 5.921630859375001]
]
},
{
"id": 5,
"name": "Zone E",
"tooltip": "tooltip",
"bbox": ""
"bbox": [
[45.933960441921585, 7.053222656250001],
[44.47299117260252, 5.921630859375001]
]
},
{
"id": 6,
"name": "Zone F",
"tooltip": "tooltip",
"bbox": ""
"bbox": [
[45.933960441921585, 7.053222656250001],
[44.47299117260252, 5.921630859375001]
]
}
]

0 comments on commit 6a286c1

Please sign in to comment.