OpenLayers setCenter will not function properly

Carol35

New Member
I am using OpenLayers for a map and when I load it, it always centres on 0,0 no matter what I change the setCenter to.\[code\] var map, baseLayer; var options = {numZoomLevels: 7, isBaseLayer: true,}; function collegeLaneInit() { map = new OpenLayers.Map('map'); baseLayer = new OpenLayers.Layer.Image("College Lane","college-lane-large.png", new OpenLayers.Bounds(-1000, -1000, 1000, 1000), new OpenLayers.Size(2000,2000), options); map.addLayer(baseLayer); var center = new OpenLayers.LonLat(500,500); map.setCenter(center ,1); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.zoomToMaxExtent(); map.addControl(new OpenLayers.Control.MousePosition()); }\[/code\]I'm not really sure why it's doing this. Can anyone spot something that I'm missing?
 
Back
Top