<html><body bgcolor="#FFFFFF"><div>Thanks! Will take another crack at this Tom! <br><br>Sent from my mobile device</div><div><br>On Jun 21, 2011, at 2:37 AM, "Sveen Atle Frenvik (Geomatikk IKT)" <<a href="mailto:Atle.Frenvik.Sveen@geomatikk.no">Atle.Frenvik.Sveen@geomatikk.no</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>
try using an OpenLayers.Geometry.Point instead of an
OpenLayers.LonLat<br>
<br>
ie (untested, but i think this is rather correct):<br>
<br>
<div>function parseTweetsQ(){</div>
<div> if (tweetsQ.length > 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]).transform(new
OpenLayers.Projection("EPSG:4326"),map.getProjectionObject());<br>
tweet.attributes = {}; //in this you coukd stuff
attributes of the tweet for easy access on clicks etc.<br>
</div>
<div> plotTwt(tweet);</div>
<div> }<br>
}<br>
}</div>
<div><br>
</div>
<div>
<div>function plotTwt(tweet){<br>
//why do you keep adding the layer for each tweet? <br>
</div>
<div> map.addLayer(tweetz);</div>
<div> tweet.marker = new OpenLayers.Feature.Vector(tweet.point,{attributes:{tweet.attributes]});</div>
<div> tweetz.addFeatures([tweet.marker]);<br>
}<br>
<br>
</div>
</div>
<br>
<br>
On 2011-06-21 05:00, Nicholas Efremov-Kendall wrote:
<blockquote cite="mid:BANLkTi=ZchxG6o_6AhLBCQ=pm8HHtSrsJg@mail.gmail.com" type="cite">Hi Phil et al,
<div><br>
</div>
<div>Thanks for your response. The code as is does iterate through
the features as they are returned. I have a handle on it up to
the plotting function. An alert on the tweet.marker object
returns [object Object], while tweet.latlng returns readable
coordinates lon=38.6834,lat=-90.4313. I guess what I'm unsure
about is how to parse the object which is passed to the third
function. Thanks again.</div>
<div><br>
</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 > 0) {</div>
<div>var tweet = tweetsQ.pop();</div>
<div>if (tweet.geo){</div>
<div>tweet.latlng = new
OpenLayers.LonLat(tweet.geo.coordinates[0],tweet.geo.coordinates[1]);</div>
<div>plotTwt(tweet);</div>
<div>}}}</div>
<div><br>
</div>
<div>
<div>function plotTwt(tweet){</div>
<div>
map.addLayer(tweetz);</div>
<div>tweet.marker = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(tweet.latlng).transform(new
OpenLayers.Projection("EPSG:4326"),map.getProjectionObject()));</div>
<div>tweetz.addFeatures([tweet.marker]);}</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div class="gmail_quote">On Mon, Jun 20, 2011 at 9:13 PM, Phil
Scadden <span dir="ltr"><<a moz-do-not-send="true" href="mailto:p.scadden@gns.cri.nz"><a href="mailto:p.scadden@gns.cri.nz">p.scadden@gns.cri.nz</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">I have no idea what the object returned
by twitter is but surely, but if<br>
you are using jsonp, then<br>
have in your code something like:<br>
jsonp_function(json)<br>
where jsonp_function is the name of jsonp callback and json
is the<br>
returned object. I would guess it contains an array of
feature type<br>
objects, so you would iterate through the array, creating
feature for<br>
each row, and calling vectorLayer.addFeatures(features) to
add them to<br>
the vector layer.<br>
<br>
Notice: This email and any attachments are confidential. If
received in error please destroy and immediately notify us.
Do not copy or disclose the contents.<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a moz-do-not-send="true" href="mailto:Users@lists.osgeo.org"><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a></a><br>
<a moz-do-not-send="true" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank"><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></a><br>
</blockquote>
</div>
<br>
</div>
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org"><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a></a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users"><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Atle Frenvik Sveen
Utvikler
Geomatikk IKT AS
tlf: 45 27 86 89
<a class="moz-txt-link-abbreviated" href="mailto:atle.frenvik.sveen@geomatikk.no"><a href="mailto:atle.frenvik.sveen@geomatikk.no">atle.frenvik.sveen@geomatikk.no</a></a></pre>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></span><br></div></blockquote></body></html>