Sorry, accidentally sent...

I copied this from an example somewhere to start:

    map = new OpenLayers.Map('map',
        {
            numZoomLevels: 19,
              maxResolution: 156543.0399,
              units: 'm',
              projection: new OpenLayers.Projection("EPSG:900913"),
              displayProjection: new OpenLayers.Projection("EPSG:4326")
        });


    var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
    map.addLayers([layerMapnik]);

Then I call this function from html drop-down list's onchange:

function setCenter(region) {
    lon = Math.random() * 360 - 180;
    lat = Math.random() * 180 - 90;
    var lonlat = new OpenLayers.LonLat(lon, lat);
    map.panTo(lonlat);
}

... but it only brings me to (I believe) 0,0.

I've been trying to figure it out for hours but with no luck. Please help.

TIA.

On Sun, Feb 7, 2010 at 12:30 PM, Vincent Gulinao
<[email protected]>wrote:

> I'm a newbie, I copied this from an example somewhere to start:
>
> map = new OpenLayers.Map('map',
>         {
>             numZoomLevels: 19,
>               maxResolution: 156543.0399,
>               units: 'm',
>               projection: new OpenLayers.Projection("EPSG:900913"),
>               displayProjection: new OpenLayers.Projection("EPSG:4326")
>         });
>
>
>     var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
> map.addLayers([layerMapnik,layerTah]);
>
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to