r61416 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61415‎ | r61416 | r61417 >
Date:15:09, 23 January 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.5.3.
* Google Maps v3 support
Modified paths:
  • /trunk/extensions/Maps/GoogleMaps3/GoogleMap3Functions.js (modified) (history)
  • /trunk/extensions/Maps/Maps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/GoogleMaps3/GoogleMap3Functions.js
@@ -17,9 +17,26 @@
1818
1919 // TODO: types - http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeRegistry
2020
21 - // TODO: markers
 21+ for (marker in markerData) getGMaps3Marker(map, markerData[marker]);
2222 }
2323
 24+function getGMaps3Marker(map, data) {
 25+ var marker = new google.maps.Marker({position: data.position, map: map, title: data.title});
 26+
 27+ var bothTxtAreSet = data.title.length > 0 && data.label.length > 0;
 28+ var popupText = bothTxtAreSet ? '<b>' + data.title + '</b><hr />' + data.label : data.title + data.label;
 29+
 30+ var infowindow = new google.maps.InfoWindow({content: popupText});
 31+
 32+ google.maps.event.addListener(marker, "click", function() {
 33+ infowindow.close();
 34+ infowindow.open(map, marker);
 35+ });
 36+
 37+ return marker;
 38+}
 39+
 40+
2441 function getGMaps3MarkerData(lat, lon, title, label, icon) {
2542 return {position: new google.maps.LatLng(lat, lon), title: title, label: label, icon: icon};
2643 }
\ No newline at end of file
Index: trunk/extensions/Maps/Maps.php
@@ -33,7 +33,7 @@
3434 echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.';
3535 }
3636 else {
37 - define('Maps_VERSION', '0.5.3 a2');
 37+ define('Maps_VERSION', '0.5.3 a3');
3838
3939 $egMapsScriptPath = $wgScriptPath . '/extensions/Maps';
4040 $egMapsIP = $IP . '/extensions/Maps';

Status & tagging log