On Mon, 2009-01-05 at 09:52 -0500, Heidt, Christopher M. wrote:
> you need to transform the values you are applying to the setcenter.
> Map.setCenter( new OpenLayers.LonLat(lon,
> lat).transform(map.displayProjection, map.projection),null);
I thought I was already doing that, see code below:
> > map = new OpenLayers.Map('map', {projection: new
> > OpenLayers.Projection("EPSG:900913")});
> > var gmap = new OpenLayers.Layer.Google("Google Streets", {
> > sphericalMercator: true }); // streets is the default
> >
> > map.addLayers([gmap]);
> >
> > var center = new OpenLayers.LonLat(-41.27, 173.28);
> > alert('['+center.lon+','+center.lat+']');
> > var proj = new OpenLayers.Projection("EPSG:4326");
> > center.transform(proj, map.getProjectionObject());
> > alert('['+center.lon+','+center.lat+']');
> > map.setCenter(center, 13);
Perhaps I'm not doing this correctly, but the conversion appears to be
working according to the alert statements.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users