Friday, December 9, 2011

Creating a custom google maps marker with canvas

Generating a custom marker with canvas is handy when you want to change the marker size/color dynamically.

The following code snippet contains a 'createMarker' function that creates a canvas, draws the marker graphics and returns back the Data URL encoded version of that canvas which can be used as an input at the marker creation.

See the example below.

4 comments:

  1. hey, thanks for this. i found it very helpful. i am designing a map site that uses markers to show rain totals for particular regions. This works great.

    ReplyDelete
  2. I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. https://hispeedlaser.com/laser-cleaning-machine-laser-rust-removal-machine/

    ReplyDelete
  3. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. the page

    ReplyDelete
  4. A debt of gratitude is in order for each other instructive site. The spot else might just I get that sort of data written in such a perfect means? I have an endeavor that I'm quite recently working on, and I have been watchful for such data. Custom Boxes with logo

    ReplyDelete