Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

slippy-tile

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slippy-tile

Helps convert Slippy Map url tile schemas

  • 4.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Slippy Tile

Build Status npm version Coverage Status MIT licensed ES5

Standard - JavaScript Style Guide

Slippy Tile helps parse a Tile scheme URL from a given Tile [x, y, zoom].

Install

npm

$ npm install --save slippy-tile

web

<script src="https://wzrd.in/standalone/slippy-tile@latest"></script>

Quickstart

var slippyTile = require('slippy-tile')
var tile = [10, 15, 8] // [x, y, zoom]
var scheme = 'https://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png'
var url = slippyTile(tile, scheme)
//= https://b.tile.openstreetmap.org/8/10/15.png

Scheme

You can provide your own scheme by following the same syntax as JOSM.

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
  • {bbox4326}: GeoJSON Bounding Box using EPSG:4326 (WGS84)
  • {bbox3857}: GeoJSON Bounding Box using EPSG:3857 (World Mercator)
  • {quadkey} or {q}: Microsoft's Quadkey
  • {switch:1,2,3}: Selects a random sample
  • {height} default = 256
  • {width}: default = 256
  • {size}: default = 256,256
  • {proj}: default = EPSG:3857
  • {format}: default = image/png

API

slippyTile

Substitutes the given tile information [x, y, z] to the URL tile scheme.

Parameters

  • tile Tile Tile [x, y, z]
  • url string URL Tile scheme or provider unique key
  • options Object Additional params Examples
slippyTile([10, 15, 8], 'https://{s}.tile.openstreetmap.org/{zoom}/{x}/{y}.png')
//='https://c.tile.openstreetmap.org/8/10/15.png'

Returns string parsed URL

Keywords

FAQs

Package last updated on 21 Feb 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc