Placeware / ThisPlace

:globe_with_meridians: Remember a 3x3 m² location anywhere in the world with just four words.
https://thisplace.herokuapp.com
MIT License
19 stars 12 forks source link

Started a JSON API #5

Closed betatim closed 10 years ago

betatim commented 10 years ago

The beginnings of a JSON API so that we can have an interactive map.

Does this look like a nice API or fundamentally offensive? How to put new routes in a different module, not quite satisfied with the approach here. Maybe they don't need to be somewhere else.

I'd like the landing page to look like this:

mockup

map centred somewhere sensible (browser geolocation?), just one box where you either type the name of a place you want to turn into a hash or a hash which then shows you where it is. After pressing return you see a pin at the location with a little popup telling you address and hashes.

Probably also good to add something so I can just click on a spot to learn its hash.

kdungs commented 10 years ago

Yes, I really like the idea. I have a few comments:

    @get('/foo')
    @get('/bar/<something>')
    def foobar(something=None):
        return 'Hello, world!'

I will add to this PR some more features for the API and then ask you to review them before merging.

betatim commented 10 years ago

map centric: maybe better to have landing page as is with an explanation, then next page (and direct links) take you to map centric view. Basically: if you are new (landing page) show them an explanation, power users notice that they can go directly to thrwrds.com/hello-world-oyster or thrwrds.com/45.235,23.43 or thrwrds.com/CERN and get what they are looking for. Needs a bit of smarts on our side to figure out if a person typed in a lat/lng, location by search term or 3hash or 6hash.

+1 on the multi route short cuts

procedural point is it a good idea to have multiple people add to same PR? Or should we merge this and start a new one for your additions? Just not sure how is easiest/cleanest.

betatim commented 10 years ago

fancy auto complete for the search box: https://developers.google.com/maps/documentation/javascript/examples/places-searchbox

example draws the world's most ugliest markers but otherwise useufl

kdungs commented 10 years ago

Yup, this will be next but for the moment I think we can merge, no?