|
Revision 4222, 1.4 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 box_extents = [ |
|---|
| 13 |
[-10, 50, 5, 60], |
|---|
| 14 |
[-75, 41, -71, 44], |
|---|
| 15 |
[-122.6, 37.6, -122.3, 37.9], |
|---|
| 16 |
[10, 10, 20, 20] |
|---|
| 17 |
]; |
|---|
| 18 |
var map; |
|---|
| 19 |
function init(){ |
|---|
| 20 |
map = new OpenLayers.Map('map'); |
|---|
| 21 |
|
|---|
| 22 |
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", |
|---|
| 23 |
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} ); |
|---|
| 24 |
|
|---|
| 25 |
var boxes = new OpenLayers.Layer.Boxes( "Boxes" ); |
|---|
| 26 |
|
|---|
| 27 |
for (var i = 0; i < box_extents.length; i++) { |
|---|
| 28 |
ext = box_extents[i]; |
|---|
| 29 |
bounds = new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]); |
|---|
| 30 |
box = new OpenLayers.Marker.Box(bounds); |
|---|
| 31 |
box.events.register("click", box, function (e) { |
|---|
| 32 |
this.setBorder("yellow"); |
|---|
| 33 |
}); |
|---|
| 34 |
boxes.addMarker(box); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
map.addLayers([ol_wms, boxes]); |
|---|
| 38 |
map.addControl(new OpenLayers.Control.LayerSwitcher()); |
|---|
| 39 |
map.zoomToMaxExtent(); |
|---|
| 40 |
} |
|---|
| 41 |
</script> |
|---|
| 42 |
</head> |
|---|
| 43 |
<body onload="init()"> |
|---|
| 44 |
<h1>OpenLayers Example</h1> |
|---|
| 45 |
<div id="map"></div> |
|---|
| 46 |
</body> |
|---|
| 47 |
</html> |
|---|