Page 1 of 1
Twitter coordinates mapping to googlemaps
Posted: Fri May 30, 2014 6:23 pm
by sergey
I barely started in appery and after I did the tutorial on twitter search I run into a small problem. I want to add more info to show in the search results, such as a tweet geo location in google maps (with a separate map for each result). But the coordinates are stored in the search response as an array, which in turn is a part of an object (e.g. geo). I can unwrap the object with coordinates, but I don't know how to pass these coordinates to the map. They come as an array of two numbers, but the map needs two separate numbers. There must be a simple way to pass them. Please help me out. Thanks a lot.
SF
Twitter coordinates mapping to googlemaps
Posted: Fri May 30, 2014 6:48 pm
by Evgene Karachevtsev
Twitter coordinates mapping to googlemaps
Posted: Fri May 30, 2014 6:57 pm
by sergey
Thanks Eugene. I've actually started this tutorial on my own, but right now for some reason I'm not able to create a database service (it is a part of this exercise). I don't think it's the problem on my end, because I played around somewhat successfully with databases before. So in the meantime, could you point me on a part in this tutorial that may be particularly helpful?
Twitter coordinates mapping to googlemaps
Posted: Fri May 30, 2014 8:20 pm
by sergey
The database service is working now, The tutorial example with multimaps works too. But it didn't get me much closer to what I need. I looked at other examples too - they're not close enough either. It seems such an overkill to go through so much extra javascript to fish out a few bits of relevant information (all I need is to split a 2-number array). I think there should be an easier way to do this "trivial" mapping.
Twitter coordinates mapping to googlemaps
Posted: Mon Jun 02, 2014 2:40 pm
by Kateryna Grynko
Hi Sergey,
To get correct coordinates you should add the following JavaScript code to coordinates mapping (https://dev.twitter.com/docs/platform...) for a map:prereturn value[0];/preandprereturn value[1];/prefor longitude and latitude accordingly.
Twitter coordinates mapping to googlemaps
Posted: Tue Jun 03, 2014 2:08 am
by sergey
Thanks. I've actually tried it before and thought that it didn't work. But I've just realized that some of the search results don't have coordinates (i.e. a null object instead), which trips this code because it doesn't check if these fields exist. How do I check if value[0] and value[1] are returnable? Thanks again for helping out.
Twitter coordinates mapping to googlemaps
Posted: Tue Jun 03, 2014 2:11 am
by Alena Prykhodko