adubrock / PDX911Calls

Logs the Police calls in Portland so residents can search them.
0 stars 4 forks source link

Not displaying data #10

Open ghost opened 9 years ago

ghost commented 9 years ago

I have this deployed and it does not seem to be pulling in any data from pdx911 feed to the map tiles. Is this still maintained?

ageoldpun commented 9 years ago

Hi Benjamin. To pull in the calls you need to run the rake task called fetch_calls.

While we haven't made any updates to it in a while, the program should still be working and you can find a deployed version of it here: http://pdx911calls.herokuapp.com/

Thanks.

ghost commented 9 years ago

I see I thought it had a map and showed updated calls versus just a search tool?

ageoldpun commented 9 years ago

It has a google map that shows the last 20 calls or whatever the results are of your search.

ghost commented 9 years ago

So that's not loading at all on the heroku hosted app and I can't get that to work on my deployed instance.

ageoldpun commented 9 years ago

So it doesn't look like this? selection_002 If not, can you tell me what browser you are trying on?

ghost commented 9 years ago

Wow nope that area is a white box instead of the map. I use Firefox 36.0

ageoldpun commented 9 years ago

I just pulled it up in Firefox and ran in to the same problem. Looks like there is a bug with Firefox rendering the map. Thanks for finding it! I will look in to it when I get a chance.

ghost commented 9 years ago

Cool as a Firefox Release Manager let me know if its on our side.

ageoldpun commented 9 years ago

I'm still looking in to it. It looks like a CSS thing with Chrome and Firefox rendering something differently. If you pull it up on Firefox and scroll to the right you will see it. I didn't write the CSS for this, a friend of mine did. I am going to have him check it out when he gets a chance.

ageoldpun commented 9 years ago

If you come up with a solution, I would be happy to accept a pull request. :metal:

ghost commented 9 years ago

Pull request submitted which fixes it in Firefox Nightly. It appears Chrome is rendering the CSS improperly while Firefox is doing it right.

ghost commented 9 years ago

Oddly still not displaying data for me https://montavilla-calls.herokuapp.com/search

Do I need to do anything special when deploying to Heroku? Like is there a Google Map API key I need to drop in to make it work? How can I config it to focus on a certain area of Portland?

ageoldpun commented 9 years ago

You need to add heroku scheduler to your heroku deployment and then have it run 'rake fetch_calls' at whatever frequency you want. This will only work after you have created the database and ran the migrations. Hopefully this helps.

ghost commented 9 years ago

I'm pretty new to Ruby (maybe thats a nice way of putting it even) doesn't Heroku create the database automatically? So I would just copy those details from the dash and throw them somewhere into the actual app and push to heroku again?

ageoldpun commented 9 years ago

No worries about being new, we all have to start somewhere. :)

So you are going to want to download and install the heroku toolbelt, command line tools. From there, I think that you will need to type in these commands:

heroku run rake db:create heroku run rake db:migrate heroku run rake fetch_calls

From there you should have some calls in your database. After that, you will need to sign-in to the heroku web, install heroku scheduler to the deployment and then make a task that runs rake fetch_calls as often as you would like it to get new calls.