<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975"><!-- converted from rtf -->
<STYLE>.EmailQuote {
        BORDER-LEFT: #800000 2px solid; PADDING-LEFT: 4pt; MARGIN-LEFT: 1pt
}
</STYLE>
</HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=389280223-01122010><FONT color=#0000ff
size=2 face=Arial>My mistake.. apparently I was not declaring the lonLat
variable properly. I just changed it around to be</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=389280223-01122010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=389280223-01122010><FONT color=#0000ff
size=2 face=Arial>var lonlat2 = new
OpenLayers.LonLat(numbers);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=389280223-01122010><FONT color=#0000ff
size=2 face=Arial>map.setCenter(lonLat2,startupLevel); </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=389280223-01122010><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=389280223-01122010><FONT color=#0000ff
size=2 face=Arial>and this worked.</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> users-bounces@geoext.org
[mailto:users-bounces@geoext.org] <B>On Behalf Of </B>Andrew
Stewart<BR><B>Sent:</B> December 01, 2010 3:25 PM<BR><B>To:</B>
users@geoext.org<BR><B>Subject:</B> [Users] Can't set center with
mappanel<BR></FONT><BR></DIV>
<DIV></DIV><FONT size=2 face="Arial, sans-serif">
<DIV>I have a map created within a map panel.. My map is defined like so -
</DIV>
<DIV> </DIV>
<DIV><FONT color=#008000 face="Courier New">//Create Map</FONT></DIV>
<DIV><FONT face="Courier New"> map = <FONT
color=#0000ff>new</FONT> OpenLayers.Map(<FONT
color=#a31515>'map'</FONT>,{controls: [],</FONT></DIV>
<DIV><FONT face="Courier New"> maxExtent: <FONT
color=#0000ff>new</FONT>
OpenLayers.Bounds(-3508.86612616335,5778517.56154675,33162.5587151875,5808814.49155551),</FONT></DIV>
<DIV><FONT face="Courier New"> maxResolution: <FONT
color=#a31515>'auto'</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> numZoomLevels: 20,</FONT></DIV>
<DIV><FONT face="Courier New"> units: <FONT
color=#a31515>'m'</FONT>,</FONT></DIV>
<DIV><FONT face="Courier New"> projection: <FONT
color=#0000ff>new</FONT> OpenLayers.Projection(<FONT
color=#a31515>"EPSG:3776"</FONT>),</FONT></DIV>
<DIV><FONT face="Courier New"> displayProjection: <FONT
color=#0000ff>new</FONT> OpenLayers.Projection(<FONT
color=#a31515>"EPSG:4326"</FONT>)</FONT></DIV>
<DIV><FONT face="Courier New"> });</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> <FONT
color=#008000>//Define Map Longitude/Latitude and Start zoom
levels</FONT></FONT></DIV>
<DIV><FONT face="Courier New">
startupLat = 52.27210;</FONT></DIV>
<DIV><FONT face="Courier New">
startupLon = -113.80288;</FONT></DIV>
<DIV><FONT face="Courier New">
startupLevel = 12;</FONT></DIV>
<DIV><FONT face="Courier New"> lonLat
= <FONT color=#0000ff>new</FONT>
OpenLayers.LonLat(startupLon,startupLat).transform(<FONT
color=#0000ff>new</FONT> OpenLayers.Projection(<FONT
color=#a31515>"EPSG:4326"</FONT>), map.getProjectionObject());</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> <FONT color=#008000>//Define
MapPanel</FONT></FONT></DIV>
<DIV><FONT
face="Courier New">
mapPanel = <FONT color=#0000ff>new</FONT> GeoExt.MapPanel({</FONT></DIV>
<DIV><FONT
face="Courier New">
collapsed: <FONT color=#0000ff>false</FONT>,</FONT></DIV>
<DIV><FONT
face="Courier New">
height: 900,</FONT></DIV>
<DIV><FONT
face="Courier New">
map: map,</FONT></DIV>
<DIV><FONT
face="Courier New">
center: lonLat,</FONT></DIV>
<DIV><FONT
face="Courier New">
zoom: startupLevel,</FONT></DIV>
<DIV><FONT
face="Courier New">
tbar: toolbarItems</FONT></DIV>
<DIV><FONT
face="Courier New">
});</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Except no matter what I do the center of the map
is not the coordinates I put in but just remains the same at every zoom level.
Even if I put the statement</FONT></DIV>
<DIV><FONT face="Courier New">map.setCenter(<FONT color=#0000ff>new</FONT>
OpenLayers.LonLat(17.99,59.3),11);</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">At the very end of my code only the zoom level of
the map is modified but the variables for lon/lat under my map are the same..
How can I actually change this so I can modify the center to be actually the
center? (for some reason it is to the left of the center). Appreciate any
assistance.</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV> </DIV></FONT>
<DIV>
<P>
<HR>
This e-mail is intended for the original recipient(s) only. If you have received
it in error, please advise the sender and delete this message.
<P></P></DIV>
<DIV>
<P>
<HR>
[This message has been scanned for security content threats and
viruses.]<BR><BR>[The City of Red Deer I.T. Services asks that you please
consider the environment before printing this e-mail.]<BR>
<P></P></DIV>
<DIV><P><HR>
This e-mail is intended for the original recipient(s) only. If you have received it in error, please advise the sender and delete this message.
</P></DIV>
</BODY></HTML>