Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"rules": {
"no-unused-vars": 2,
"no-undef": 2,
"indent": [1, 4],
"strict": [
2,
"function"
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<link rel="stylesheet" href="https://npmcdn.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/src/easy-button.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">

<script src="bundle.js"></script>
<title>d&eacute;rive.</title>
Expand Down
14,410 changes: 5,507 additions & 8,903 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,11 @@
"leaflet-easybutton": "^2.3.0",
"leaflet-image": "^0.4.0",
"leaflet-providers": "^1.13.0",
"pako": "^1.0.6",
"picomodal": "^3.0.0",
"skiz-parser": "^1.4.0",
"xml2js": "^0.4.19"
"skiz-parser": "^1.4.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-rc.1",
"@babel/preset-env": "^7.0.0-rc.1",
"babel-loader": "^8.0.0-beta.4",
"babel-polyfill": "^6.26.0",
"css-loader": "^1.0.0",
"eslint": "^5.3.0",
"style-loader": "^0.22.1",
"webpack": "^4.16.5",
"webpack-cli": "^3.1.0",
"webpack-serve": "^2.0.2"
Expand Down
27 changes: 1 addition & 26 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '../style.css';

import GpxMap from './map';
import {initialize} from './ui';

Expand All @@ -11,27 +9,4 @@ function app() {
initialize(map);
}


// Safari (and probably some other older browsers) don't support canvas.toBlob,
// so polyfill it in.
//
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#Polyfill
if (!HTMLCanvasElement.prototype.toBlob) {
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value (callback, type, quality) {

let binStr = atob(this.toDataURL(type, quality).split(',')[1]);
let len = binStr.length;
let arr = new Uint8Array(len);

for (var i = 0; i < len; i++ ) {
arr[i] = binStr.charCodeAt(i);
}

callback(new Blob([arr], {type: type || 'image/png'}));
}
});
}


document.addEventListener('DOMContentLoaded', app);
document.addEventListener('DOMContentLoaded', app);
8 changes: 4 additions & 4 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ export default class GpxMap {
// dividing), and reducing by removing duplicates (when two
// consecutive points have rounded to the same value)
let pts = track.points.map(ll =>
this.map.project(ll)
.multiplyBy(scale*10)
.round()
.divideBy(10)
this.map.project(ll)
.multiplyBy(scale*10)
.round()
.divideBy(10)
).reduce((acc,next) => {
if (acc.length === 0 ||
acc[acc.length-1].x !== next.x ||
Expand Down
Loading
Loading