Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
slippy-tile
Advanced tools
Slippy Tile helps parse a Tile scheme URL from a given Tile [x, y, zoom].
$ npm install --save slippy-tile
import slippyTile from 'slippy-tile'
const tile = [10, 15, 8] // x, y, zoom
const url = slippyTile(tile, 'osm')
//= https://b.tile.openstreetmap.org/8/10/15.png
Name | Unique Key |
---|---|
OpenStreetMap Standard | osm.standard |
OpenStreetMap Cycle Map | osm.cycle |
OpenStreetMap Humanitarian | osm.hot |
OpenStreetMap Transport | osm.transport |
OpenStreetMap Wikimedia | osm.wikimedia |
OpenStreetMap Lyrk | osm.lyrk |
Bing Imagery | bing.imagery |
Strava Cycling & Running | strava.both |
National Geographic World Map | esri.natgeo |
ESRI Imagery | esri.imagery |
ESRI Ocean Basemap | esri.ocean |
ESRI USA Topo Maps | esri.usatopo |
ESRI World Street Map | esri.street |
ESRI World Topographic Map | esri.topo |
DigitalGlobe Imagery | digitalglobe.imagery |
DigitalGlobe Hybrid | digitalglobe.hybrid |
You can provide your own scheme by following the same syntax as JOSM.
const scheme = 'https://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png'
const url = slippyTile.parse([10, 15, 8], scheme)
//= https://b.tile.openstreetmap.org/8/10/15.png
Options
{x}
or {TileColumn}
: Tile Column{y}
or {TileRow}
: Tile Row for Google Maps Compatible scheme{-y}
: Tile Row for TMS scheme{zoom}
or {z}
or {TileMatrix}
: Zoom Level{bbox}
: GeoJSON Bounding Box{quadkey}
or {q}
: Microsoft's Quadkey{switch:1,2,3}
: Selects a random sample{height}
default = 256{width}
: default = 256{proj}
: default = EPSG:3857Substitutes the given tile information [x, y, z] to the URL tile scheme.
Parameters
Examples
const tile = [10, 15, 8]
const url = 'https://{s}.tile.openstreetmap.org/{zoom}/{x}/{y}.png'
slippyTile.parse(tile, url)
//='https://c.tile.openstreetmap.org/8/10/15.png'
Returns string
Parse WMS URL to friendly SlippyTile format
Parameters
Examples
const tile = [10, 15, 8]
const url = 'https://<Tile Server>/?layers=imagery&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}'
slippyTile.wmts(tile, url)
//='https://<Tile Server>/?layers=imagery&SRS=EPSG:3857&WIDTH=256&HEIGHT=256&BBOX=-165.9375,82.676285,-164.53125,82.853382'
Returns string
Parse WMTS URL to friendly SlippyTile URL format
Parameters
url
string WMTS URL schemeExamples
const url = 'https://<Tile Server>/WMTS/tile/1.0.0/Imagery/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg'
slippyTile.wmts(url)
//='https://<Tile Server>/WMTS/tile/1.0.0/Imagery/default/GoogleMapsCompatible/{z}/{y}/{x}.jpg'
Returns string
Replaces {switch:a,b,c} with a random sample.
Parameters
url
string URL SchemeExamples
import * as slippyTile from 'slippy-tile'
slippyTile.parseSwitch('http://tile-{switch:a,b,c}.openstreetmap.fr/hot/{zoom}/{x}/{y}.png')
//='http://tile-b.openstreetmap.fr/hot/{zoom}/{x}/{y}.png'
Returns string Parsed URL with switch replaced
Sample an item from a given list
Parameters
collection
Array<any> List of itemsExamples
slippyTile.sample(['a', 'b', 'c'])
//='b'
Returns any Single item from the list
sample
{TileColumn}
, {TileRow}
& {TileMatrix}
parse
{s}
to switch cases as default ['a', 'b', 'c']
js-yaml
dependencyrequest
related dependenciesdownload
methodsource.json
to providers.yml
url
download
featureFirst Stable release of slippy-tile
.
FAQs
Helps convert Slippy Map url tile schemas
The npm package slippy-tile receives a total of 4 weekly downloads. As such, slippy-tile popularity was classified as not popular.
We found that slippy-tile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.