Index: trunk/extensions/Maps/Features/DisplayPoint/Maps_BasePointMap.php |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | $this->zoom = $this->service->getDefaultZoom(); |
153 | 153 | } |
154 | 154 | |
155 | | - $this->markerJs = $this->service->createMarkersJs(); |
| 155 | + $this->markerJs = $this->service->createMarkersJs( $this->markerData ); |
156 | 156 | |
157 | 157 | $this->addSpecificMapHTML(); |
158 | 158 | |
— | — | @@ -189,7 +189,9 @@ |
190 | 190 | } |
191 | 191 | |
192 | 192 | // If there is no point specific icon, use the general icon parameter when available. |
193 | | - if ( !array_key_exists( 'icon', $markerData ) && strlen( $this->icon ) > 0 ) $markerData['icon'] = $this->icon; |
| 193 | + if ( !array_key_exists( 'icon', $markerData ) && strlen( $this->icon ) > 0 ) { |
| 194 | + $markerData['icon'] = $this->icon; |
| 195 | + } |
194 | 196 | |
195 | 197 | // Get the url for the icon when there is one, else set the icon to an empty string. |
196 | 198 | if ( array_key_exists( 'icon', $markerData ) ) { |
— | — | @@ -200,6 +202,16 @@ |
201 | 203 | $markerData['icon'] = ''; |
202 | 204 | } |
203 | 205 | |
| 206 | + // Temporary fix, will refactor away later |
| 207 | + // TODO |
| 208 | + $markerData = array_values( $markerData ); |
| 209 | + if ( count( $markerData ) < 5 ) { |
| 210 | + if ( count( $markerData ) < 4 ) { |
| 211 | + $markerData[] = ''; |
| 212 | + } |
| 213 | + $markerData[] = ''; |
| 214 | + } |
| 215 | + |
204 | 216 | $this->markerData[] = $markerData; |
205 | 217 | } |
206 | 218 | } |
— | — | @@ -212,8 +224,8 @@ |
213 | 225 | if ( empty( $this->centre ) ) { |
214 | 226 | if ( count( $this->markerData ) == 1 ) { |
215 | 227 | // If centre is not set and there is exactly one marker, use its coordinates. |
216 | | - $this->centreLat = Xml::escapeJsString( $this->markerData[0]['lat'] ); |
217 | | - $this->centreLon = Xml::escapeJsString( $this->markerData[0]['lon'] ); |
| 228 | + $this->centreLat = Xml::escapeJsString( $this->markerData[0][0] ); |
| 229 | + $this->centreLon = Xml::escapeJsString( $this->markerData[0][1] ); |
218 | 230 | } |
219 | 231 | elseif ( count( $this->markerData ) > 1 ) { |
220 | 232 | // If centre is not set and there are multiple markers, set the values to null, |