-
Notifications
You must be signed in to change notification settings - Fork 142
[WIP #121] Locations on a map #131
base: master
Are you sure you want to change the base?
Conversation
@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) |
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? |
If you were to change sample-data/data.yaml to have
then your api would be /census for another example look at |
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
@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.
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 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 |
thanks again for this! We're still thinking about it, but prolly won't get back to it for a few weeks |
we added a /map route to view a map.
we also added markers to the map and some popup infowindows