Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

[WIP #121] Locations on a map #131

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

conanza
Copy link

@conanza conanza commented Aug 20, 2015

we added a /map route to view a map.
we also added markers to the map and some popup infowindows

@ultrasaurus
Copy link
Contributor

@conanza this is great! To integrate it into open-data-maker, I think we would want to make it work for any data (so it would need to use the configured endpoint, or maybe more simply, pass that into the page as a query arg (so the ruby code would be worrying about the configuration and the page would simply call the endpoint specified in the URL, or something like that)

@conanza conanza changed the title Locations on a map [WIP] Locations on a map Aug 20, 2015
@conanza
Copy link
Author

conanza commented Aug 20, 2015

Thanks! So the endpoint that's currently avaiable is just at "/cities" correct? I think I don't fully understand by what you mean by "any data". Any city data? Or any generic data in the future that may have geolocations.

So right now, there's a forced request for all 100 cities. What I'm thinking is that we could include some dropdown menus or something that would act as filter options. So this would query the /cities endpoint with different query args based on the type of options selected. Then, the selected results would be shown on the map. Am I headed the right direction with this?

@ultrasaurus
Copy link
Contributor

If you were to change sample-data/data.yaml to have

api: census

then your api would be /census

for another example look at spec/fixtures/geo/data.yaml

@ultrasaurus
Copy link
Contributor

The idea behind open-data-maker is that anyone could create an instance with their own csv files (and data.yaml) and then get the json API. Eventually, it would be nice to only display a "map" link from the homepage when there is are location.lat and location.lon fields. I find that most of our data sets have one geo field per row, but someday there may be a data set that does not have that. For now, its fine that the /map only will show locations if there are any.

- bound a listener to list of endpoints on homepage
- added a link alongside the endpoint name
- added html to homepage to display a specific map as a modal
@conanza
Copy link
Author

conanza commented Aug 21, 2015

@ultrasaurus, I scrapped the original idea (didn't delete initial changes yet, just in case). I think I got something closer to what you want.

  • First on the homepage, I included some html for where a map can be displayed.
  • I used your ul of endpoints and added "map links" alongside each potential endpoint.
  • I then used some JS to listen for clicks on these links, which would open up a map as a modal on the same page (clicking cities, gives you a map from the cities endpoint; clicking census, gives you a map from /census; etc) .

In the end, it'd be cleaner to include the javascript as a plugin, so it's not in the html. I just haven't found the way to include separate JS files into the padrino asset pipeline yet.

Thoughts?

@conanza conanza changed the title [WIP] Locations on a map [WIP #121] Locations on a map Aug 21, 2015
@ultrasaurus
Copy link
Contributor

@conanza the data.yml has which attributes are geocoded (right now only one special field, called "location" which has a lat and lon is geocoded) -- so if a data set has a location, then we could create a link to a map which displays all the locations on the map

@ultrasaurus
Copy link
Contributor

thanks again for this! We're still thinking about it, but prolly won't get back to it for a few weeks

@ultrasaurus ultrasaurus self-assigned this Jan 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants