Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static map and tile server #18

Open
3 of 7 tasks
ear7h opened this issue Sep 17, 2018 · 2 comments
Open
3 of 7 tasks

Static map and tile server #18

ear7h opened this issue Sep 17, 2018 · 2 comments
Assignees

Comments

@ear7h
Copy link
Collaborator

ear7h commented Sep 17, 2018

Tile server

  • z, x, y tiles
  • caching middlewear
  • config file

static map server

  • define an api (@ARolek)
  • write the api
  • caching?
  • config file
@ear7h ear7h self-assigned this Sep 17, 2018
@ARolek
Copy link
Member

ARolek commented Sep 17, 2018

Raster Tile Server API (WIP)

/styles/:style-name/tiles/[tilesize]/:z/:x/:y[@2x].[file-extension]

  • style-name [required]: the name of the style. If loaded via the command line the style name will be “default”. If loaded via a config file the name of the style to reference.
  • tilesize [optional]: Default is 512x512 pixels. (512x512 image tiles are offset by 1 zoom level compared to 256x256 tiles. For example, 512x512 tiles at zoom level 4 are equivalent to 256 tiles at zoom level 5.) 256x256 tiles from the endpoint are one quarter of the size of 512x512 tiles.
  • z [required]: the zoom
  • x [required]: the x coordinate (column) in the slippy tile scheme.
  • y [required]: the y coordinate (row) in the slippy tile scheme.
  • @2x [optional]: to serve high definition (retina) tiles. Omit to serve standard definition tiles.
  • file-extension [optional]: the file type to encode the raster image in. Can be png, jpg or webp. Defaults to jpg.

Questions

  • What should the default tile size be? Mapbox defaults to 512x512 and offsets the zoom by 1. Per their docs:

Default is 512x512 pixels. (512x512 image tiles are offset by 1 zoom level compared to 256x256 tiles from Mapbox Studio Classic styles. For example, 512x512 tiles at zoom level 4 are equivalent to Mapbox Studio Classic styles tiles at zoom level 5.) 256x256 tiles from the endpoint are one quarter of the size of 512x512 tiles. Therefore, they require 4 times as many API requests and accumulate 4 times as many map views to render the same area.

Static map server (WIP)

This API largely follows the Mapbox Static Maps API

/styles/:style-name/static/:lon,:lat,:zoom,[:bearing],[:pitch]/:widthx:height[@2x][.:file-extension]

  • style-name [required]: the name of the style. If loaded via the command line the style name will be “default”. If loaded via a config file the name of the style to reference.
  • lon [required]: Longitude for the center point of the static map; a number between -180 and 180.
  • lat [required]: Latitude for the center point of the static map; a number between -90 and 90 .
  • zoom [required]: Zoom level; a number between 0 and 20 . Fractional zoom levels will be rounded to two decimal places.
  • bearing [optional]: Bearing rotates the map around its center. A number between 0 and 360 , interpreted as decimal degrees. 90 rotates the map 90° clockwise, while 180 flips the map. Defaults to 0.
  • pitch [pitch]: Pitch tilts the map, producing a perspective effect. A number between 0 and 60 , measured in degrees. Defaults to 0 (looking straight down at the map).
  • width [required]: Width of the image; a number between 1 and 1280 pixels.
  • height [required]: Height of the image; a number between 1 and 1280 pixels.
  • @2x [optional]: to serve high definition (retina) tiles. Omit to serve standard definition tiles.
  • file-extension [optional]: the file type to encode the raster image in. Can be png, jpg or webp. Defaults to jpg.

@ARolek
Copy link
Member

ARolek commented Sep 17, 2018

Talked with @jj0hns0n and we should support 256 tiles. Should that be the default? Maybe not but a tilesize parameter should be available in some way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants