Index: trunk/extensions/SemanticMaps/includes/services/YahooMaps/SM_YahooMapsForms.js |
— | — | @@ -1,62 +0,0 @@ |
2 | | - /** |
3 | | - * Javascript functions for Yahoo! Maps functionality in Semantic Maps |
4 | | - * |
5 | | - * @file SM_YahooMapsFunctions.js |
6 | | - * @ingroup SMYahooMaps |
7 | | - * |
8 | | - * @author Jeroen De Dauw |
9 | | - */ |
10 | | - |
11 | | -/** |
12 | | - * This function holds specific functionality for the Yahoo! Maps form input of Semantic Maps. |
13 | | - */ |
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 | | - ); |
25 | | - |
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 ) ) ); |
29 | | - } |
30 | | - |
31 | | - // Click event handler for updating the location of the marker. |
32 | | - YEvent.Capture(map, EventsList.MouseClick, |
33 | | - function(_e, point) { |
34 | | - var loc = new YGeoPoint(point.Lat, point.Lon) |
35 | | - map.removeMarkersAll(); |
36 | | - document.getElementById(locationFieldName).value = convertLatToDMS(point.Lat)+', '+convertLngToDMS(point.Lon); |
37 | | - map.addMarker(loc); |
38 | | - map.panToLatLon(loc); |
39 | | - } |
40 | | - ); |
41 | | - |
42 | | - // Make the map variable available for other functions |
43 | | - if (!window.YMaps) window.YMaps = new Object; |
44 | | - eval("window.YMaps." + mapName + " = map;"); |
45 | | -} |
46 | | - |
47 | | -/** |
48 | | - * This function holds specific functionality for the Yahoo! Maps form input of Semantic Maps |
49 | | - * TODO: Refactor as much code as possible to non specific functions |
50 | | - */ |
51 | | -function showYAddress(address, mapName, outputElementName, notFoundFormat) { |
52 | | - var map = YMaps[mapName]; |
53 | | - |
54 | | - map.removeMarkersAll(); |
55 | | - map.drawZoomAndCenter(address); |
56 | | - |
57 | | - YEvent.Capture(map, EventsList.onEndGeoCode, |
58 | | - function(resultObj) { |
59 | | - map.addOverlay(new YMarker(resultObj.GeoPoint)); |
60 | | - document.getElementById(outputElementName).value = convertLatToDMS(resultObj.GeoPoint.Lat) + ', ' + convertLngToDMS(resultObj.GeoPoint.Lon); |
61 | | - } |
62 | | - ); |
63 | | -} |
\ No newline at end of file |