r69345 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69344‎ | r69345 | r69346 >
Date:20:46, 14 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Quick fix for r69287
Modified paths:
  • /trunk/extensions/Maps/Features/DisplayPoint/Maps_BasePointMap.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Features/DisplayPoint/Maps_BasePointMap.php
@@ -151,7 +151,7 @@
152152 $this->zoom = $this->service->getDefaultZoom();
153153 }
154154
155 - $this->markerJs = $this->service->createMarkersJs();
 155+ $this->markerJs = $this->service->createMarkersJs( $this->markerData );
156156
157157 $this->addSpecificMapHTML();
158158
@@ -189,7 +189,9 @@
190190 }
191191
192192 // 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+ }
194196
195197 // Get the url for the icon when there is one, else set the icon to an empty string.
196198 if ( array_key_exists( 'icon', $markerData ) ) {
@@ -200,6 +202,16 @@
201203 $markerData['icon'] = '';
202204 }
203205
 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+
204216 $this->markerData[] = $markerData;
205217 }
206218 }
@@ -212,8 +224,8 @@
213225 if ( empty( $this->centre ) ) {
214226 if ( count( $this->markerData ) == 1 ) {
215227 // 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] );
218230 }
219231 elseif ( count( $this->markerData ) > 1 ) {
220232 // If centre is not set and there are multiple markers, set the values to null,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69287Changes for 0.6.5, extensive refactoring, following up on changes made in 0.6...jeroendedauw10:05, 12 July 2010

Status & tagging log