Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Overpass request #50

Merged
merged 3 commits into from
Apr 6, 2020
Merged

Introduce Overpass request #50

merged 3 commits into from
Apr 6, 2020

Conversation

braktar
Copy link
Contributor

@braktar braktar commented Apr 6, 2020

Related to issue #49

src/data.js Outdated
@@ -9,6 +9,8 @@ var jobsMarkers = {};
// Stored with vehicle id + {_start,_end} as key
var vehiclesMarkers = {};

var overpass = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could avoid storing the Overpass result if it's used directly in the ovepass.js callback.

src/data.js Outdated
@@ -18,5 +20,6 @@ module.exports = {
maxVehicleId: maxVehicleId,
vehicles: vehicles,
jobsMarkers: jobsMarkers,
vehiclesMarkers: vehiclesMarkers
vehiclesMarkers: vehiclesMarkers,
overpass: overpass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if we use the Overpass result directly in the ovepass.js callback.

@@ -175,6 +186,7 @@ var clearData = function() {
data.vehicles = [];
data.jobsMarkers = {};
data.vehiclesMarkers = {};
data.overpass = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if we use the Overpass result directly in the ovepass.js callback.

Comment on lines 669 to 672
var setOverpassOutput = function(output) {
data.overpass = output;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if we use the Overpass result directly in the ovepass.js callback.

Comment on lines 677 to 680
var getOverpassOutput = function() {
return data.overpass;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed if we use the Overpass result directly in the ovepass.js callback.

Comment on lines 12 to 13
dataHandler.setOverpassOutput(JSON.parse(xhttp.response));
applyResponse();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move the body of applyResponse here in order to use the Overpass result directly rather than storing it.

@jcoupey
Copy link
Contributor

jcoupey commented Apr 6, 2020

Thanks for submitting this PR! It fits really nicely into the existing code and really makes it much easier to use the demo.

@jcoupey jcoupey merged commit 0fd03c5 into VROOM-Project:master Apr 6, 2020
@jcoupey jcoupey mentioned this pull request Apr 6, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants