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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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>