@mapbox/whoots-js

WebJar for @mapbox/whoots-js

License

License

ISC
Categories

Categories

JavaScript Languages
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

mapbox__whoots-js
Last Version

Last Version

3.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

@mapbox/whoots-js
WebJar for @mapbox/whoots-js
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mapbox/whoots-js

Download mapbox__whoots-js

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mapbox__whoots-js/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mapbox__whoots-js</artifactId>
    <version>3.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mapbox__whoots-js/
implementation 'org.webjars.npm:mapbox__whoots-js:3.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/mapbox__whoots-js/
implementation ("org.webjars.npm:mapbox__whoots-js:3.1.0")
'org.webjars.npm:mapbox__whoots-js:jar:3.1.0'
<dependency org="org.webjars.npm" name="mapbox__whoots-js" rev="3.1.0">
  <artifact name="mapbox__whoots-js" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mapbox__whoots-js', version='3.1.0')
)
libraryDependencies += "org.webjars.npm" % "mapbox__whoots-js" % "3.1.0"
[org.webjars.npm/mapbox__whoots-js "3.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

npm version Build Status Coverage Status

whoots-js

Request tiles from WMS servers that support EPSG:3857.

This project is a JavaScript port of https://github.com/timwaters/whoots by Tim Waters.

What is it?

Given a z/x/y tile coordinate like 19/154308/197167, whoots-js can request imagery from an EPSG:3857 supporting WMS server like this:

https://img.nj.gov/imagerywms/Natural2015?
  bbox=-8242663.382160267,4966572.349857613,-8242586.945131982,4966648.786885899
  &format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857
  &width=256&height=256&layers=Natural2015

Usage

var WhooTS = require('@mapbox/whoots-js');

// Get an image url for a given tile coordinate
var baseUrl = 'https://img.nj.gov/imagerywms/Natural2015';
var layer = 'Natural2015';
var url = WhooTS.getURL(baseUrl, layer, 154308, 197167, 19);

Server

This project includes a sample redirecting wms proxy server in server.js.

npm run start will start a local server on port 8080 that redirects tile requests.

Valid tile requests look like:

http://localhost:8080/tms/{z}/{x}/{y}/{layer}/{endpoint}
http://localhost:8080/tms/19/154308/197167/Natural2015/https://img.nj.gov/imagerywms/Natural2015

Documentation

Complete API documentation is here: http://mapbox.github.io/whoots-js/

org.webjars.npm

Mapbox

Mapbox is the location data platform for mobile and web applications. We're changing the way people move around cities and explore our world.

Versions

Version
3.1.0
3.0.0