Hi all,<div><br></div><div>Still messing around with the geolocation API. I've been playing with the jquery getJSON function for cross-domain requests and I'm running into an issue that I think is related to the coordinate system of my map, which is using OSM as a baselayer.</div>
<div><br></div><div>Essentially I'm trying to apply holdener's nearby tweet's and I'm getting a 403 error from the getJSON function. I think this is because I'm not transforming the map.getCenter() properly, and I assume that the twitter API uses Google's EPSG 900913 as a default.</div>
<div><br></div><div>this is the function I'm using to create the search URL </div><div><br></div><div><div>function createTWTsrcURL (){</div><div>var temp = map.getCenter().transform(new OpenLayers.Projection("EPSG:900913"),map.getProjectionObject());</div>
<div>return '<a href="http://search.twitter.com/search.json">http://search.twitter.com/search.json</a>' + refreshQuery + '&geocode=' + temp.lat +'%2C' + temp.lon + '%2C50km&rpp=100&callbacl=?';</div>
<div>}</div></div><div><br></div><div>You can see from the get string which is producing the 403 error (Forbidden) that the script isn't passing Lat-Longs to the search API, which might be causing this error.</div><div>
<span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; white-space: pre-wrap; "><a href="http://search.twitter.com/search.json?=&geocode=4579425.8122326%2C-10018754.17%2C50km&rpp=100&callbacl=jQuery16105243276595138013_1308594913395&_=1308595036601" class="webkit-html-resource-link" title="http://search.twitter.com/search.json?=&geocode=4579425.8122326%2C-10018754.17%2C50km&rpp=100&callbacl=jQuery16105243276595138013_1308594913395&_=1308595036601" style="box-sizing: border-box; color: rgb(84, 84, 84); cursor: pointer; max-width: 100%; ">http://search.twitter.com/search.json?=&geocode=4579425.8122326%2C-10018754.17%2C50km&rpp=100&callbacl=jQuery16105243276595138013_1308594913395&_=1308595036601</a> </span></div>
<div><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; white-space: pre-wrap; "><br></span></div><div><span class="Apple-style-span" style="font-size: 12px; white-space: pre-wrap; "><font class="Apple-style-span" face="arial, helvetica, sans-serif">I'm sure I'm not transforming it correctly, even if that's not what is causing the 403 error. Any ideas?</font></span></div>