Last active
August 29, 2015 14:20
-
-
Save dermidgen/e9fcb7dd0444261e7aa1 to your computer and use it in GitHub Desktop.
MapSymbol
This file contains hidden or 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
var MapSymbol = function() { | |
var canvas = document.createElement("canvas"); | |
var context = canvas.getContext("2d"); | |
canvas.width = width; | |
canvas.height = height; | |
context.clearRect(0,0,width,height); | |
context.save(); | |
context.beginPath(); | |
context.moveTo(0,0); | |
context.lineTo(22,0); | |
context.lineTo(22,40); | |
context.lineTo(0,40); | |
context.closePath(); | |
context.clip(); | |
context.strokeStyle = 'rgba(0,0,0,0)'; | |
context.lineCap = 'butt'; | |
context.lineJoin = 'miter'; | |
context.miterLimit = 4; | |
context.save(); | |
context.restore(); | |
context.save(); | |
g=context.createLinearGradient(5.3190681888719995,3.5232152743890004,17.017566652959996,18.730766765250003); | |
g.addColorStop(0,"rgba(6, 220, 6, 1)"); | |
g.addColorStop(1,"rgba(41, 161, 41, 1)"); | |
context.fillStyle = g; | |
context.strokeStyle = "rgba(10, 130, 10, 1)"; | |
context.lineWidth = 0.9859549403190613; | |
context.lineCap = "butt"; | |
context.lineJoin = "miter"; | |
context.beginPath(); | |
context.moveTo(10.977,39.409); | |
context.bezierCurveTo(8.9774,19.967,0.4770000000000003,18.023,0.4770000000000003,10.245999999999999); | |
context.bezierCurveTo(0.4770000000000003,7.7010999999999985,1.5548000000000004,5.171799999999998,3.406,3.3722999999999983); | |
context.bezierCurveTo(5.2572,1.5727999999999982,8.3591,0.5250999999999983,10.9771,0.5250999999999983); | |
context.bezierCurveTo(13.5951,0.5250999999999983,16.697,1.5727999999999984,18.5482,3.3722999999999983); | |
context.bezierCurveTo(20.399400000000004,5.171799999999998,21.4772,7.7010999999999985,21.4772,10.245999999999999); | |
context.bezierCurveTo(21.4772,18.0227,12.9771,19.9669,10.9772,39.409); | |
context.closePath(); | |
context.fill(); | |
context.stroke(); | |
context.restore(); | |
context.save(); | |
context.fillStyle = "rgba(0, 60, 0, 1)"; | |
context.strokeStyle = "rgba(0, 241, 0, 1)"; | |
context.beginPath(); | |
context.moveTo(14.663,9.9592); | |
context.bezierCurveTo(14.663,11.938099999999999,13.0127,13.5423,10.9769,13.5423); | |
context.bezierCurveTo(8.9411,13.5423,7.290800000000001,11.938099999999999,7.290800000000001,9.9592); | |
context.bezierCurveTo(7.290800000000001,7.9803,8.9411,6.376099999999999,10.9769,6.376099999999999); | |
context.bezierCurveTo(13.0127,6.376099999999999,14.663,7.9803,14.663,9.9592); | |
context.closePath(); | |
context.fill(); | |
context.stroke(); | |
context.restore(); | |
context.restore(); | |
return canvas.toDataURL(); | |
}; |
Author
dermidgen
commented
May 6, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment