Polyline options
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start at the L.EditControl.onAdd entry point shown in the issue, especially the callback invocation that creates the polyline. Reproduce the reported error and trace how callback arguments are handled; done should mean the control can pass polyline options such as weight without producing the error.
Written by the indexing model from the issue text.
Description
Is it possible to add some options to polyline, created by control?
For example, window.LAYER = this.options.callback.call(map.editTools,{weight: 5});
in code
L.EditControl = L.Control.extend({
options: {
position: 'bottomright',
callback: null,
kind: '',
html: ''
},
onAdd: function (map) {
var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'),
link = L.DomUtil.create('a', '', container);
link.href = '#';
link.title = 'Create a new ' + this.options.kind;
link.innerHTML = this.options.html;
L.DomEvent.on(link, 'click', L.DomEvent.stop)
.on(link, 'click', function () {
window.LAYER = this.options.callback.call(map.editTools,{weight: 5});
}, this);
return container;
}
});
L.NewLineControl = L.EditControl.extend({
options: {
position: 'topleft',
callback: map.editTools.startPolyline,
kind: 'line',
html: '\\/\\',
}
});
produce error.
- Dominant language
- JavaScript
- Stars
- 606
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Leaflet/Leaflet.Editable
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Leaflet/Leaflet.Editable#151 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Leaflet/Leaflet.Editable#230 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Leaflet/Leaflet.Editable#229 ·
-
1 Open
Difficulty 5/5 Over a week Newbie friendliness 5/100
Leaflet/Leaflet.Editable#227 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Leaflet/Leaflet.Editable#224 · 2 comments ·
All issues in Leaflet/Leaflet.Editable
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100