OpenLayers base layer not showing on my webpage

nichedude

New Member
I'm trying to create a map using OpenLayers which uses a png image as a base layer but I'm having a bit of trouble. I'm not too familiar with OpenLayers as I have only come across it today and thought that it could prove to be a powerful tool.So far I have just been using the code from the tutorial and changed the base layer from a WMS format to an Image format but it still does not show the map on the webpage.You can see the webpage here: http://getontinternet.com/fyp/test.html\[code\]<!DOCTYPE html><html> <head> <title>OpenLayers Tutorial - Basic Map Setup</title> <script src="http://openlayers.org/api/OpenLayers.js"></script> <script type="text/javascript"> var map, baseLayer; function init(){ map = new OpenLayers.Map('map'); baseLayer = new OpenLayers.Layer.Image("College Lane","http://getontinternet.com/fyp/college-lane.png", new OpenLayers.Bounds(-650, -650, 650, 650), new OpenLayers.Size(1300,1300), options); map.addLayer(baseLayer); map.setCenter(new OpenLayers.LonLat(0,0),1); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.zoomToMaxExtent(); map.addControl(new OpenLayers.Control.MousePosition()); } </script> <style> @media screen { #map{width: 1300px; height:1300px; border: 1px solid black;} } </style> </head> <body onload="init()"> <h3>OpenLayers Tutorial - Basic Map Setup</h3> <div id="map"></div> </body></html>\[/code\]
 
Back
Top