JSPM

tiles-in-bbox

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 102
  • Score
    100M100P100Q79801F
  • License 0BSD

Get all tiles of a web map in x,y,z coordinates for a specified bounding box and zoom.

Package Exports

  • tiles-in-bbox

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tiles-in-bbox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tiles-in-bbox

Get all tiles of a web map in x,y,z coordinates for a specified bounding box and zoom.

Installation

npm install tiles-in-bbox

Usage

var t = require('tiles-in-bbox')

//Follows the GeoJson/OpenStreetMaps convention of a clockwise box starting at the bottom.
var bbox = {
    bottom : 42.356,
    left : -71.1279,
    top : 42.3876,
    right : -71.1002
}

var zoom = 15
var tiles = t.tilesInBbox(bbox, zoom)
console.log(tiles)

Results

[ { x: 9909, y: 12116, z: 15 },
  { x: 9909, y: 12117, z: 15 },
  { x: 9909, y: 12118, z: 15 },
  { x: 9909, y: 12119, z: 15 },
  { x: 9909, y: 12120, z: 15 },
  { x: 9910, y: 12116, z: 15 },
  { x: 9910, y: 12117, z: 15 },
  { x: 9910, y: 12118, z: 15 },
  { x: 9910, y: 12119, z: 15 },
  { x: 9910, y: 12120, z: 15 },
  { x: 9911, y: 12116, z: 15 },
  { x: 9911, y: 12117, z: 15 },
  { x: 9911, y: 12118, z: 15 },
  { x: 9911, y: 12119, z: 15 },
  { x: 9911, y: 12120, z: 15 },
  { x: 9912, y: 12116, z: 15 },
  { x: 9912, y: 12117, z: 15 },
  { x: 9912, y: 12118, z: 15 },
  { x: 9912, y: 12119, z: 15 },
  { x: 9912, y: 12120, z: 15 } ]