Skip to content

Commit

Permalink
Allow to define a human readable label (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
boldtrn authored Oct 21, 2020
1 parent b29850f commit e934e6c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/L.Control.Heightgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -4953,7 +4953,7 @@ var schemeSet3 = colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9b
this._categories[y] = {
info: {
id: y,
text: data[y].properties.summary
text: data[y].properties.label || data[y].properties.summary
},
distances: [],
attributes: [],
Expand Down
2 changes: 1 addition & 1 deletion dist/L.Control.Heightgraph.min.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions example/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,8 @@ const geojson1 = [{
"properties": {
"Creator": "OpenRouteService.org",
"records": 10,
"summary": "surface"
"summary": "surface",
"label": "Surface"
}
}, {
"type": "FeatureCollection",
Expand Down Expand Up @@ -3118,7 +3119,8 @@ const geojson1 = [{
"properties": {
"Creator": "OpenRouteService.org",
"records": 42,
"summary": "waytypes"
"summary": "waytypes",
"label": "Waytypes"
}
}, {
"type": "FeatureCollection",
Expand Down Expand Up @@ -4734,7 +4736,8 @@ const geojson1 = [{
"properties": {
"Creator": "OpenRouteService.org",
"records": 31,
"summary": "steepness"
"summary": "steepness",
"label": "Steepness"
}
}, {
"type": "FeatureCollection",
Expand Down Expand Up @@ -6405,6 +6408,7 @@ const geojson1 = [{
"properties": {
"Creator": "OpenRouteService.org",
"records": 36,
"summary": "suitability"
"summary": "suitability",
"label": "Suitability"
}
}];
2 changes: 1 addition & 1 deletion src/L.Control.Heightgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ import {
this._categories[y] = {
info : {
id: y,
text: data[y].properties.summary
text: data[y].properties.label || data[y].properties.summary
},
distances: [],
attributes: [],
Expand Down

0 comments on commit e934e6c

Please sign in to comment.