Update:<div>it will place markers if fed two of the same coordinate, but not tweet.geocoordinates[1],tweet.geo.coordinates[0].</div><div>so tweet.geo.coordinates[0],tweet.geo.coordinates[0] places the marker somewhere in the middle of eurasia</div>
<div>tweet.geo.coordinates[1],tweet.geo.coordinates[1] goes off the map below  antarctica below the americas</div><div>tweet.geo.coordinates[0],tweet.geo.coordinates[1] goes off the map below Antarctica below africa...</div>
<div><br></div><div>no [expletive deleted] clue... <br><br><div class="gmail_quote">On Wed, Jun 22, 2011 at 3:49 PM, Nicholas Efremov-Kendall <span dir="ltr">&lt;<a href="mailto:n.e.kendall@gmail.com">n.e.kendall@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<div><br></div><div>I&#39;m still trying to crack this nut, and to do so, I decided to strip out the need for any transformations, assuming that since both the w3c geoloc and twitter api&#39;s both use epsg 4326 natively. The geolocation works fine, without any issues, but the tweets still aren&#39;t being plotted in the correct place and I don&#39;t really know why. I&#39;ve got an alert set on the point that&#39;s created, and from what I can tell it is being fed valid coordinates, the alert returns the following POINT(38.6315 -90.3462). I&#39;ve plotted the coords by hand, and can verify that they&#39;re coming from the right area What I have noticed is that the coordinates seem to served as lat-long, rather than lon-lat (i.e. tweet.geo.coord[0] = lat), but reversing the coordinates doesn&#39;t result in markers getting added to the map, although the coords are returned in the right order.</div>

<div><br></div><div>Now, as near as I can tell, this problem has to be with the coordinates being passed to my script from the twitter api itself. Maybe this has to do with the coords getting passed to me in the wrong data type, but at this point I&#39;m stumped.</div>

<div><br></div><div>full code is below</div><div><br></div><div><br></div><div><div>var tweetz = new OpenLayers.Layer.Vector(&quot;Tweets&quot;, {styleMap: new OpenLayers.StyleMap({externalGraphic: &quot;OpenLayers-2.11-rc1/img/marker-green.png&quot;, pointRadius: 10})});</div>

<div>var marker = new OpenLayers.Layer.Vector(&quot;Marker&quot;, {styleMap: new OpenLayers.StyleMap({externalGraphic: &quot;OpenLayers-2.11-rc1/img/marker.png&quot;, pointRadius: 10})});</div><div>var map = new OpenLayers.Map(&#39;map&#39;);</div>

<div>var tweets = [];</div><div>var tweetsQ = [];</div><div>var refreshQuery = &#39;?=&#39;;</div><div>function initGIS(){</div><div>map.addControl(new OpenLayers.Control.LayerSwitcher());var wms = new OpenLayers.Layer.WMS(</div>

<div>  &quot;OpenLayers WMS&quot;,</div><div>  &quot;<a href="http://vmap0.tiles.osgeo.org/wms/vmap0" target="_blank">http://vmap0.tiles.osgeo.org/wms/vmap0</a>&quot;,</div><div>  {&#39;layers&#39;:&#39;basic&#39;} );</div>
<div>map.addLayer(wms);</div>
<div>map.addLayer(tweetz);</div><div>map.setCenter(new OpenLayers.LonLat(-90, 38),12);</div><div>$(document).everyTime(&#39;30s&#39;, acquireTweets);</div><div>$(document).everyTime(&#39;100ms&#39;, parseTweetsQ);</div><div>

getLoc();</div><div>}</div><div><br></div><div>function getLoc(){if (Modernizr.geolocation) { navigator.geolocation.getCurrentPosition(plotLoc,handle_error);} else {yqlgeo.get(&#39;visitor&#39;,norm_yql_resp);}}</div><div>

<br></div><div>function createTWTsrcURL (){</div><div>var temp = map.getCenter();</div><div>return &#39;<a href="http://search.twitter.com/search.json" target="_blank">http://search.twitter.com/search.json</a>&#39; + refreshQuery + &#39;&amp;geocode=&#39; + temp.lat +&#39;%2C&#39; + temp.lon + &#39;%2C50km&amp;rpp=100&amp;callback=?&#39;;</div>

<div>}</div><div><br></div><div>function plotLoc (position){</div><div>map.addLayer(marker);</div><div>var feat = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(position.coords.longitude,position.coords.latitude));</div>

<div>marker.addFeatures([feat]);</div><div>var bounds = marker.getDataExtent();</div><div>map.zoomToExtent(bounds);</div><div>acquireTweets();</div><div>}</div><div><br></div><div>function acquireTweets(){</div><div>$.getJSON(createTWTsrcURL(), function(data){</div>

<div>if(data.results)</div><div>$.each(data.results, function(i, tweet){</div><div>if (tweet.geo || tweet.location)</div><div>tweetsQ.push(tweet);</div><div>});</div><div>refreshQuery = data.refresh_url;</div><div>});}</div>

<div><br></div><div>function parseTweetsQ(){</div><div>if (tweetsQ.length &gt; 0) {</div><div>var tweet = tweetsQ.pop();</div><div>if (tweet.geo){</div><div>tweet.point = new OpenLayers.Geometry.Point(tweet.geo.coordinates[0],tweet.geo.coordinates[1]);</div>

<div>tweet.attributes = {};</div><div>plotTwt(tweet);}}}</div><div><br></div><div>function plotTwt(tweet){</div><div>alert(tweet.point);</div><div>var twtfeat = new OpenLayers.Feature.Vector(tweet.point);</div><div>tweetz.addFeatures([twtfeat]);</div>

<div>}</div></div><div><br></div>
</blockquote></div><br></div>