-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLeaflet.Icon.Chip.js
More file actions
41 lines (28 loc) · 876 Bytes
/
Leaflet.Icon.Chip.js
File metadata and controls
41 lines (28 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
L.Icon.Chip = L.DivIcon.extend({
options: {
iconSize: [12, 8],
iconAnchor: [6, 4],
// 🍂option border: String
// A CSS definition of a border, see https://developer.mozilla.org/docs/Web/CSS/border
border: '#888 solid 1px',
// 🍂option border: String
// A CSS definition of a color, see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
color: 'blue'
},
createIcon: function (oldIcon) {
var div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),
options = this.options;
div.innerHTML = '';
div.style.border = this.options.border;
div.style.borderRadius = '50%';
div.style.background = this.options.color;
this._setIconStyles(div, 'icon');
return div;
},
createShadow: function () {
return null;
}
});
L.icon.chip = function(options) {
return new L.Icon.Chip(options);
};