<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=765473412-07022010></SPAN><FONT face=Arial
color=#0000ff size=2>H<SPAN class=765473412-07022010>i,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=765473412-07022010></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=765473412-07022010><FONT face=Arial color=#0000ff
size=2>your result is absolute right. For sphericalMercator (180,90) are
~(0,0). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=765473412-07022010></SPAN><FONT face=Arial
color=#0000ff size=2>Y<SPAN class=765473412-07022010>ou can calculate your
lonlat from sphericalMercator bounds</SPAN><BR>new
OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508)</FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=765473412-07022010><FONT face=Arial color=#0000ff size=2>or
transform your coordinates to sphericalMercator </FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>var lonlat = new
OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"),new
OpenLayers.Projection("EPSG:900913"));<BR></FONT></DIV>
<DIV dir=ltr align=left><FONT><SPAN class=765473412-07022010><FONT face=Arial
color=#0000ff size=2>Arnd</FONT></SPAN></DIV></FONT><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Vincent
Gulinao<BR><B>Gesendet:</B> Sonntag, 7. Februar 2010 05:38<BR><B>An:</B>
users@openlayers.org<BR><B>Betreff:</B> Re: [OpenLayers-Users] How to make
OpenLayers.Map.panTo() work?<BR></FONT><BR></DIV>
<DIV></DIV>Sorry, accidentally sent...<BR><BR>I copied this from an example
somewhere to start:<BR><BR> map = new
OpenLayers.Map('map',<BR>
{<BR> numZoomLevels:
19,<BR>
maxResolution:
156543.0399,<BR>
units:
'm',<BR>
projection: new
OpenLayers.Projection("EPSG:900913"),<BR>
displayProjection: new
OpenLayers.Projection("EPSG:4326")<BR>
});<BR><BR><BR> var layerMapnik = new
OpenLayers.Layer.OSM.Mapnik("Mapnik");<BR>
map.addLayers([layerMapnik]);<BR><BR>Then I call this function from html
drop-down list's onchange:<BR><BR>function setCenter(region)
{<BR> lon = Math.random() * 360 - 180;<BR>
lat = Math.random() * 180 - 90;<BR> var lonlat = new
OpenLayers.LonLat(lon, lat);<BR>
map.panTo(lonlat);<BR>}<BR><BR>... but it only brings me to (I believe)
0,0.<BR><BR>I've been trying to figure it out for hours but with no luck. Please
help.<BR><BR>TIA.<BR><BR>
<DIV class=gmail_quote>On Sun, Feb 7, 2010 at 12:30 PM, Vincent Gulinao <SPAN
dir=ltr><<A
href="mailto:vincent.gulinao@gmail.com">vincent.gulinao@gmail.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">I'm
a newbie, I copied this from an example somewhere to start:<BR><BR>map = new
OpenLayers.Map('map',<BR>
{<BR> numZoomLevels:
19,<BR>
maxResolution:
156543.0399,<BR>
units:
'm',<BR>
projection: new
OpenLayers.Projection("EPSG:900913"),<BR>
displayProjection: new
OpenLayers.Projection("EPSG:4326")<BR>
});<BR><BR><BR> var layerMapnik = new
OpenLayers.Layer.OSM.Mapnik("Mapnik");<BR>map.addLayers([layerMapnik,layerTah]);<BR></BLOCKQUOTE></DIV><BR></BODY></HTML>