Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFunctions.js |
— | — | @@ -8,18 +8,26 @@ |
9 | 9 | */ |
10 | 10 | |
11 | 11 | /** |
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. |
14 | 13 | */ |
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 | + ); |
17 | 25 | |
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 ) ) ); |
21 | 29 | } |
22 | 30 | |
23 | | - // Click event handler for updating the location of the marker |
| 31 | + // Click event handler for updating the location of the marker. |
24 | 32 | YEvent.Capture(map, EventsList.MouseClick, |
25 | 33 | function(_e, point) { |
26 | 34 | var loc = new YGeoPoint(point.Lat, point.Lon) |
— | — | @@ -51,4 +59,4 @@ |
52 | 60 | document.getElementById(outputElementName).value = convertLatToDMS(resultObj.GeoPoint.Lat) + ', ' + convertLngToDMS(resultObj.GeoPoint.Lon); |
53 | 61 | } |
54 | 62 | ); |
55 | | -} |
| 63 | +} |
\ No newline at end of file |
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js |
— | — | @@ -8,14 +8,14 @@ |
9 | 9 | */ |
10 | 10 | |
11 | 11 | /** |
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. |
13 | 13 | */ |
14 | 14 | function makeFormInputOpenLayer( mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height, langCode ) { |
15 | 15 | var markers = Array(); |
16 | 16 | |
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": "" } ); |
20 | 20 | } |
21 | 21 | |
22 | 22 | // Click event handler for updating the location of the marker |
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFunctions.js |
— | — | @@ -9,16 +9,15 @@ |
10 | 10 | |
11 | 11 | /** |
12 | 12 | * 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 |
14 | 13 | */ |
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() ) { |
17 | 16 | 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": "" } ] ); |
19 | 18 | |
20 | 19 | // 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 ) ) ); |
23 | 22 | } |
24 | 23 | |
25 | 24 | // Click event handler for updating the location of the marker |
— | — | @@ -62,4 +61,4 @@ |
63 | 62 | } |
64 | 63 | ); |
65 | 64 | |
66 | | -} |
| 65 | +} |
\ No newline at end of file |