Skip to content

Commit 890ab36

Browse files
committed
combined tooltip update for lines
1 parent 513b7db commit 890ab36

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

examples/combined.html

+20
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,26 @@
154154
layer.on('mousemove',e=>{
155155
e.target.getTooltip().setLatLng(e.latlng);
156156
});
157+
158+
// line highlighting
159+
var origstyle;
160+
function highlight(e) {
161+
origstyle = {
162+
weight: e.target.options.weight,
163+
color: e.target.options.color
164+
}
165+
e.target.setStyle({
166+
color: '#f22',
167+
});
168+
}
169+
function resetStyle(e) {
170+
e.target.setStyle(origstyle);
171+
}
172+
layer.on({
173+
mouseover: highlight,
174+
mouseout: resetStyle
175+
});
176+
// line highlighting end
157177
}
158178
window.testdata3 = L.dataClassification(d, {
159179
mode: 'quantile',

0 commit comments

Comments
 (0)