[OpenLayers-Users] transformation issues
Nicholas Efremov-Kendall
n.e.kendall at gmail.com
Wed Jun 22 14:13:41 EDT 2011
Hi all,
Sub-query of previous post.
I have a map that I believe is set to EPSG:4326. I'm pulling coordinates
from the twitter API, which is in lat-lon, however when my points are added
to the map, they are placed at 0,0, rather than their actual geographic
coordinates. I am at a loss as to why this happens. I've messed with trying
to transform the point, but for reasons I don't understand I can't seem to
transform both coordinates without turning one of them into a NaN...
relevant code is below...
if (tweet.geo){
var lon = tweet.geo.coordinates[0];
var lat = tweet.geo.coordinates[1];
//var lonlat = new OpenLayers.LonLat(lon,lat);
//.transform(new OpenLayers.Projection("EPSG:900913"),new
OpenLayers.Projection("EPSG:4326"));
//alert(lonlat);
tweet.point = new OpenLayers.Geometry.Point(lon,lat);
tweet.attributes = {};
plotTwt(tweet);}}}
function plotTwt(tweet){
alert(tweet.point);
var twtfeat = new OpenLayers.Feature.Vector(tweet.point);
tweetz.addFeatures(twtfeat);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110622/a3c8522b/attachment.html
More information about the Users
mailing list