Generate custom marker (icon) out of two images in Leaflet

Posted by Rmatt on Stack Overflow See other posts from Stack Overflow or by Rmatt
Published on 2013-06-10T16:02:33Z Indexed on 2013/06/27 16:21 UTC
Read the original article Hit count: 166

Filed under:
|
|

In Javascript/CoffeeScript, using Leaflet to display a map, I would like to have custom markers out of a two custom images, and also featuring a shadow for the pin :

  1. I want to have a "background" image with a color (or shape) to identify the category
  2. On top, I want to have inside this image a specific image (logo) for each pin

I didn't find out how I could do that... Setting one image is quite easy but I don't know how to overlay them.

I could also consider using a tool to superpose/group/overlay these images (locally ?) before in order to send only one to the Icon Leaflet Class, but also there, I wouldn't know which tool to use.

Nevertheless, I still think that a double overlay would be more efficient and that my case could be useful for several people.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about coffeescript