Skip to content

Commit

Permalink
Merge pull request #14 from ghybs/patch-1
Browse files Browse the repository at this point in the history
Added leaflet-marker-icon/shadow class
  • Loading branch information
coryasilva committed Nov 13, 2015
2 parents 496fdbf + 98f3a3c commit 02d98f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/leaflet.extra-markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,21 @@
_setIconStyles: function (img, name) {
var options = this.options,
size = L.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']),
anchor;
anchor, leafletName;

if (name === 'shadow') {
anchor = L.point(options.shadowAnchor || options.iconAnchor);
leafletName = 'shadow';
} else {
anchor = L.point(options.iconAnchor);
leafletName = 'icon';
}

if (!anchor && size) {
anchor = size.divideBy(2, true);
}

img.className = 'extra-marker-' + name + ' ' + options.className;
img.className = 'leaflet-marker-' + leafletName + ' extra-marker-' + name + ' ' + options.className;

if (anchor) {
img.style.marginLeft = (-anchor.x) + 'px';
Expand Down

0 comments on commit 02d98f1

Please sign in to comment.