GithubHelp home page GithubHelp logo

staticmaps-gl's Introduction

StaticMaps-gl

Static map rendering with mapbox-gl. Renders a static map image from a mapbox-gl style, optionally overlaying GeoJSON data sent from the client.

Multiple styles are supported, and must be specified with a config file. For an example config file see backgrounds.json.

Routes

Zoom and Center coordinates

Request a map centered on a given coordinate, and a given zoom level. /zoom/lon/latxwidth/height/background.format Example /10.5/-111/45/200x200/default.png Post data is optional. Zoom levels are based on 512 pixel tiles, so they may be 1 off from expected.

Bounds

Request a map of a specific geographic region. "/bounds/widthxheight/background.format" Bounds is in the formal W,S,E,N. Example: /-110,44,-109,45/100x100/topo.png Post data is optional.

Cover data

Request a map of a region that covers POSTed GeoJSON data. Example: /100x100/topo.png Post data is required. Extent is buffered 10% so data does not touch edges of map.

Styling data

Styling is based on the simplestyle spec. All keys are supported except marker-symbol.

Image format options

The following image formats are supported:

  • png
  • jpg or jpeg
  • webp

jpeg and webp can also specify a quality level, one of:

  • 70
  • 80
  • 90
  • 100

For example .jpg90

Example requests

  • curl -d '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[-111.37939453125,44.61393394730626]}}' -H 'Content-Type: application/json' http://localhost:3000/100x100/default.png

staticmaps-gl's People

Contributors

jessecrocker avatar acannistra avatar dependabot[bot] avatar

Stargazers

Michael Keller avatar Nikita avatar Andrew Chou avatar Doug Mellon avatar 胡实 avatar Johnnie Hård avatar Andy Zeigert avatar Tom Wayson avatar Ivan Storck avatar John Shay avatar Jeffrey Munowitch avatar

Watchers

Ivan Storck avatar PJ Hoberman avatar Adam Tootle avatar Doug Van Horn avatar Aengus McMillin avatar Elizabeth Mezias avatar James Cloos avatar Ariel Weingarten avatar  avatar  avatar Austin Hess avatar  avatar John J Czaplewski avatar Evelyn Cordner avatar Ben Russell avatar Steven Hunt avatar Benjamin Black avatar Jared M. Olson avatar Todd Neumarker avatar  avatar M Wilson avatar

staticmaps-gl's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.