r69453 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69452‎ | r69453 | r69454 >
Date:23:59, 16 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.6.5 - follow up to JS changes in Maps
Modified paths:
  • /trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFunctions.js (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFunctions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFunctions.js
@@ -8,18 +8,26 @@
99 */
1010
1111 /**
12 - * This function holds specific functionality for the Yahoo! Maps form input of Semantic Maps
13 - * TODO: Refactor as much code as possible to non specific functions
 12+ * This function holds specific functionality for the Yahoo! Maps form input of Semantic Maps.
1413 */
15 -function makeFormInputYahooMap(mapName, locationFieldName, lat, lon, zoom, type, types, controls, scrollWheelZoom, marker_lat, marker_lon) {
16 - var map = createYahooMap(document.getElementById(mapName), new YGeoPoint(lat, lon), zoom, type, types, controls, scrollWheelZoom, [getYMarkerData(marker_lat, marker_lon, '', '', '')]);
 14+function makeFormInputYahooMap( mapName, locationFieldName, lat, lon, zoom, type, types, controls, scrollWheelZoom, marker_lat, marker_lon ) {
 15+ var map = createYahooMap(
 16+ document.getElementById( mapName ),
 17+ new YGeoPoint( lat, lon ),
 18+ zoom,
 19+ type,
 20+ types,
 21+ controls,
 22+ scrollWheelZoom,
 23+ [ { "lat": marker_lat, "lon": marker_lon, "title": "", "label": "", "icon": "" } ]
 24+ );
1725
18 - // Show a starting marker only if marker coordinates are provided
19 - if (marker_lat != null && marker_lon != null) {
20 - map.addOverlay(createYMarker(new YGeoPoint(marker_lat, marker_lon)));
 26+ // Show a starting marker only if marker coordinates are provided.
 27+ if ( marker_lat != null && marker_lon != null ) {
 28+ map.addOverlay( createYMarker( new YGeoPoint( marker_lat, marker_lon ) ) );
2129 }
2230
23 - // Click event handler for updating the location of the marker
 31+ // Click event handler for updating the location of the marker.
2432 YEvent.Capture(map, EventsList.MouseClick,
2533 function(_e, point) {
2634 var loc = new YGeoPoint(point.Lat, point.Lon)
@@ -51,4 +59,4 @@
5260 document.getElementById(outputElementName).value = convertLatToDMS(resultObj.GeoPoint.Lat) + ', ' + convertLngToDMS(resultObj.GeoPoint.Lon);
5361 }
5462 );
55 -}
 63+}
\ No newline at end of file
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js
@@ -8,14 +8,14 @@
99 */
1010
1111 /**
12 - * This function holds specific functionality for the Open Layers form input of Semantic Maps
 12+ * This function holds specific functionality for the Open Layers form input of Semantic Maps.
1313 */
1414 function makeFormInputOpenLayer( mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height, langCode ) {
1515 var markers = Array();
1616
17 - // Show a starting marker only if marker coordinates are provided
18 - if (marker_lat != null && marker_lon != null) {
19 - markers.push(getOLMarkerData(marker_lon, marker_lat, '', '', ''));
 17+ // Show a starting marker only if marker coordinates are provided.
 18+ if ( marker_lat != null && marker_lon != null ) {
 19+ markers.push( { "lat": marker_lat, "lon": marker_lon, "title": "", "label": "", "icon": "" } );
2020 }
2121
2222 // Click event handler for updating the location of the marker
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFunctions.js
@@ -9,16 +9,15 @@
1010
1111 /**
1212 * This function holds specific functionality for the Google Maps form input of Semantic Maps
13 - * TODO: Refactor as much code as possible to non specific functions
1413 */
15 -function makeGoogleMapFormInput(mapName, locationFieldName, mapOptions, marker_lat, marker_lon) {
16 - if (GBrowserIsCompatible()) {
 14+function makeGoogleMapFormInput( mapName, locationFieldName, mapOptions, marker_lat, marker_lon ) {
 15+ if ( GBrowserIsCompatible() ) {
1716 mapOptions.centre = new GLatLng(mapOptions.lat, mapOptions.lon);
18 - var map = createGoogleMap(mapName, mapOptions, [getGMarkerData(marker_lat, marker_lon, '', '', '')]);
 17+ var map = createGoogleMap( mapName, mapOptions, [ { "lat": marker_lat, "lon": marker_lon, "title": "", "label": "", "icon": "" } ] );
1918
2019 // Show a starting marker only if marker coordinates are provided
21 - if (marker_lat != null && marker_lon != null) {
22 - map.addOverlay(new GMarker(new GLatLng(marker_lat, marker_lon)));
 20+ if ( marker_lat != null && marker_lon != null ) {
 21+ map.addOverlay( new GMarker( new GLatLng( marker_lat, marker_lon ) ) );
2322 }
2423
2524 // Click event handler for updating the location of the marker
@@ -62,4 +61,4 @@
6362 }
6463 );
6564
66 -}
 65+}
\ No newline at end of file

Status & tagging log