|
Revision 4222, 1.3 kB
(checked in by tschaub, 1 year ago)
|
exposing the map for firebuggers - and removing some crufty html comments
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 2 |
<head> |
|---|
| 3 |
<style type="text/css"> |
|---|
| 4 |
#map { |
|---|
| 5 |
width: 512px; |
|---|
| 6 |
height: 512px; |
|---|
| 7 |
border: 1px solid black; |
|---|
| 8 |
} |
|---|
| 9 |
</style> |
|---|
| 10 |
<script src="../lib/OpenLayers.js"></script> |
|---|
| 11 |
<script type="text/javascript"> |
|---|
| 12 |
var map; |
|---|
| 13 |
function init(){ |
|---|
| 14 |
map = new OpenLayers.Map('map'); |
|---|
| 15 |
|
|---|
| 16 |
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", |
|---|
| 17 |
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} ); |
|---|
| 18 |
|
|---|
| 19 |
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", |
|---|
| 20 |
"http://wms.jpl.nasa.gov/wms.cgi", |
|---|
| 21 |
{layers: "modis,global_mosaic"}); |
|---|
| 22 |
|
|---|
| 23 |
jpl_wms.setVisibility(false); |
|---|
| 24 |
|
|---|
| 25 |
map.addLayers([ol_wms, jpl_wms]); |
|---|
| 26 |
map.addControl(new OpenLayers.Control.LayerSwitcher()); |
|---|
| 27 |
|
|---|
| 28 |
map.zoomToMaxExtent(); |
|---|
| 29 |
map.events.register("click", map, function(e) { |
|---|
| 30 |
var lonlat = map.getLonLatFromViewPortPx(e.xy); |
|---|
| 31 |
alert("You clicked near " + lonlat.lat + " N, " + |
|---|
| 32 |
+ lonlat.lon + " E"); |
|---|
| 33 |
}); |
|---|
| 34 |
} |
|---|
| 35 |
</script> |
|---|
| 36 |
</head> |
|---|
| 37 |
<body onload="init()"> |
|---|
| 38 |
<h1>OpenLayers Example</h1> |
|---|
| 39 |
<div id="map"></div> |
|---|
| 40 |
</body> |
|---|
| 41 |
</html> |
|---|