| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|---|
| 2 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" debug="true"> |
|---|
| 4 |
<head> |
|---|
| 5 |
<style type="text/css"> |
|---|
| 6 |
body { |
|---|
| 7 |
margin: 0; |
|---|
| 8 |
padding: 0; |
|---|
| 9 |
} |
|---|
| 10 |
#map { |
|---|
| 11 |
width: 512px; |
|---|
| 12 |
height: 256px; |
|---|
| 13 |
} |
|---|
| 14 |
</style> |
|---|
| 15 |
<script src="../lib/Firebug/firebug.js"></script> |
|---|
| 16 |
<script src="../lib/OpenLayers.js"></script> |
|---|
| 17 |
<script type="text/javascript"> |
|---|
| 18 |
<!-- |
|---|
| 19 |
function init(){ |
|---|
| 20 |
var map = new OpenLayers.Map('map'); |
|---|
| 21 |
|
|---|
| 22 |
map.addControl(new OpenLayers.Control.MousePosition()); |
|---|
| 23 |
|
|---|
| 24 |
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", |
|---|
| 25 |
"http://labs.metacarta.com/wms/vmap0", |
|---|
| 26 |
{layers: 'basic'} ); |
|---|
| 27 |
|
|---|
| 28 |
map.addLayers([ol_wms]); |
|---|
| 29 |
if (!map.getCenter()) map.zoomToMaxExtent(); |
|---|
| 30 |
|
|---|
| 31 |
map.events.register("mousemove", map, function(e) { |
|---|
| 32 |
var position = this.events.getMousePosition(e); |
|---|
| 33 |
window.status = position; |
|---|
| 34 |
}); |
|---|
| 35 |
} |
|---|
| 36 |
// --> |
|---|
| 37 |
</script> |
|---|
| 38 |
</head> |
|---|
| 39 |
<body onload="init()"> |
|---|
| 40 |
<div id="map"></div> |
|---|
| 41 |
<div id="coords"></div> |
|---|
| 42 |
</body> |
|---|
| 43 |
</html> |
|---|