[OpenLayers-Users] map.getCenter function question

Ian Turton ijturton at gmail.com
Mon Jun 20 16:21:10 EDT 2011


On 20 June 2011 16:01, Nicholas Efremov-Kendall <n.e.kendall at gmail.com> wrote:
> Hi Andreas,
> Thanks for the suggestion. With the following code
> var temp = map.getCenter().transform(new
> OpenLayers.Projection("EPSG:4326"),map.getProjectionObject());

Try
var temp = map.getCenter().transform(new
OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326"));

So you transform from your map (900913/Google) to what Twitter wants
(4326/latlon)

Ian
-- 
Ian Turton


More information about the Users mailing list