Add Data (lat, long) after the Tweet button is pressed

36 views
Skip to first unread message

Tatiana Ten

unread,
Jun 20, 2011, 12:14:51 PM6/20/11
to Twitter Anywhere Development
Hi all,

I'm working on the project where the user is tweeting using the map,
so I need to populate a geo tweet, where the coordinates are dynamic.

T("#tbox").tweetBox({
width: 240,
onTweet: function () {
//alert("test");
//HERE I WANT TO ADD MY COORDINATES DATA FOR
MY TWEET
//data : { lat: value. long : value }
},
data: {
lat: lat,
long: lon
}
});

Is it possible? if yes, please help....

Thanx
Tanya

Matt Harris

unread,
Jun 22, 2011, 4:33:53 PM6/22/11
to twitter-de...@googlegroups.com
Hi Tatiana,

The onTweet function is called after the Tweet is sent so data attributes added the way you indicate in your code comment will not work. Instead you need to add the data attributes when you create the TweetBox e.g.

T("#tbox").tweetBox({
    width: 240,
    onTweet: function (text, html) {
        // called after the Tweet is sent
    },
    data: {
        lat: lat,
        long: lon
    }
});

One way to approach this could be to render the TweetBox after the user has interacted with the map.

Best,
@themattharris
Developer Advocate, Twitter





--
Twitter @Anywhere documentation and resources: http://dev.twitter.com/anywhere/begin
@anywhere updates via Twitter: http://twitter.com/anywhere
Change your membership to this group: http://groups.google.com/group/twitter-dev-anywhere?hl=en

Reply all
Reply to author
Forward
0 new messages