r74976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74975‎ | r74976 | r74977 >
Date:23:13, 18 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.7.1 - fixed location encoding issue
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_CoordinateParser.php (modified) (history)
  • /trunk/extensions/Maps/includes/features/Maps_BasePointMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMaps.php
@@ -127,7 +127,7 @@
128128 $markerItems = array();
129129
130130 foreach ( $markers as $marker ) {
131 - $markerItems[] = Xml::encodeJsVar( (object)array(
 131+ $markerItems[] = MapsMapper::encodeJsVar( (object)array(
132132 'lat' => $marker[0],
133133 'lon' => $marker[1],
134134 'title' => $marker[2],
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php
@@ -87,7 +87,7 @@
8888 $defaultGroup = wfMsg( 'maps-markers' );
8989 //.// TODO
9090 foreach ( $markers as $marker ) {
91 - $markerItems[false ? $marker[5] : $defaultGroup] = Xml::encodeJsVar( (object)array(
 91+ $markerItems[false ? $marker[5] : $defaultGroup] = MapsMapper::encodeJsVar( (object)array(
9292 'lat' => $marker[0],
9393 'lon' => $marker[1],
9494 'title' => $marker[2],
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php
@@ -146,7 +146,7 @@
147147 $markerItems = array();
148148
149149 foreach ( $markers as $marker ) {
150 - $markerItems[] = Xml::encodeJsVar( (object)array(
 150+ $markerItems[] = MapsMapper::encodeJsVar( (object)array(
151151 'lat' => $marker[0],
152152 'lon' => $marker[1],
153153 'title' => $marker[2],
Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php
@@ -42,7 +42,7 @@
4343 *
4444 * @param string $coordinates The coordinates to be parsed.
4545 *
46 - * @return array or false
 46+ * @return array of float or false
4747 */
4848 public static function parseCoordinates( $coordinates ) {
4949 // Handle i18n notations.
@@ -78,8 +78,8 @@
7979
8080 // Parse both latitude and longitude to float notation, and return the result.
8181 return array(
82 - 'lat' => self::parseCoordinate( $coordinates['lat'], $coordsType ),
83 - 'lon' => self::parseCoordinate( $coordinates['lon'], $coordsType ),
 82+ 'lat' => (float)self::parseCoordinate( $coordinates['lat'], $coordsType ),
 83+ 'lon' => (float)self::parseCoordinate( $coordinates['lon'], $coordsType ),
8484 );
8585 }
8686
@@ -166,7 +166,7 @@
167167 * @param coordinate type $targetFormat The notation to which they should be formatted. Defaults to floats.
168168 * @param boolean $directional Indicates if the target notation should be directional. Defaults to false.
169169 *
170 - * @return array
 170+ * @return array of string
171171 */
172172 public static function formatToArray( array $coordinates, $targetFormat = Maps_COORDS_FLOAT, $directional = false ) {
173173 if ( !array_key_exists( 'lat', $coordinates ) || !array_key_exists( 'lon', $coordinates ) ) {
Index: trunk/extensions/Maps/includes/features/Maps_BasePointMap.php
@@ -124,7 +124,7 @@
125125 // Each $args is an array containg the coordinate set as first element, possibly followed by meta data.
126126 foreach ( $this->coordinates as $args ) {
127127 $markerData = MapsCoordinateParser::parseCoordinates( array_shift( $args ) );
128 -
 128+
129129 if ( !$markerData ) continue;
130130
131131 if ( count( $args ) > 0 ) {

Status & tagging log