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

@davvo/ak-draw-canvas

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@davvo/ak-draw-canvas

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

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
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 @davvo/ak-draw-canvas

Usage

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

let drawCanvas = require('@davvo/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('@davvo/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 09 Mar 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