conveyal / browsochrones

Create isochrones and accessibility images in the browser
MIT License
6 stars 2 forks source link

generateDestinationData doesn't work correctly in webpack #81

Open Xin-Zheng opened 7 years ago

Xin-Zheng commented 7 years ago

Here is the code for moveDestination. There are two problems when I use it in webpack.

async moveDestination(e) {
    let destination = e.target.getLatLng();
    let zoom = e.target._map._zoom;
    const point = this.bs.pixelToOriginPoint(Leaflet.CRS.EPSG3857.latLngToPoint(destination, zoom), zoom);
    let { transitive, travelTime, waitTime, walkTime, inVehicleTravelTime } = await this.bs.generateDestinationData({from: this.state.origin, to:point});
    this.setState({ ...this.state, transitive, travelTime, walkTime, waitTime, inVehicleTravelTime, key: uuid.v4() })
  }

browsochrones bug

trevorgerhardt commented 7 years ago

Hi @Xin-Zheng! What data set are you using to run into these problems? Are you running into this problem when using the example code?

Xin-Zheng commented 7 years ago

Hi @trevorgerhardt, I request the data from MIT server. The isochrone works fine but transitive path doesn't work. I think that is not a problem with the data I used. Because I try browsochrones-example (https://github.com/conveyal/browsochrones-example) and request exactly the same data from MIT server. It works fine.

trevorgerhardt commented 7 years ago

Ideally we want to isolate the problem as much as possible. Right now it's extremely unclear where the problem might be coming from.

How would I be able to recreate this exact problem locally?

Xin-Zheng commented 7 years ago

@trevorgerhardt just clone https://github.com/mitTransportAnalyst/CoAXs-React.git and go to the "develop" branch do npm install and npm start move the origin marker first and wait for it loading the stop tree and metadata and move the destination marker.

I have console.log the data which generateDestinationData() output

Thank you very much

Xin-Zheng commented 7 years ago

In order to help you isolate the problem, I dump all the data I get from MIT server. Here is the links. https://github.com/mitTransportAnalyst/Browsochrones-Test

The data is for Boston and I use webpack version of browsochrones Thanks.

trevorgerhardt commented 7 years ago

All information is great but to debug a browsochrones problem I need to isolate it to browsochrones. Can you open a pull request to browsochrones that edits the example to use data that shows the problem you are having?

Xin-Zheng commented 7 years ago

Hi @trevorgerhardt, I just create a new pull request and add the test data in the test/data folder. Thanks

trevorgerhardt commented 7 years ago

I'll check it out 👌

Xin-Zheng commented 7 years ago

@trevorgerhardt Thank you very much

trevorgerhardt commented 7 years ago

I guess I wasn't clear with my request. The test data doesn't just need to be added, the example needs to be updated to use the test data. Right now the example in the Pull Request still uses the data from our IndyConnect project.

Also @Xin-Zheng, this is currently Open Source support and not billed hours. I would like to help, but I'm not going to dig into outside code or data without being shown that it's clearly a Browsochrones issue first. I'm asking you to demonstrate that, which has not been done yet.

Xin-Zheng commented 7 years ago

Got it. I will update the example code to use the Boston data to show the problem. Thanks

Xin-Zheng commented 7 years ago

Hey @trevorgerhardt, I just create a new PR and comment the issue on that PR. Thanks