1 | <html xmlns="http://www.w3.org/1999/xhtml">
|
---|
2 | <head>
|
---|
3 | <!-- The map can not be set to 100%. It hangs -->
|
---|
4 | <style type="text/css">
|
---|
5 | #map {
|
---|
6 | width: 1200px;
|
---|
7 | height: 900px;
|
---|
8 | }
|
---|
9 | </style>
|
---|
10 | <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
---|
11 | <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
|
---|
12 | <script type="text/javascript">
|
---|
13 | // There seems to be a problem with this function and the Java JS engine, as the computed style
|
---|
14 | // does not have the function getPropertyValue.
|
---|
15 | OpenLayers.Element.getStyle = function(element, style) {
|
---|
16 | element = OpenLayers.Util.getElement(element);
|
---|
17 | var value = element.style[OpenLayers.String.camelize(style)];
|
---|
18 | if (!value) {
|
---|
19 | if (document.defaultView &&
|
---|
20 | document.defaultView.getComputedStyle && false) {
|
---|
21 |
|
---|
22 | var css = document.defaultView.getComputedStyle(element, null);
|
---|
23 | value = css ? css.getPropertyValue(style) : null;
|
---|
24 | } else if (element.currentStyle) {
|
---|
25 | value = element.currentStyle[OpenLayers.String.camelize(style)];
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | var positions = ['left', 'top', 'right', 'bottom'];
|
---|
30 | if (window.opera &&
|
---|
31 | (OpenLayers.Util.indexOf(positions,style) != -1) &&
|
---|
32 | (OpenLayers.Element.getStyle(element, 'position') == 'static')) {
|
---|
33 | value = 'auto';
|
---|
34 | }
|
---|
35 |
|
---|
36 | return value == 'auto' ? null : value;
|
---|
37 | }
|
---|
38 | </script>
|
---|
39 | <script type="text/javascript">
|
---|
40 | var map, yahooLayer;
|
---|
41 |
|
---|
42 | function init(){
|
---|
43 | var options = {
|
---|
44 | projection: "WGS84",
|
---|
45 | controls: []
|
---|
46 | };
|
---|
47 | map = new OpenLayers.Map('map', options );
|
---|
48 | yahooLayer = new OpenLayers.Layer.Yahoo( "Yahoo", {'type': YAHOO_MAP_SAT} );
|
---|
49 | map.addLayer(yahooLayer);
|
---|
50 | map.setCenter(new OpenLayers.LonLat(-3.6940, 40.4258), 12);
|
---|
51 | }
|
---|
52 | </script>
|
---|
53 | <script type="text/javascript">
|
---|
54 | function resizeMap(width, height)
|
---|
55 | {
|
---|
56 | var mapDiv = document.getElementById("map");
|
---|
57 | if( !mapDiv ) return;
|
---|
58 |
|
---|
59 | mapDiv.style.width = width;
|
---|
60 | mapDiv.style.height = height;
|
---|
61 |
|
---|
62 | if( map )
|
---|
63 | map.updateSize();
|
---|
64 | }
|
---|
65 |
|
---|
66 | function zoomMapToExtent(left, bottom, right, top)
|
---|
67 | {
|
---|
68 | if( !map ) return;
|
---|
69 |
|
---|
70 | map.zoomToExtent( new OpenLayers.Bounds(left, bottom, right, top) );
|
---|
71 | var extent = map.getExtent();
|
---|
72 | if( extent != null )
|
---|
73 | {
|
---|
74 | extent = extent.toArray();
|
---|
75 | }
|
---|
76 | return extent;
|
---|
77 | }
|
---|
78 | </script>
|
---|
79 | </head>
|
---|
80 |
|
---|
81 | <body onload="init()" style="overflow:hidden; margin: 0; padding: 0;">
|
---|
82 | <div id="overlay" style="background:white;opacity:0.5;z-index:10;">
|
---|
83 | <div id="map"></div>
|
---|
84 | </div>
|
---|
85 | </body>
|
---|
86 | </html>
|
---|