Created
March 28, 2011 16:45
-
-
Save andrewxhill/890806 to your computer and use it in GitHub Desktop.
canvas marker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderMarkers: function(w,h,error){ | |
var cnvs = $("<canvas width="+w+" height="+h+">"); | |
var ctx = cnvs[0].getContext("2d"); | |
ctx.drawImage(this.pmBackground, 0, 0, w, h); | |
if (this.type){ | |
ctx.drawImage(this.pmType, 0, 0, w, h); | |
} | |
if (error){ | |
ctx.drawImage(this.pmError, 0, 0, w, h); | |
} | |
ctx.drawImage(this.pmForeground, 0, 0, w, h); | |
var dataURL = cnvs[0].toDataURL("image/png"); | |
return dataURL; | |
}, | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment