r84250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84249‎ | r84250 | r84251 >
Date:15:14, 18 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fix not showing up of marker when there is only one location for google maps v2 introduced by KML patch...
Modified paths:
  • /branches/Maps0.7.x/RELEASE-NOTES (modified) (history)
  • /branches/Maps0.7.x/includes/services/GoogleMaps/GoogleMapFunctions.js (modified) (history)

Diff [purge]

Index: branches/Maps0.7.x/RELEASE-NOTES
@@ -12,6 +12,8 @@
1313
1414 * Fixed fatal error occuring when running maintenance/refreshLinks.php
1515
 16+* Fixed not showing up of marker for Google Maps v2 when there is only one location.
 17+
1618 === Maps 0.7.5 ===
1719 (2011-02-16)
1820
Index: branches/Maps0.7.x/includes/services/GoogleMaps/GoogleMapFunctions.js
@@ -183,16 +183,19 @@
184184 myZoom = mapOptions.zoom;
185185 }
186186
 187+ for (var i = markers.length - 1; i >= 0; i--) {
 188+ var marker = markers[i];
 189+ marker.point = new GLatLng(marker.lat, marker.lon);
 190+ map.addOverlay(createGMarker(marker));
 191+ }
 192+
187193 // possibly, create bounds from markers
188194 if ((mapOptions.zoom == null || mapOptions.centre == null)
189195 && markers.length >= 1) {
190196 var bounds = new GLatLngBounds();
191197
192 - for (i = markers.length - 1; i >= 0; i--) {
193 - var marker = markers[i];
194 - marker.point = new GLatLng(marker.lat, marker.lon);
195 - map.addOverlay(createGMarker(marker));
196 - bounds.extend(marker.point);
 198+ for (var i = markers.length - 1; i >= 0; i--) {
 199+ bounds.extend(markers[i].point);
197200 }
198201 if (myCenter == null) {
199202 myCenter = bounds.getCenter();

Status & tagging log