Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFunctions.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 |
Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsForms.js |
— | — | @@ -0,0 +1,62 @@ |
| 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 |
Property changes on: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsForms.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 64 | + native |
Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFormInput.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | global $wgOut; |
50 | 50 | global $smgScriptPath, $smgYahooFormsOnThisPage, $smgStyleVersion, $egMapsJsExt; |
51 | 51 | |
52 | | - $this->service->addDependency( Html::linkedScript( "$smgScriptPath/Services/YahooMaps/SM_YahooMapsFunctions{$egMapsJsExt}?$smgStyleVersion" ) ); |
| 52 | + $this->service->addDependency( Html::linkedScript( "$smgScriptPath/Services/YahooMaps/SM_YahooMapsForms{$egMapsJsExt}?$smgStyleVersion" ) ); |
53 | 53 | $this->service->addDependencies( $wgOut ); |
54 | 54 | } |
55 | 55 | |
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js |
— | — | @@ -1,98 +0,0 @@ |
2 | | - /** |
3 | | - * Javascript functions for OpenLayers functionality in Semantic Maps |
4 | | - * |
5 | | - * @file SM_OpenLayersFunctions.js |
6 | | - * @ingroup SMOpenLayers |
7 | | - * |
8 | | - * @author Jeroen De Dauw |
9 | | - */ |
10 | | - |
11 | | -/** |
12 | | - * This function holds specific functionality for the Open Layers form input of Semantic Maps. |
13 | | - */ |
14 | | -function makeFormInputOpenLayer( mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height, langCode ) { |
15 | | - var markers = Array(); |
16 | | - |
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 | | - } |
21 | | - |
22 | | - // Click event handler for updating the location of the marker |
23 | | - // TODO / FIXME: This will probably cause problems when used for multiple maps on one page. |
24 | | - OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { |
25 | | - defaultHandlerOptions: { |
26 | | - 'single': true, |
27 | | - 'double': false, |
28 | | - 'pixelTolerance': 0, |
29 | | - 'stopSingle': false, |
30 | | - 'stopDouble': false |
31 | | - }, |
32 | | - |
33 | | - initialize: function(options) { |
34 | | - this.handlerOptions = OpenLayers.Util.extend( |
35 | | - {}, this.defaultHandlerOptions |
36 | | - ); |
37 | | - OpenLayers.Control.prototype.initialize.apply( |
38 | | - this, arguments |
39 | | - ); |
40 | | - this.handler = new OpenLayers.Handler.Click( |
41 | | - this, { |
42 | | - 'click': this.trigger |
43 | | - }, this.handlerOptions |
44 | | - ); |
45 | | - }, |
46 | | - |
47 | | - trigger: function(e) { |
48 | | - var lonlat = map.getLonLatFromViewPortPx(e.xy); |
49 | | - |
50 | | - replaceMarker(mapName, lonlat); |
51 | | - |
52 | | - var proj = new OpenLayers.Projection("EPSG:4326"); |
53 | | - lonlat.transform(map.getProjectionObject(), proj); |
54 | | - |
55 | | - document.getElementById(locationFieldName).value = convertLatToDMS(lonlat.lat)+', '+convertLngToDMS(lonlat.lon); |
56 | | - } |
57 | | - |
58 | | - }); |
59 | | - |
60 | | - var clickHanler = new OpenLayers.Control.Click(); |
61 | | - controls.push(clickHanler); |
62 | | - |
63 | | - var map = initOpenLayer( mapName, lon, lat, zoom, layers, controls, markers, height, langCode ); |
64 | | - |
65 | | - // Make the map variable available for other functions |
66 | | - if (!window.OLMaps) window.OLMaps = new Object; |
67 | | - eval("window.OLMaps." + mapName + " = map;"); |
68 | | -} |
69 | | - |
70 | | -/** |
71 | | - * Remove all markers from an OL map (that's in window.OLMaps), and place a new one. |
72 | | - * |
73 | | - * @param mapName Name of the map as in OLMaps[mapName]. |
74 | | - * @param newLocation The location for the new marker. |
75 | | - * @return |
76 | | - */ |
77 | | -function replaceMarker(mapName, newLocation) { |
78 | | - var map = OLMaps[mapName]; |
79 | | - var markerLayer = map.getLayer('markerLayer'); |
80 | | - |
81 | | - removeMarkers(markerLayer); |
82 | | - markerLayer.addMarker(getOLMarker(markerLayer, getOLMarkerData(newLocation.lon, newLocation.lat, '', '', ''), map.getProjectionObject())); |
83 | | - |
84 | | - map.panTo(newLocation); |
85 | | -} |
86 | | - |
87 | | -/** |
88 | | - * Removes all markers from a marker layer. |
89 | | - * |
90 | | - * @param markerLayer The layer to remove all markers from. |
91 | | - * @return |
92 | | - */ |
93 | | -function removeMarkers(markerLayer) { |
94 | | - var markerCollection = markerLayer.markers; |
95 | | - |
96 | | - for (var i = 0; i < markerCollection.length; i++) { |
97 | | - markerLayer.removeMarker(markerCollection[i]); |
98 | | - } |
99 | | -} |
\ No newline at end of file |
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersForms.js |
— | — | @@ -0,0 +1,98 @@ |
| 2 | + /** |
| 3 | + * Javascript functions for OpenLayers functionality in Semantic Maps |
| 4 | + * |
| 5 | + * @file SM_OpenLayersFunctions.js |
| 6 | + * @ingroup SMOpenLayers |
| 7 | + * |
| 8 | + * @author Jeroen De Dauw |
| 9 | + */ |
| 10 | + |
| 11 | +/** |
| 12 | + * This function holds specific functionality for the Open Layers form input of Semantic Maps. |
| 13 | + */ |
| 14 | +function makeFormInputOpenLayer( mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height, langCode ) { |
| 15 | + var markers = Array(); |
| 16 | + |
| 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 | + } |
| 21 | + |
| 22 | + // Click event handler for updating the location of the marker |
| 23 | + // TODO / FIXME: This will probably cause problems when used for multiple maps on one page. |
| 24 | + OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { |
| 25 | + defaultHandlerOptions: { |
| 26 | + 'single': true, |
| 27 | + 'double': false, |
| 28 | + 'pixelTolerance': 0, |
| 29 | + 'stopSingle': false, |
| 30 | + 'stopDouble': false |
| 31 | + }, |
| 32 | + |
| 33 | + initialize: function(options) { |
| 34 | + this.handlerOptions = OpenLayers.Util.extend( |
| 35 | + {}, this.defaultHandlerOptions |
| 36 | + ); |
| 37 | + OpenLayers.Control.prototype.initialize.apply( |
| 38 | + this, arguments |
| 39 | + ); |
| 40 | + this.handler = new OpenLayers.Handler.Click( |
| 41 | + this, { |
| 42 | + 'click': this.trigger |
| 43 | + }, this.handlerOptions |
| 44 | + ); |
| 45 | + }, |
| 46 | + |
| 47 | + trigger: function(e) { |
| 48 | + var lonlat = map.getLonLatFromViewPortPx(e.xy); |
| 49 | + |
| 50 | + replaceMarker(mapName, lonlat); |
| 51 | + |
| 52 | + var proj = new OpenLayers.Projection("EPSG:4326"); |
| 53 | + lonlat.transform(map.getProjectionObject(), proj); |
| 54 | + |
| 55 | + document.getElementById(locationFieldName).value = convertLatToDMS(lonlat.lat)+', '+convertLngToDMS(lonlat.lon); |
| 56 | + } |
| 57 | + |
| 58 | + }); |
| 59 | + |
| 60 | + var clickHanler = new OpenLayers.Control.Click(); |
| 61 | + controls.push(clickHanler); |
| 62 | + |
| 63 | + var map = initOpenLayer( mapName, lon, lat, zoom, layers, controls, markers, height, langCode ); |
| 64 | + |
| 65 | + // Make the map variable available for other functions |
| 66 | + if (!window.OLMaps) window.OLMaps = new Object; |
| 67 | + eval("window.OLMaps." + mapName + " = map;"); |
| 68 | +} |
| 69 | + |
| 70 | +/** |
| 71 | + * Remove all markers from an OL map (that's in window.OLMaps), and place a new one. |
| 72 | + * |
| 73 | + * @param mapName Name of the map as in OLMaps[mapName]. |
| 74 | + * @param newLocation The location for the new marker. |
| 75 | + * @return |
| 76 | + */ |
| 77 | +function replaceMarker(mapName, newLocation) { |
| 78 | + var map = OLMaps[mapName]; |
| 79 | + var markerLayer = map.getLayer('markerLayer'); |
| 80 | + |
| 81 | + removeMarkers(markerLayer); |
| 82 | + markerLayer.addMarker(getOLMarker(markerLayer, getOLMarkerData(newLocation.lon, newLocation.lat, '', '', ''), map.getProjectionObject())); |
| 83 | + |
| 84 | + map.panTo(newLocation); |
| 85 | +} |
| 86 | + |
| 87 | +/** |
| 88 | + * Removes all markers from a marker layer. |
| 89 | + * |
| 90 | + * @param markerLayer The layer to remove all markers from. |
| 91 | + * @return |
| 92 | + */ |
| 93 | +function removeMarkers(markerLayer) { |
| 94 | + var markerCollection = markerLayer.markers; |
| 95 | + |
| 96 | + for (var i = 0; i < markerCollection.length; i++) { |
| 97 | + markerLayer.removeMarker(markerCollection[i]); |
| 98 | + } |
| 99 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersForms.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 100 | + native |
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | global $wgOut; |
40 | 40 | global $smgScriptPath, $smgOLFormsOnThisPage, $smgStyleVersion, $egMapsJsExt; |
41 | 41 | |
42 | | - $this->service->addDependency( Html::linkedScript( "$smgScriptPath/Services/OpenLayers/SM_OpenLayersFunctions{$egMapsJsExt}?$smgStyleVersion" ) ); |
| 42 | + $this->service->addDependency( Html::linkedScript( "$smgScriptPath/Services/OpenLayers/SM_OpenLayersForms{$egMapsJsExt}?$smgStyleVersion" ) ); |
43 | 43 | $this->service->addDependencies( $wgOut ); |
44 | 44 | } |
45 | 45 | |
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFunctions.js |
— | — | @@ -1,64 +0,0 @@ |
2 | | - /** |
3 | | - * Javascript functions for Google Maps functionality in Semantic Maps |
4 | | - * |
5 | | - * @file SM_GoogleMapFunctions.js |
6 | | - * @ingroup SMGoogleMaps |
7 | | - * |
8 | | - * @author Jeroen De Dauw |
9 | | - */ |
10 | | - |
11 | | -/** |
12 | | - * This function holds specific functionality for the Google Maps form input of Semantic Maps |
13 | | - */ |
14 | | -function makeGoogleMapFormInput( mapName, locationFieldName, mapOptions, marker_lat, marker_lon ) { |
15 | | - if ( GBrowserIsCompatible() ) { |
16 | | - mapOptions.centre = new GLatLng(mapOptions.lat, mapOptions.lon); |
17 | | - var map = createGoogleMap( mapName, mapOptions, [ { "lat": marker_lat, "lon": marker_lon, "title": "", "label": "", "icon": "" } ] ); |
18 | | - |
19 | | - // Show a starting marker only if marker coordinates are provided |
20 | | - if ( marker_lat != null && marker_lon != null ) { |
21 | | - map.addOverlay( new GMarker( new GLatLng( marker_lat, marker_lon ) ) ); |
22 | | - } |
23 | | - |
24 | | - // Click event handler for updating the location of the marker |
25 | | - GEvent.addListener(map, "click", |
26 | | - function(overlay, point) { |
27 | | - if (overlay) { |
28 | | - map.removeOverlay(overlay); |
29 | | - } else { |
30 | | - map.clearOverlays(); |
31 | | - document.getElementById(locationFieldName).value = convertLatToDMS(point.y)+', '+convertLngToDMS(point.x); |
32 | | - map.addOverlay(new GMarker(point)); |
33 | | - map.panTo(point); |
34 | | - } |
35 | | - } |
36 | | - ); |
37 | | - |
38 | | - // Make the map variable available for other functions |
39 | | - if (!window.GMaps) window.GMaps = new Object; |
40 | | - eval("window.GMaps." + mapName + " = map;"); |
41 | | - } |
42 | | -} |
43 | | - |
44 | | -/** |
45 | | - * This function holds specific functionality for the Google Maps form input of Semantic Maps |
46 | | - */ |
47 | | -function showGAddress(address, mapName, outputElementName, notFoundFormat) { |
48 | | - var map = GMaps[mapName]; |
49 | | - var geocoder = new GClientGeocoder(); |
50 | | - |
51 | | - geocoder.getLatLng(address, |
52 | | - function(point) { |
53 | | - if (!point) { |
54 | | - window.alert(address + ' ' + notFoundFormat); |
55 | | - } else { |
56 | | - map.clearOverlays(); |
57 | | - map.setCenter(point, 14); |
58 | | - var marker = new GMarker(point); |
59 | | - map.addOverlay(marker); |
60 | | - document.getElementById(outputElementName).value = convertLatToDMS(point.y) + ', ' + convertLngToDMS(point.x); |
61 | | - } |
62 | | - } |
63 | | - ); |
64 | | - |
65 | | -} |
\ No newline at end of file |
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | global $wgOut; |
54 | 54 | global $smgScriptPath, $smgGoogleFormsOnThisPage, $smgStyleVersion, $egMapsJsExt; |
55 | 55 | |
56 | | - $this->service->addDependency( Html::linkedScript( "$smgScriptPath/Services/GoogleMaps/SM_GoogleMapsFunctions{$egMapsJsExt}?$smgStyleVersion" ) ); |
| 56 | + $this->service->addDependency( Html::linkedScript( "$smgScriptPath/Services/GoogleMaps/SM_GoogleMapsForms{$egMapsJsExt}?$smgStyleVersion" ) ); |
57 | 57 | $this->service->addDependencies( $wgOut ); |
58 | 58 | } |
59 | 59 | |
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsForms.js |
— | — | @@ -0,0 +1,64 @@ |
| 2 | + /** |
| 3 | + * Javascript functions for Google Maps functionality in Semantic Maps |
| 4 | + * |
| 5 | + * @file SM_GoogleMapFunctions.js |
| 6 | + * @ingroup SMGoogleMaps |
| 7 | + * |
| 8 | + * @author Jeroen De Dauw |
| 9 | + */ |
| 10 | + |
| 11 | +/** |
| 12 | + * This function holds specific functionality for the Google Maps form input of Semantic Maps |
| 13 | + */ |
| 14 | +function makeGoogleMapFormInput( mapName, locationFieldName, mapOptions, marker_lat, marker_lon ) { |
| 15 | + if ( GBrowserIsCompatible() ) { |
| 16 | + mapOptions.centre = new GLatLng(mapOptions.lat, mapOptions.lon); |
| 17 | + var map = createGoogleMap( mapName, mapOptions, [ { "lat": marker_lat, "lon": marker_lon, "title": "", "label": "", "icon": "" } ] ); |
| 18 | + |
| 19 | + // Show a starting marker only if marker coordinates are provided |
| 20 | + if ( marker_lat != null && marker_lon != null ) { |
| 21 | + map.addOverlay( new GMarker( new GLatLng( marker_lat, marker_lon ) ) ); |
| 22 | + } |
| 23 | + |
| 24 | + // Click event handler for updating the location of the marker |
| 25 | + GEvent.addListener(map, "click", |
| 26 | + function(overlay, point) { |
| 27 | + if (overlay) { |
| 28 | + map.removeOverlay(overlay); |
| 29 | + } else { |
| 30 | + map.clearOverlays(); |
| 31 | + document.getElementById(locationFieldName).value = convertLatToDMS(point.y)+', '+convertLngToDMS(point.x); |
| 32 | + map.addOverlay(new GMarker(point)); |
| 33 | + map.panTo(point); |
| 34 | + } |
| 35 | + } |
| 36 | + ); |
| 37 | + |
| 38 | + // Make the map variable available for other functions |
| 39 | + if (!window.GMaps) window.GMaps = new Object; |
| 40 | + eval("window.GMaps." + mapName + " = map;"); |
| 41 | + } |
| 42 | +} |
| 43 | + |
| 44 | +/** |
| 45 | + * This function holds specific functionality for the Google Maps form input of Semantic Maps |
| 46 | + */ |
| 47 | +function showGAddress(address, mapName, outputElementName, notFoundFormat) { |
| 48 | + var map = GMaps[mapName]; |
| 49 | + var geocoder = new GClientGeocoder(); |
| 50 | + |
| 51 | + geocoder.getLatLng(address, |
| 52 | + function(point) { |
| 53 | + if (!point) { |
| 54 | + window.alert(address + ' ' + notFoundFormat); |
| 55 | + } else { |
| 56 | + map.clearOverlays(); |
| 57 | + map.setCenter(point, 14); |
| 58 | + var marker = new GMarker(point); |
| 59 | + map.addOverlay(marker); |
| 60 | + document.getElementById(outputElementName).value = convertLatToDMS(point.y) + ', ' + convertLngToDMS(point.x); |
| 61 | + } |
| 62 | + } |
| 63 | + ); |
| 64 | + |
| 65 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsForms.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 66 | + native |