It might be a typo: <span class="q"><br><br>map1 = new OpenLayers.Map('map', options);<br><br></span>which you later refer to as map. <br><br>(but not sure how it would work in the init function :(<br>(the map in quotes is the name of the html div, I guess it could work to an extent like that, if OL makes the JS object actully the same as the html object)
<br><br><div><span class="gmail_quote">On 8/2/07, <b class="gmail_sendername">Tyler Durden</b> <<a href="mailto:tylersticky@gmail.com">tylersticky@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I have list of links:<br>Example:<br><a href="#" onclick="map.setCenter(new OpenLayers.LonLat(16.0, 41.0),<br>8);">show</a><br><br>But nothing happens.<br><br>setCenter() only applies on init()?
<br><br>var lon = -8.61057;<br>var lat = 41.14452;<br>var zoom = 8;<br>var bounds = new OpenLayers.Bounds(-11.535, 36.095, -4.535, 43.095);<br>var map, layer_continente;<br><br>function initMap() {<br> var options = { maxResolution :
0.015693359375,<br> numZoomLevels : 12,<br> maxExtent : bounds,<br> projection : "EPSG:4326"}<br><br> map1 = new OpenLayers.Map('map', options);
<br> layer_continente = new OpenLayers.Layer.WMS("continente",<br>"<a href="http://localhost:8080/">http://localhost:8080/</a>", {"layers":"continente",<br>"format":"image/png"})
<br> map.addLayer(layer_continente);<br><br> map.addControl(new OpenLayers.Control.PanZoom());<br> map.addControl(new OpenLayers.Control.MousePosition());<br> map.addControl(new OpenLayers.Control.MouseDefaults
());<br> map.addControl(new OpenLayers.Control.Permalink());<br><br> map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);<br>}<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">
Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Barry<br><br>- <a href="http://www.nearby.org.uk">
www.nearby.org.uk</a> - <a href="http://www.geograph.org.uk">www.geograph.org.uk</a> -