Index: trunk/extensions/Maps/GoogleMaps3/GoogleMap3Functions.js |
— | — | @@ -17,9 +17,26 @@ |
18 | 18 | |
19 | 19 | // TODO: types - http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeRegistry |
20 | 20 | |
21 | | - // TODO: markers |
| 21 | + for (marker in markerData) getGMaps3Marker(map, markerData[marker]); |
22 | 22 | } |
23 | 23 | |
| 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 | + |
24 | 41 | function getGMaps3MarkerData(lat, lon, title, label, icon) { |
25 | 42 | return {position: new google.maps.LatLng(lat, lon), title: title, label: label, icon: icon}; |
26 | 43 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | 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>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define('Maps_VERSION', '0.5.3 a2'); |
| 37 | + define('Maps_VERSION', '0.5.3 a3'); |
38 | 38 | |
39 | 39 | $egMapsScriptPath = $wgScriptPath . '/extensions/Maps'; |
40 | 40 | $egMapsIP = $IP . '/extensions/Maps'; |