How do I add geo-enabled tweets to my web map?


#1

I’ve built a web map using Leaflet, and I’d like to add geocoded search-based tweets to my map, but I keep encountering an error: “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource” and wants me to enable CORS. Below is the code I’m using - any thoughts on what I might be doing wrong?

Thanks!

$.get(
https://api.twitter.com/1.1/search/tweets.json”,
{q : ‘Raleigh’,
geocode : ‘35.79, -78.65, 50mi’,
result_type : ‘recent’,
coordinates: ‘true’,
geo_enabled: ‘true’
},
function(data) {
alert('page content: ’ + data);
});