Use Heightgraph transpiled

This commit is contained in:
alexcojocaru 2020-10-23 13:02:46 -07:00
parent 5fd3977768
commit 77ed28cb76
3 changed files with 236 additions and 238 deletions

View file

@ -1,4 +1,5 @@
BR.Heightgraph = L.Control.Heightgraph.extend({
BR.Heightgraph = function(map, layersControl, routing, pois) {
Heightgraph = L.Control.Heightgraph.extend({
options: {
width: $('#map').outerWidth(),
margins: {
@ -118,9 +119,9 @@ BR.Heightgraph = L.Control.Heightgraph.extend({
this.addData(geojsonFeatures);
// TODO
/*
var geojson = track.toGeoJSON();
geojson.properties = { attributeType: 0 };
var data = [
var geojson = track.toGeoJSON();
geojson.properties = { attributeType: 0 };
var data = [
{
type: 'FeatureCollection',
features: [geojson],
@ -130,9 +131,9 @@ var data = [
summary: 'gradient'
}
}
];
this.addData(data);
*/
];
this.addData(data);
*/
// re-add handlers
if (layer) {
@ -174,13 +175,13 @@ this.addData(data);
var currentGradient = dist == 0 ? 0 : this._mapGradient(currentGradientPercentage);
// TODO
/*
console.log("gradient %:", currentGradientPercentage,
console.log("gradient %:", currentGradientPercentage,
"; gradient level:", currentGradient,
"; dist:", dist,
"; alt:", altDelta,
"; previous point:", previousPoint.lng, previousPoint.lat, previousPoint.alt,
"; current point:", currentPoint.lng, currentPoint.lat, currentPoint.alt);
*/
*/
var coordinate = [currentPoint.lng, currentPoint.lat, currentPoint.alt];
@ -252,4 +253,8 @@ console.log("gradient %:", currentGradientPercentage,
return 5;
}
}
});
});
var heightgraphControl = new Heightgraph();
return heightgraphControl;
};

View file

@ -46,7 +46,6 @@
"bootstrap-select": "1.13.6",
"bootstrap-slider": "^9.8.1",
"codemirror": "^5.35.0",
"d3": "~3.5.5",
"datatables": "~1.10.18",
"font-awesome": "^4.7.0",
"i18next": "^15.0.4",
@ -175,11 +174,10 @@
},
"leaflet.heightgraph": {
"main": [
"src/L.Control.Heightgraph.js",
"dist/L.Control.Heightgraph.js",
"src/L.Control.Heightgraph.css",
"src/img/*.svg"
],
"dependencies": null
"dist/img/*.svg"
]
},
"leaflet-control-geocoder": {
"main": [

View file

@ -2552,11 +2552,6 @@ d3-voronoi@1.1.2:
resolved "https://registry.yarnpkg.com/d3-voronoi/-/d3-voronoi-1.1.2.tgz#1687667e8f13a2d158c80c1480c5a29cb0d8973c"
integrity sha1-Fodmfo8TotFYyAwUgMWinLDYlzw=
d3@~3.5.5:
version "3.5.17"
resolved "https://registry.yarnpkg.com/d3/-/d3-3.5.17.tgz#bc46748004378b21a360c9fc7cf5231790762fb8"
integrity sha1-vEZ0gAQ3iyGjYMn8fPUjF5B2L7g=
d@1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"