Note that there are some explanatory texts on larger screens.

plurals
  1. POGeocoding Tweets on a Google Map
    primarykey
    data
    text
    <p>Would really appreciate any help with my issue. I've been looking at this terrific tutorial by Marcin Dziewulski who integrated recent tweets and twitter user avatars onto a Google Map. Basically he places the users avatar where they last tweeted. I highly recommend checking the tutorial out here:</p> <p><a href="http://tympanus.net/codrops/2011/04/13/interactive-google-map/" rel="nofollow">http://tympanus.net/codrops/2011/04/13/interactive-google-map/</a></p> <p>It all seems to make sense except when it comes down to the actual geocoding of the user. The code works beautifully when the different tweeters are from different cities. However, let's say you wanted to track certain users in one city. They're all geocoded from the center of the city and you can only see one avatar at a time. If you refresh the page, another one will show up, in the exact same spot. This obviously isn't what I want. I assume the problems is in this bit of code:</p> <pre><code>var users = o.twitter.get(), arr = new Array; for (i in users){ var user = users[i]; $.getJSON('http://twitter.com/users/show/'+user+'.json?callback=?', function(data) { var img = data.profile_image_url, screen_name = data.screen_name; geocoder.geocode({ address: data.location }, function(response, status){ if (status == google.maps.GeocoderStatus.OK) { var x = response[0].geometry.location.lat(), y = response[0].geometry.location.lng(); marker = new google.maps.Marker({ icon: img, map: map, title: screen_name, position: new google.maps.LatLng(x, y) }); </code></pre> <p>I think something needs to change in the geocoder.geocode({ address: data.location } bit of code, but not 100% positive. I can't seem to find the solution in the Twitter API documentation either. </p> <p>My question is basically this...can the code above be altered so that it gathers more precise lat and long. coordinates from where tweets are actually generated and then display them correctly at those locations? In other words, don't just put a tweet from NYC in the middle of NYC, but place the avatar at the EXACT location. </p> <p>I've tested this with my own tweets, with the the location feature of twitter enabled. I just can't figure this out! Thanks again to anyone who can help!</p> <p>Best,</p> <p>Brandon</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload