IG MarkerFactory
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 myimage = MarkerFactory.autoIcon({
label: 'f1b9',
font: 'fontawesome-webfont',
color: '#CC0000',
fontsize: 20
});
console.log({myimage:myimage});
});
You'll see that myimage.url
is a data url you can use as the SRC attribute of the image.