Socket
Socket
Sign inDemoInstall

ig_markerfactory

Package Overview
Dependencies
0
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ig_markerfactory

[![Build Status](https://travis-ci.org/HuasoFoundries/ig_markerfactory.svg)](https://travis-ci.org/HuasoFoundries/ig_markerfactory) [![Code Climate](https://codeclimate.com/github/HuasoFoundries/ig_markerfactory/badges/gpa.svg)](https://codeclimate.com/gi


Version published
Weekly downloads
4
decreased by-66.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

IG MarkerFactory: uses a canvas element to create images on the fly, specially taylored for Google Maps API.

Build Status Code Climate Codacy Badge

Uses canvas to dynamically generate marker images suitable for use with google maps. It renders nice looking badges in the front by combining overlaying text on top of canvas rendered background. Those text can be SVG images such as Font-Awesome, Fontello, etc.

Installation

Install it with jspm like so:

jspm install github:huasofoundries/ig_markerfactory

If you don't use jspm, you can as well clone this repo and copy dist/markerfactory.js to your project.

Usage

This is a simple example using AMD loading:

	define(['huasofoundries/ig_markerfactory'], function(MarkerFactory) {

		var myIcon = MarkerFactory.autoIcon({
			label: 'f1b9',
			font: 'fontawesome-webfont',
			color: '#CC0000',
			fontsize: 20
			});

		console.log(myIcon);

	});

The myIcon object is a valid google.maps.Icon object, but of course you might want the image for other purposes so you can just use myIcon.url which is a data URI

Examples:

	define(['huasofoundries/ig_markerfactory'], function(MarkerFactory) {

		var myIcon = MarkerFactory.autoIcon({
			label: 'f1b9',
			font: 'fontawesome-webfont',
			color: '#CC0000',
			fontsize: 20
			});

		console.log(myIcon);

	});

You'll see that myimage.url is a data url you can use as the SRC attribute of the image.

FAQs

Last updated on 04 Jul 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc