Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sodra/ak-draw-canvas

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sodra/ak-draw-canvas

Draw map on canvas. Fetches vector tiles from specified url.

  • 1.2.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

ak-draw-canvas

Draw map on canvas. Fetches vector tiles from specified url.

To be used both in the browser and on the server (requires node-canvas).

Install

$ npm install @sodra/ak-draw-canvas

Usage

let Canvas = require('canvas'),
    styles = require('@sodra/ak-styles')

let drawCanvas = require('@sodra/ak-draw-canvas')({
  url: '<vtiles-url>',
  createCanvas: function (width, height) {
    return new Canvas(width, height)
  }
})

let params = {
  lat: 63.82621,
  lng: 20.261364,
  zoom: 19,
  width: 1000,
  height: 1400
}

let style = styles['pop-teal-marsala']

drawCanvas(params, style, function (err, canvas) {
  // use canvas
})
 

In the browser "new Canvas()" is not available:

let drawCanvas = require('@sodra/ak-draw-canvas')({
  url: '<vtiles-url>',
  createCanvas: function (width, height) {
    let canvas = document.createElement('canvas')
    canvas.width = width
    canvas.height = height
    return canvas
  }
})

FAQs

Package last updated on 11 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc