Constructs a new QuadTree for the given TilingScheme.
Example:
const quadTree = new QuadTree(hereTilingScheme);
const geoBox = quadTree.getGeoBox(tileKey);
console.log(geoBox.center);
The TilingScheme used by this QuadTree.
The TilingScheme used by this QuadTree.
Visits this QuadTree and invoke the given accept method
with the current TileKey and
its bounding box in geo coordinates.
Example:
const geoPos = new GeoCoordinates(latitude, longitude);
const quadTree = new QuadTree(hereTilingScheme);
quadTree.visit((tileKey, geoBox) => {
if (geoBox.contains(geoPos)) {
console.log("tile", tileKey, "contains", geoPos);
return tileKey.level < 14; // stop visiting the quadtree if the level is >= 14.
}
return false; // stop visiting the quadtree,
// the tile's geoBox doesn't contain the given coordinates.
});
A function that takes a TileKey
and its bounding box in geo coordinates
and returns true if the visit of the QuadTree
should continue; otherwise false.
Visits the subtree starting from the given tile.
The root of the subtree that should be visited.
A function that takes a TileKey
and its bounding box in geo coordinates
and returns true if the visit of the
QuadTree should continue; otherwise false.
Generated using TypeDoc
A class used to represent a quadtree.