Skip to content

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

varcanvas=document.createElement('canvas');document.body.appendChild(canvas)canvas.width=512;canvas.height=512;varurl='https://example.com/{z}/{x}/{y}.png';varlon=7.438639;varlat=46.951083;varzoom=15;varstaticMap=StaticMap(url);staticMap.getMap(canvas,lon,lat,zoom);

See also

About

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

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages