-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDashElement.js
More file actions
31 lines (27 loc) · 1.06 KB
/
DashElement.js
File metadata and controls
31 lines (27 loc) · 1.06 KB
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
/**
* FormElement used for styling the dash attribute
*/
import 'leaflet'
export default function setupDashElement () {
L.StyleEditor.formElements.DashElement = L.StyleEditor.formElements.FormElement.extend({
/** create the three standard dash options */
createContent: function () {
let uiElement = this.options.uiElement
let stroke = L.DomUtil.create('div', 'leaflet-styleeditor-stroke', uiElement)
stroke.style.backgroundPosition = '0px -75px'
L.DomEvent.addListener(stroke, 'click', function () {
this.setStyle('1')
}, this)
stroke = L.DomUtil.create('div', 'leaflet-styleeditor-stroke', uiElement)
stroke.style.backgroundPosition = '0px -95px'
L.DomEvent.addListener(stroke, 'click', function () {
this.setStyle('10, 10')
}, this)
stroke = L.DomUtil.create('div', 'leaflet-styleeditor-stroke', uiElement)
stroke.style.backgroundPosition = '0px -115px'
L.DomEvent.addListener(stroke, 'click', function () {
this.setStyle('15, 10, 1, 10')
}, this)
}
})
}