Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -77,8 +77,7 @@ |
78 | 78 | $this->zoom, |
79 | 79 | [$layerItems], |
80 | 80 | [$this->controls], |
81 | | - [$this->markerString], |
82 | | - $this->height |
| 81 | + [$this->markerString] |
83 | 82 | ); |
84 | 83 | } |
85 | 84 | ); |
Index: trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js |
— | — | @@ -11,9 +11,9 @@ |
12 | 12 | * Creates and initializes an OpenLayers map. |
13 | 13 | * The resulting map is returned by the function but no further handling is required in most cases. |
14 | 14 | */ |
15 | | -function initOpenLayer(mapName, lon, lat, zoom, mapTypes, controls, marker_data, height){ |
| 15 | +function initOpenLayer(mapName, lon, lat, zoom, mapTypes, controls, marker_data){ |
16 | 16 | |
17 | | - // Create a new OpenLayers map with without any controls on it |
| 17 | + // Create a new OpenLayers map with without any controls on it. |
18 | 18 | var mapOptions = { |
19 | 19 | projection: new OpenLayers.Projection("EPSG:900913"), |
20 | 20 | displayProjection: new OpenLayers.Projection("EPSG:4326"), |
— | — | @@ -26,13 +26,13 @@ |
27 | 27 | |
28 | 28 | var map = new OpenLayers.Map(mapName, mapOptions); |
29 | 29 | |
30 | | - // Add the controls |
| 30 | + // Add the controls. |
31 | 31 | for (i in controls) { |
32 | 32 | |
33 | | - // If a string is provided, find the correct name for the control, and use eval to create the object itself |
| 33 | + // If a string is provided, find the correct name for the control, and use eval to create the object itself. |
34 | 34 | if (typeof controls[i] == 'string') { |
35 | 35 | if (controls[i].toLowerCase() == 'autopanzoom') { |
36 | | - if (height > 140) controls[i] = height > 320 ? 'panzoombar' : 'panzoom'; |
| 36 | + //if (height > 140) controls[i] = height > 320 ? 'panzoombar' : 'panzoom'; |
37 | 37 | } |
38 | 38 | |
39 | 39 | control = getValidControlName(controls[i]); |
— | — | @@ -42,16 +42,16 @@ |
43 | 43 | } |
44 | 44 | } |
45 | 45 | else { |
46 | | - map.addControl(controls[i]); // If a control is provided, instead a string, just add it |
47 | | - controls[i].activate(); // And activate it |
| 46 | + map.addControl(controls[i]); // If a control is provided, instead a string, just add it. |
| 47 | + controls[i].activate(); // And activate it. |
48 | 48 | } |
49 | 49 | |
50 | 50 | } |
51 | 51 | |
52 | | - // Add the base layers |
| 52 | + // Add the base layers. |
53 | 53 | for (i in mapTypes) map.addLayer(mapTypes[i]); |
54 | 54 | |
55 | | - // Layer to hold the markers |
| 55 | + // Layer to hold the markers. |
56 | 56 | var markerLayer = new OpenLayers.Layer.Markers('Markers'); |
57 | 57 | markerLayer.id= 'markerLayer'; |
58 | 58 | map.addLayer(markerLayer); |
— | — | @@ -66,19 +66,19 @@ |
67 | 67 | |
68 | 68 | for (i in marker_data) { |
69 | 69 | marker_data[i].lonlat.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); |
70 | | - if (bounds != null) bounds.extend(marker_data[i].lonlat); // Extend the bounds when no center is set |
71 | | - markerLayer.addMarker(getOLMarker(markerLayer, marker_data[i], map.getProjectionObject())); // Create and add the marker |
| 70 | + if (bounds != null) bounds.extend(marker_data[i].lonlat); // Extend the bounds when no center is set. |
| 71 | + markerLayer.addMarker(getOLMarker(markerLayer, marker_data[i], map.getProjectionObject())); // Create and add the marker. |
72 | 72 | } |
73 | 73 | |
74 | | - if (bounds != null) map.zoomToExtent(bounds); // If a bounds object has been created, use it to set the zoom and center |
| 74 | + if (bounds != null) map.zoomToExtent(bounds); // If a bounds object has been created, use it to set the zoom and center. |
75 | 75 | |
76 | | - if (centerIsSet) { // When the center is provided, set it |
| 76 | + if (centerIsSet) { // When the center is provided, set it. |
77 | 77 | var centre = new OpenLayers.LonLat(lon, lat); |
78 | 78 | centre.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); |
79 | 79 | map.setCenter(centre); |
80 | 80 | } |
81 | 81 | |
82 | | - if (zoom != null) map.zoomTo(zoom); // When the zoom is provided, set it |
| 82 | + if (zoom != null) map.zoomTo(zoom); // When the zoom is provided, set it. |
83 | 83 | |
84 | 84 | return map; |
85 | 85 | } |
— | — | @@ -119,12 +119,12 @@ |
120 | 120 | |
121 | 121 | if (markerData.title.length + markerData.label.length > 0 ) { |
122 | 122 | |
123 | | - // This is the handler for the mousedown event on the marker, and displays the popup |
| 123 | + // This is the handler for the mousedown event on the marker, and displays the popup. |
124 | 124 | marker.events.register('mousedown', marker, |
125 | 125 | function(evt) { |
126 | 126 | var popup = new OpenLayers.Feature(markerLayer, markerData.lonlat).createPopup(true); |
127 | 127 | |
128 | | - if (markerData.title.length > 0 && markerData.label.length > 0) { // Add the title and label to the popup text |
| 128 | + if (markerData.title.length > 0 && markerData.label.length > 0) { // Add the title and label to the popup text. |
129 | 129 | popup.setContentHTML('<b>' + markerData.title + '</b><hr />' + markerData.label); |
130 | 130 | } |
131 | 131 | else { |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | |
135 | 135 | popup.setOpacity(0.85); |
136 | 136 | markerLayer.map.addPopup(popup); |
137 | | - OpenLayers.Event.stop(evt); // Stop the event |
| 137 | + OpenLayers.Event.stop(evt); // Stop the event. |
138 | 138 | } |
139 | 139 | ); |
140 | 140 | |
— | — | @@ -155,6 +155,12 @@ |
156 | 156 | function initOLSettings(minWidth, minHeight) { |
157 | 157 | OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3; |
158 | 158 | OpenLayers.Util.onImageLoadErrorColor = 'transparent'; |
159 | | - OpenLayers.Feature.prototype.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {'autoSize': true, 'minSize': new OpenLayers.Size(minWidth, minHeight)}); |
| 159 | + OpenLayers.Feature.prototype.popupClass = OpenLayers.Class( |
| 160 | + OpenLayers.Popup.FramedCloud, |
| 161 | + { |
| 162 | + 'autoSize': true, |
| 163 | + 'minSize': new OpenLayers.Size(minWidth, minHeight) |
| 164 | + } |
| 165 | + ); |
160 | 166 | } |
161 | 167 | |
Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispMap.php |
— | — | @@ -70,8 +70,7 @@ |
71 | 71 | $this->zoom, |
72 | 72 | [$layerItems], |
73 | 73 | [$this->controls], |
74 | | - [], |
75 | | - $this->height |
| 74 | + [] |
76 | 75 | ); |
77 | 76 | } |
78 | 77 | ); |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php |
— | — | @@ -81,8 +81,6 @@ |
82 | 82 | lat: $this->centre_lat, |
83 | 83 | lon: $this->centre_lon, |
84 | 84 | zoom: $this->zoom, |
85 | | - width: $this->width, |
86 | | - height: $this->height, |
87 | 85 | markers: [], |
88 | 86 | controls: [$this->controls] |
89 | 87 | } |
Index: trunk/extensions/Maps/OpenStreetMap/OSMFunctions.js |
— | — | @@ -43,16 +43,6 @@ |
44 | 44 | var mapId = 0; |
45 | 45 | var layer = null; |
46 | 46 | |
47 | | -if (false) { // wgSlippyMapSlippyByDefault |
48 | | - addOnloadHook(slippymap_init); |
49 | | -} |
50 | | - |
51 | | -function slippymap_init() { |
52 | | - for(keyName in slippymaps) { |
53 | | - slippymaps[keyName].init(); |
54 | | - } |
55 | | -} |
56 | | - |
57 | 47 | /** |
58 | 48 | * Gets a valid control name (with excat lower and upper case letters), |
59 | 49 | * or returns false when the control is not allowed. |
— | — | @@ -89,7 +79,7 @@ |
90 | 80 | for (i in this.controls) { |
91 | 81 | if (typeof controls[i] == 'string') { |
92 | 82 | if (this.controls[i].toLowerCase() == 'autopanzoom') { |
93 | | - if (this.height > 140) this.controls[i] = this.height > 320 ? 'panzoombar' : 'panzoom'; |
| 83 | + //if (this.height > 140) this.controls[i] = this.height > 320 ? 'panzoombar' : 'panzoom'; |
94 | 84 | } |
95 | 85 | |
96 | 86 | control = getValidControlName(this.controls[i]); |
— | — | @@ -99,8 +89,8 @@ |
100 | 90 | } |
101 | 91 | } |
102 | 92 | else { |
103 | | - this.mapOptions.controls.push(controls[i]); // If a control is provided, instead a string, just add it |
104 | | - controls[i].activate(); // And activate it |
| 93 | + this.mapOptions.controls.push(controls[i]); // If a control is provided, instead a string, just add it. |
| 94 | + controls[i].activate(); // And activate it. |
105 | 95 | } |
106 | 96 | } |
107 | 97 | } |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php |
— | — | @@ -67,8 +67,6 @@ |
68 | 68 | lat: $this->centre_lat, |
69 | 69 | lon: $this->centre_lon, |
70 | 70 | zoom: $this->zoom, |
71 | | - width: $this->width, |
72 | | - height: $this->height, |
73 | 71 | markers: [$this->markerString], |
74 | 72 | controls: [$this->controls] |
75 | 73 | } |