<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
// making this a global variable so that it is accessible for
// debugging/inspecting in Firebug
var map = null;
function init(){
map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'}
);
map.addLayers([ol_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
map.events.register('click', map, function (e) {
lonlat = map.getLonLatFromViewPortPx(e.xy);
temphtml = "popup";
popup = new OpenLayers.Popup.FramedCloud("popup",
lonlat,
new OpenLayers.Size(250,40),
temphtml,
null, true );
map.addPopup(popup);
});
}
</script>
</head>
<body onload="init()">
<div id="map" ></div>
</body>
</html>