osm-p2p-vector-tile-server
serve vector tiles for an osm-p2p database
Last updated 4 years ago by gmaclennan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install osm-p2p-vector-tile-server 
SYNC missed versions from official npm registry.

osm-p2p-vector-tile-server

serve vector tiles for an osm-p2p database

example

Here is an example that sets up an OSM http API and vector tile API over the same http server:

var http = require('http')
var osmdb = require('osm-p2p')

var osm = osmdb('/tmp/osm.db')
var osmserver = require('osm-p2p-server')(osm)
var vector = require('osm-p2p-vector-tile-server')(osm)

var server = http.createServer(function (req, res) {
  if (osmserver.handle(req, res)) {}
  else if (vector.handle(req, res)) {}
  else {
    res.statusCode = 404
    res.end('not found\n')
  }
})
server.listen(5000)

api

var vectorTiles = require('osm-p2p-vector-tile-server')

var vector = vectorTiles(osm)

Create a vector tile server handler vector from an osm-p2p handle osm.

var m = vector.match(method, url)

Return a match object if method and url comprise a valid tile server request.

var m = vector.handle(req, res)

Respond to incoming requests for tile geometry.

Returns a match object or null if the request was not a a recognized tile server request.

install

npm install osm-p2p-vector-tiles

license

MIT

Current Tags

  • 2.1.1                                ...           latest (4 years ago)

5 Versions

  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |