Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMaps.php |
— | — | @@ -39,12 +39,12 @@ |
40 | 40 | protected function doMapServiceLoad() { |
41 | 41 | global $egYahooMapsOnThisPage; |
42 | 42 | |
43 | | - MapsYahooMaps::addYMapDependencies($this->output); |
| 43 | + MapsYahooMapsUtils::addYMapDependencies($this->output); |
44 | 44 | $egYahooMapsOnThisPage++; |
45 | 45 | |
46 | 46 | $this->elementNr = $egYahooMapsOnThisPage; |
47 | 47 | |
48 | | - $this->defaultParams = MapsYahooMaps::getDefaultParams(); |
| 48 | + $this->defaultParams = MapsYahooMapsUtils::getDefaultParams(); |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
— | — | @@ -54,13 +54,13 @@ |
55 | 55 | protected function addSpecificMapHTML() { |
56 | 56 | global $wgJsMimeType; |
57 | 57 | |
58 | | - $this->type = MapsYahooMaps::getYMapType($this->type); |
59 | | - $this->controls = MapsYahooMaps::createControlsString($this->controls); |
| 58 | + $this->type = MapsYahooMapsUtils::getYMapType($this->type); |
| 59 | + $this->controls = MapsYahooMapsUtils::createControlsString($this->controls); |
60 | 60 | |
61 | 61 | MapsUtils::makePxValue($this->width); |
62 | 62 | MapsUtils::makePxValue($this->height); |
63 | 63 | |
64 | | - $this->autozoom = MapsYahooMaps::getAutozoomJSValue($this->autozoom); |
| 64 | + $this->autozoom = MapsYahooMapsUtils::getAutozoomJSValue($this->autozoom); |
65 | 65 | |
66 | 66 | $markerItems = array(); |
67 | 67 | |
Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | |
31 | 31 | $this->earthZoom = 17; |
32 | 32 | |
33 | | - $this->defaultParams = MapsYahooMaps::getDefaultParams(); |
| 33 | + $this->defaultParams = MapsYahooMapsUtils::getDefaultParams(); |
34 | 34 | $this->defaultZoom = $egMapsYahooMapsZoom; |
35 | 35 | } |
36 | 36 | |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | |
44 | 44 | if (empty($egYahooMapsOnThisPage)) { |
45 | 45 | $egYahooMapsOnThisPage = 0; |
46 | | - MapsYahooMaps::addYMapDependencies($this->output); |
| 46 | + MapsYahooMapsUtils::addYMapDependencies($this->output); |
47 | 47 | } |
48 | 48 | $egYahooMapsOnThisPage++; |
49 | 49 | |
— | — | @@ -56,15 +56,15 @@ |
57 | 57 | protected function addSpecificMapHTML() { |
58 | 58 | global $wgJsMimeType; |
59 | 59 | |
60 | | - $type = MapsYahooMaps::getYMapType($this->type); |
| 60 | + $type = MapsYahooMapsUtils::getYMapType($this->type); |
61 | 61 | |
62 | | - $controlItems = MapsYahooMaps::createControlsString($this->controls); |
| 62 | + $controlItems = MapsYahooMapsUtils::createControlsString($this->controls); |
63 | 63 | |
64 | | - $width = $this->width . 'px'; |
65 | | - $height = $this->height . 'px'; |
| 64 | + MapsUtils::makePxValue($this->width); |
| 65 | + MapsUtils::makePxValue($this->height); |
66 | 66 | |
67 | 67 | $this->output .=" |
68 | | - <div id='".$this->mapName."' style='width: $width; height: $height;'></div> |
| 68 | + <div id='".$this->mapName."' style='width: $this->width; height: $this->height;'></div> |
69 | 69 | |
70 | 70 | <script type='$wgJsMimeType'>/*<![CDATA[*/ |
71 | 71 | addLoadEvent(makeFormInputYahooMap('".$this->mapName."', '".$this->coordsFieldName."', ".$this->centre_lat.", ".$this->centre_lon.", ".$this->zoom.", ".$this->marker_lat.", ".$this->marker_lon.", $type, [$controlItems], ".$this->autozoom.")); |
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayers.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | $this->elementNamePrefix = $egMapsOpenLayersPrefix; |
34 | 34 | $this->defaultZoom = $egMapsOpenLayersZoom; |
35 | 35 | |
36 | | - $this->defaultParams = MapsOpenLayers::getDefaultParams(); |
| 36 | + $this->defaultParams = MapsOpenLayersUtils::getDefaultParams(); |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | protected function doMapServiceLoad() { |
44 | 44 | global $egOpenLayersOnThisPage; |
45 | 45 | |
46 | | - MapsOpenLayers::addOLDependencies($this->output); |
| 46 | + MapsOpenLayersUtils::addOLDependencies($this->output); |
47 | 47 | $egOpenLayersOnThisPage++; |
48 | 48 | |
49 | 49 | $this->elementNr = $egOpenLayersOnThisPage; |
— | — | @@ -55,10 +55,10 @@ |
56 | 56 | protected function addSpecificMapHTML() { |
57 | 57 | global $wgJsMimeType; |
58 | 58 | |
59 | | - $controlItems = MapsOpenLayers::createControlsString($this->controls); |
| 59 | + $controlItems = MapsOpenLayersUtils::createControlsString($this->controls); |
60 | 60 | |
61 | 61 | MapsMapper::enforceArrayValues($this->layers); |
62 | | - $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies($this->output, $this->layers); |
| 62 | + $layerItems = MapsOpenLayersUtils::createLayersStringAndLoadDependencies($this->output, $this->layers); |
63 | 63 | |
64 | 64 | MapsUtils::makePxValue($this->width); |
65 | 65 | MapsUtils::makePxValue($this->height); |
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | |
31 | 31 | $this->earthZoom = 1; |
32 | 32 | |
33 | | - $this->defaultParams = MapsOpenLayers::getDefaultParams(); |
| 33 | + $this->defaultParams = MapsOpenLayersUtils::getDefaultParams(); |
34 | 34 | $this->defaultZoom = $egMapsOpenLayersZoom; |
35 | 35 | } |
36 | 36 | |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | protected function doMapServiceLoad() { |
42 | 42 | global $egOpenLayersOnThisPage; |
43 | 43 | |
44 | | - MapsOpenLayers::addOLDependencies($this->output); |
| 44 | + MapsOpenLayersUtils::addOLDependencies($this->output); |
45 | 45 | $egOpenLayersOnThisPage++; |
46 | 46 | |
47 | 47 | $this->elementNr = $egOpenLayersOnThisPage; |
— | — | @@ -53,9 +53,9 @@ |
54 | 54 | protected function addSpecificMapHTML() { |
55 | 55 | global $wgJsMimeType; |
56 | 56 | |
57 | | - $controlItems = MapsOpenLayers::createControlsString($this->controls); |
| 57 | + $controlItems = MapsOpenLayersUtils::createControlsString($this->controls); |
58 | 58 | |
59 | | - $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies($this->output, $this->layers); |
| 59 | + $layerItems = MapsOpenLayersUtils::createLayersStringAndLoadDependencies($this->output, $this->layers); |
60 | 60 | |
61 | 61 | $width = $this->width . 'px'; |
62 | 62 | $height = $this->height . 'px'; |
Index: trunk/extensions/SemanticMaps/SM_MapPrinter.php |
— | — | @@ -207,9 +207,11 @@ |
208 | 208 | */ |
209 | 209 | private function setCentre() { |
210 | 210 | if (strlen($this->centre) > 0) { |
| 211 | + // If a centre value is set, use it. |
211 | 212 | list($this->centre_lat, $this->centre_lon) = MapsUtils::getLatLon($this->centre); |
212 | 213 | } |
213 | 214 | else { |
| 215 | + // If centre is not set, set the values to null, to be auto determined by the JS of the mapping API. |
214 | 216 | $this->centre_lat = 'null'; |
215 | 217 | $this->centre_lon = 'null'; |
216 | 218 | } |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMaps.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | |
36 | 36 | $this->defaultZoom = $egMapsGoogleMapsZoom; |
37 | 37 | |
38 | | - $this->defaultParams = MapsGoogleMaps::getDefaultParams(); |
| 38 | + $this->defaultParams = MapsGoogleMapsUtils::getDefaultParams(); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | |
48 | 48 | if (empty($egGoogleMapsOnThisPage)) { |
49 | 49 | $egGoogleMapsOnThisPage = 0; |
50 | | - MapsGoogleMaps::addGMapDependencies($this->output); |
| 50 | + MapsGoogleMapsUtils::addGMapDependencies($this->output); |
51 | 51 | } |
52 | 52 | |
53 | 53 | $egGoogleMapsOnThisPage++; |
— | — | @@ -61,14 +61,14 @@ |
62 | 62 | protected function addSpecificMapHTML() { |
63 | 63 | global $wgJsMimeType; |
64 | 64 | |
65 | | - $enableEarth = MapsGoogleMaps::getEarthValue($this->earth); |
| 65 | + $enableEarth = MapsGoogleMapsUtils::getEarthValue($this->earth); |
66 | 66 | $this->earth = MapsMapper::getJSBoolValue($enableEarth); |
67 | 67 | |
68 | 68 | // Get the Google Maps names for the control and map types |
69 | | - $this->type = MapsGoogleMaps::getGMapType($this->type, $enableEarth); |
70 | | - $control = MapsGoogleMaps::getGControlType($this->controls); |
| 69 | + $this->type = MapsGoogleMapsUtils::getGMapType($this->type, $enableEarth); |
| 70 | + $control = MapsGoogleMapsUtils::getGControlType($this->controls); |
71 | 71 | |
72 | | - $this->autozoom = MapsGoogleMaps::getAutozoomJSValue($this->autozoom); |
| 72 | + $this->autozoom = MapsGoogleMapsUtils::getAutozoomJSValue($this->autozoom); |
73 | 73 | |
74 | 74 | $markerItems = array(); |
75 | 75 | |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | |
33 | 33 | $this->earthZoom = 1; |
34 | 34 | |
35 | | - $this->defaultParams = MapsGoogleMaps::getDefaultParams(); |
| 35 | + $this->defaultParams = MapsGoogleMapsUtils::getDefaultParams(); |
36 | 36 | $this->defaultZoom = $egMapsGoogleMapsZoom; |
37 | 37 | } |
38 | 38 | |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | |
47 | 47 | if (empty($egGoogleMapsOnThisPage)) { |
48 | 48 | $egGoogleMapsOnThisPage = 0; |
49 | | - MapsGoogleMaps::addGMapDependencies($this->output); |
| 49 | + MapsGoogleMapsUtils::addGMapDependencies($this->output); |
50 | 50 | } |
51 | 51 | |
52 | 52 | $egGoogleMapsOnThisPage++; |
— | — | @@ -63,8 +63,8 @@ |
64 | 64 | $enableEarth = $this-earth == 'on' || $this->earth == 'yes'; |
65 | 65 | $earth = $enableEarth ? 'true' : 'false'; |
66 | 66 | |
67 | | - $this->type = MapsGoogleMaps::getGMapType($this->type, $enableEarth); |
68 | | - $control = MapsGoogleMaps::getGControlType($this->controls); |
| 67 | + $this->type = MapsGoogleMapsUtils::getGMapType($this->type, $enableEarth); |
| 68 | + $control = MapsGoogleMapsUtils::getGControlType($this->controls); |
69 | 69 | |
70 | 70 | $this->output .= " |
71 | 71 | <div id='".$this->mapName."' class='".$this->class."'></div> |