Update the geo-data-exchange dependency with support for gradient normalization
This commit is contained in:
parent
bd1fe58dbf
commit
135340781d
3 changed files with 28 additions and 5 deletions
|
|
@ -167,7 +167,30 @@ BR.Heightgraph = function (map, layersControl, routing, pois) {
|
||||||
} else {
|
} else {
|
||||||
$('#no-elevation-data').hide();
|
$('#no-elevation-data').hide();
|
||||||
}
|
}
|
||||||
var geojsonFeatures = geoDataExchange.buildGeojsonFeatures(track.getLatLngs());
|
var chartWidth;
|
||||||
|
if (document.getElementsByClassName('heightgraph-container').length > 0) {
|
||||||
|
var hgElement = document.getElementsByClassName('heightgraph-container')[0];
|
||||||
|
if (hgElement.getElementsByTagName('g').length > 0) {
|
||||||
|
hgGElement = hgElement.getElementsByTagName('g')[0];
|
||||||
|
if (hgGElement.getElementsByClassName('grid').length > 1) {
|
||||||
|
hgGRectElement = hgGElement.getElementsByClassName('grid')[1];
|
||||||
|
chartWidth = hgGRectElement.getBoundingClientRect().width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if I cannot get the chart width (e.g. the chart is not visible),
|
||||||
|
// get the width of the content element - that's close enough
|
||||||
|
if (typeof chartWidth === 'undefined' || chartWidth === 0) {
|
||||||
|
var contentElement = document.getElementById('content');
|
||||||
|
if (contentElement) {
|
||||||
|
chartWidth = contentElement.getBoundingClientRect().width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var geojsonFeatures = geoDataExchange.buildGeojsonFeatures(track.getLatLngs(), {
|
||||||
|
interpolate: false,
|
||||||
|
normalize: true,
|
||||||
|
chartWidthInPixels: chartWidth,
|
||||||
|
});
|
||||||
this.addData(geojsonFeatures);
|
this.addData(geojsonFeatures);
|
||||||
|
|
||||||
// re-add handlers
|
// re-add handlers
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
"datatables": "1.10.18",
|
"datatables": "1.10.18",
|
||||||
"fit-file-writer": "tbsmark86/fit-file-writer#3eebe13",
|
"fit-file-writer": "tbsmark86/fit-file-writer#3eebe13",
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"geo-data-exchange": "alexcojocaru/geo-data-exchange#v2.0.0",
|
"geo-data-exchange": "alexcojocaru/geo-data-exchange#v2.1.0",
|
||||||
"i18next": "19.9.2",
|
"i18next": "19.9.2",
|
||||||
"i18next-browser-languagedetector": "7.0.2",
|
"i18next-browser-languagedetector": "7.0.2",
|
||||||
"i18next-xhr-backend": "3.2.2",
|
"i18next-xhr-backend": "3.2.2",
|
||||||
|
|
|
||||||
|
|
@ -5632,9 +5632,9 @@ gensync@^1.0.0-beta.2:
|
||||||
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
|
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
|
||||||
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
|
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
|
||||||
|
|
||||||
geo-data-exchange@alexcojocaru/geo-data-exchange#v2.0.0:
|
geo-data-exchange@alexcojocaru/geo-data-exchange#v2.1.0:
|
||||||
version "2.0.0"
|
version "2.1.0"
|
||||||
resolved "https://codeload.github.com/alexcojocaru/geo-data-exchange/tar.gz/f3964028483ce194700f98c3d9c241818b54062b"
|
resolved "https://codeload.github.com/alexcojocaru/geo-data-exchange/tar.gz/aa1a0bc98f0b3f7233ea3dcbc038bf46a99702d9"
|
||||||
dependencies:
|
dependencies:
|
||||||
leaflet "^1.5.0"
|
leaflet "^1.5.0"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue