-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Testcase:
const cover = require('@mapbox/tile-cover');
const tilebelt = require('@mapbox/tilebelt');
const coordinates = [-11.250000000000002, 6.816667036613423];
console.log({ coordinates });
const tiles = cover.tiles({ type: 'Point', coordinates }, { min_zoom: 8, max_zoom: 8 });
console.log({ tiles });
const bbox = tilebelt.tileToBBOX(tiles[0]);
console.log({ bbox });
console.log({
inTile:
coordinates[0] >= bbox[0] &&
coordinates[0] <= bbox[2] &&
coordinates[1] >= bbox[1] &&
coordinates[1] <= bbox[3] &&
coordinates[0] !== null &&
coordinates[1] !== null,
});Output:
{ coordinates: [ -11.250000000000002, 6.816667036613423 ] }
{ tiles: [ [ 120, 123, 8 ] ] }
{ bbox: [ -11.25, 5.615985819155343, -9.84375, 7.013667927566632 ] }
{ inTile: false }
Metadata
Metadata
Assignees
Labels
No labels