Skip to content

rkaravia/static-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

static-map

Render map tiles in a canvas, given a slippy map tile URL.

Demo

The demo renders 512x512px of OpenStreetMap.

Install

$ npm install @rz0/static-map

Usage

var canvas = document.createElement('canvas');
document.body.appendChild(canvas)
canvas.width = 512;
canvas.height = 512;

var url = 'https://example.com/{z}/{x}/{y}.png';
var lon = 7.438639;
var lat = 46.951083;
var zoom = 15;
var staticMap = StaticMap(url);
staticMap.getMap(canvas, lon, lat, zoom);

See also

About

Render map tiles in a canvas, given a slippy map tile URL.

Resources

License

Stars

Watchers

Forks

Packages

No packages published