Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMaps.php |
— | — | @@ -29,7 +29,10 @@ |
30 | 30 | global $egMapsYahooMapsZoom, $egMapsYahooMapsPrefix; |
31 | 31 | |
32 | 32 | $this->elementNamePrefix = $egMapsYahooMapsPrefix; |
33 | | - $this->defaultZoom = $egMapsYahooMapsZoom; |
| 33 | + |
| 34 | + $this->defaultZoom = $egMapsYahooMapsZoom; |
| 35 | + |
| 36 | + $this->defaultParams = MapsYahooMapsUtils::getDefaultParams(); |
34 | 37 | } |
35 | 38 | |
36 | 39 | /** |
— | — | @@ -43,8 +46,6 @@ |
44 | 47 | $egYahooMapsOnThisPage++; |
45 | 48 | |
46 | 49 | $this->elementNr = $egYahooMapsOnThisPage; |
47 | | - |
48 | | - $this->defaultParams = MapsYahooMapsUtils::getDefaultParams(); |
49 | 50 | } |
50 | 51 | |
51 | 52 | /** |
— | — | @@ -54,7 +55,7 @@ |
55 | 56 | protected function addSpecificMapHTML() { |
56 | 57 | global $wgJsMimeType; |
57 | 58 | |
58 | | - $this->type = MapsYahooMapsUtils::getYMapType($this->type); |
| 59 | + $this->type = MapsYahooMapsUtils::getYMapType($this->type, true); |
59 | 60 | $this->controls = MapsYahooMapsUtils::createControlsString($this->controls); |
60 | 61 | |
61 | 62 | MapsUtils::makePxValue($this->width); |
— | — | @@ -72,14 +73,18 @@ |
73 | 74 | $markerItems[] = "getYMarkerData($lat, $lon, '$title', '$label', '')"; |
74 | 75 | } |
75 | 76 | |
76 | | - $markersString = implode(',', $markerItems); |
| 77 | + $markersString = implode(',', $markerItems); |
| 78 | + |
| 79 | + $this->types = explode(",", $this->types); |
77 | 80 | |
| 81 | + $typesString = MapsYahooMapsUtils::createTypesString($this->types); |
| 82 | + |
78 | 83 | $this->output .= " |
79 | 84 | <div id='$this->mapName' style='width: $this->width; height: $this->height;'></div> |
80 | 85 | |
81 | 86 | <script type='$wgJsMimeType'>/*<![CDATA[*/ |
82 | 87 | addLoadEvent( |
83 | | - initializeYahooMap('$this->mapName', $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, [$this->controls], $this->autozoom, [$markersString]) |
| 88 | + initializeYahooMap('$this->mapName', $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, [$typesString], [$this->controls], $this->autozoom, [$markersString]) |
84 | 89 | ); |
85 | 90 | /*]]>*/</script>"; |
86 | 91 | |
Index: trunk/extensions/SemanticMaps/SM_MapPrinter.php |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | |
65 | 65 | $this->setQueryPrinterSettings(); |
66 | 66 | |
67 | | - $this->manageMapProperties($this->m_params, 'SMMapPrinter'); |
| 67 | + $this->manageMapProperties($this->m_params); |
68 | 68 | |
69 | 69 | $this->doMapServiceLoad(); |
70 | 70 | |
— | — | @@ -168,26 +168,28 @@ |
169 | 169 | return $icon; |
170 | 170 | } |
171 | 171 | |
172 | | - private function manageMapProperties($mapProperties, $className) { |
| 172 | + private function manageMapProperties($mapProperties) { |
173 | 173 | global $egMapsServices; |
174 | 174 | |
175 | 175 | $mapProperties = MapsMapper::getValidParams($mapProperties, $egMapsServices[$this->serviceName]['parameters']); |
176 | 176 | $mapProperties = MapsMapper::setDefaultParValues($mapProperties, $this->defaultParams); |
177 | 177 | |
| 178 | + if (isset($this->serviceName)) $mapProperties['service'] = $this->serviceName; |
| 179 | + |
178 | 180 | // Go through the array with map parameters and create new variables |
179 | 181 | // with the name of the key and value of the item if they don't exist on class level yet. |
180 | 182 | foreach($mapProperties as $paramName => $paramValue) { |
181 | | - if (!property_exists($className, $paramName)) { |
| 183 | + if (!property_exists(__CLASS__, $paramName)) { |
182 | 184 | $this->{$paramName} = $paramValue; |
183 | 185 | } |
184 | 186 | } |
185 | | - |
| 187 | + |
186 | 188 | MapsMapper::enforceArrayValues($this->controls); |
187 | 189 | } |
188 | 190 | |
189 | 191 | /** |
190 | 192 | * Sets the zoom level to the provided value, or when not set, to the default. |
191 | | - * |
| 193 | + *r |
192 | 194 | */ |
193 | 195 | private function setZoom() { |
194 | 196 | if (strlen($this->zoom) < 1) { |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMaps.php |
— | — | @@ -62,10 +62,10 @@ |
63 | 63 | global $wgJsMimeType; |
64 | 64 | |
65 | 65 | $enableEarth = MapsGoogleMapsUtils::getEarthValue($this->earth); |
66 | | - $this->earth = MapsMapper::getJSBoolValue($enableEarth); |
67 | 66 | |
68 | 67 | // Get the Google Maps names for the control and map types |
69 | | - $this->type = MapsGoogleMapsUtils::getGMapType($this->type, $enableEarth); |
| 68 | + $this->type = MapsGoogleMapsUtils::getGMapType($this->type, true); |
| 69 | + |
70 | 70 | $control = MapsGoogleMapsUtils::getGControlType($this->controls); |
71 | 71 | |
72 | 72 | $this->autozoom = MapsGoogleMapsUtils::getAutozoomJSValue($this->autozoom); |
— | — | @@ -82,11 +82,15 @@ |
83 | 83 | |
84 | 84 | $markersString = implode(',', $markerItems); |
85 | 85 | |
| 86 | + $this->types = explode(",", $this->types); |
| 87 | + |
| 88 | + $typesString = MapsGoogleMapsUtils::createTypesString($this->types, $enableEarth); |
| 89 | + |
86 | 90 | $this->output .= <<<END |
87 | 91 | <div id="$this->mapName" class="$this->class" style="$this->style" ></div> |
88 | 92 | <script type="$wgJsMimeType"> /*<![CDATA[*/ |
89 | 93 | addLoadEvent( |
90 | | - initializeGoogleMap('$this->mapName', $this->width, $this->height, $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, new $control(), $this->autozoom, $this->earth, [$markersString]) |
| 94 | + initializeGoogleMap('$this->mapName', $this->width, $this->height, $this->centre_lat, $this->centre_lon, $this->zoom, $this->type, [$typesString], new $control(), $this->autozoom, [$markersString]) |
91 | 95 | ); |
92 | 96 | /*]]>*/ </script> |
93 | 97 | |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -60,17 +60,21 @@ |
61 | 61 | protected function addSpecificMapHTML() { |
62 | 62 | global $wgJsMimeType; |
63 | 63 | |
64 | | - $enableEarth = $this-earth == 'on' || $this->earth == 'yes'; |
65 | | - $earth = $enableEarth ? 'true' : 'false'; |
| 64 | + $enableEarth = MapsGoogleMapsUtils::getEarthValue($this->earth); |
66 | 65 | |
67 | | - $this->type = MapsGoogleMapsUtils::getGMapType($this->type, $enableEarth); |
| 66 | + $this->type = MapsGoogleMapsUtils::getGMapType($this->type, true); |
| 67 | + |
68 | 68 | $control = MapsGoogleMapsUtils::getGControlType($this->controls); |
69 | 69 | |
| 70 | + $this->types = explode(",", $this->types); |
| 71 | + |
| 72 | + $typesString = MapsMapper::createTypesString($this->types, $enableEarth); |
| 73 | + |
70 | 74 | $this->output .= " |
71 | 75 | <div id='".$this->mapName."' class='".$this->class."'></div> |
72 | 76 | |
73 | 77 | <script type='$wgJsMimeType'>/*<![CDATA[*/ |
74 | | - addLoadEvent(makeFormInputGoogleMap('".$this->mapName."', '".$this->coordsFieldName."', ".$this->width.", ".$this->height.", ".$this->centre_lat.", ".$this->centre_lon.", ".$this->zoom.", ".$this->marker_lat.", ".$this->marker_lon.", ".$this->type.", new $control(), ".$this->autozoom.", $earth)); |
| 78 | + addLoadEvent(makeFormInputGoogleMap('$this->mapName', '$this->coordsFieldName', $this->width, $this->height, $this->centre_lat, $this->centre_lon, $this->zoom, $this->marker_lat, $this->marker_lon, $this->type, [$typesString], new $control(), $this->autozoom)); |
75 | 79 | window.unload = GUnload; |
76 | 80 | /*]]>*/</script>"; |
77 | 81 | } |