Print Control - Add custom toggle switches
Good morning, which way do you recommend for adding custom toggle switches in print control?
How is the behavior of the new toggle switch set?
It's up to you. Toggle Switch is just ahelper to create checkbox using CSS to encapsulate a checkbox. You can use it as a standard checkbox.
It is this? https://viglino.github.io/ol-ext/doc/doc-pages/ol.ext.input.Switch.html
How do I use it and how do I add control to print control?
You can use the helper to create a Switch:
var check = ol.ext.element.createSwitch({
html: 'test',
className: 'test',
checked: false,
on: {
change: function (e) {
console.log(e.target.checked)
}
},
parent: printControl.getUserElement()
})
There is a user Element you can use to place more info in the print dialog.
It works perfectly.
Thank you.