20 #include "locationmanagerdebug.h" |
20 #include "locationmanagerdebug.h" |
21 |
21 |
22 |
22 |
23 //Maximum length for the response buffer size |
23 //Maximum length for the response buffer size |
24 const int KMaxResponseLength = 2048; |
24 const int KMaxResponseLength = 2048; |
25 //Authentication token for the Maps server |
|
26 //This authentication in specific to our photo-tagging feature |
|
27 _LIT8( KAuthenticationToken, "eb0ae60051e27d3cfcae94e7b47e9eff" ); |
|
28 //Static RefererURL which shows that request has been made from this app |
|
29 _LIT8( KRefererURL, "s60_app_photos" ); |
|
30 |
25 |
31 //Language option for the REST request |
26 //Language option for the REST request |
32 _LIT8( KDefaultLanguage, "eng" ); |
27 _LIT8( KDefaultLanguage, "eng" ); |
33 |
28 |
34 |
29 |
35 //Format of the HTTP request for the reverse geocode |
30 //Format of the HTTP request for the reverse geocode |
36 _LIT8( KRequestFormat, "http://loc.mobile.maps.svc.ovi.com/geocoder/rgc/1.0?token=%S&referer=%S&n=10&lat=%f&long=%f&lg=%S&output=xml" ); |
31 _LIT8( KRequestFormat, "http://loc.mobile.maps.svc.ovi.com/geocoder/rgc/1.0?n=10&lat=%f&long=%f&lg=%S&output=xml" ); |
37 |
32 |
38 |
33 |
39 // http://www.loc.gov/marc/languages/ |
34 // http://www.loc.gov/marc/languages/ |
40 // These are the nokia language id converted to MARC language strings. |
35 // These are the nokia language id converted to MARC language strings. |
41 static const char Marc_Table[ 104 ][ 4 ] = { |
36 static const char Marc_Table[ 104 ][ 4 ] = { |
214 const TConnectionOption aOption ) |
209 const TConnectionOption aOption ) |
215 { |
210 { |
216 LOG("CInternalReverseGeocode::GetAddressByCoordinateL ,begin"); |
211 LOG("CInternalReverseGeocode::GetAddressByCoordinateL ,begin"); |
217 TReal64 latitude = aLocality.Latitude(); |
212 TReal64 latitude = aLocality.Latitude(); |
218 TReal64 longitude = aLocality.Longitude(); |
213 TReal64 longitude = aLocality.Longitude(); |
219 |
|
220 iAuthCode.Copy( KAuthenticationToken ); |
|
221 iRefURL.Copy( KRefererURL ); |
|
222 |
|
223 |
214 |
224 GetLanguageForTheRequest( iLang ); |
215 GetLanguageForTheRequest( iLang ); |
225 |
216 |
226 //Form the request URI |
217 //Form the request URI |
227 iQueryString.Format( KRequestFormat, &iAuthCode, &iRefURL, latitude, longitude, &iLang ); |
218 iQueryString.Format( KRequestFormat, latitude, longitude, &iLang ); |
228 TInt err = KErrNone; |
219 TInt err = KErrNone; |
229 TRAP(err, iClientEngine->IssueHTTPGetL( iQueryString, aOption )); |
220 TRAP(err, iClientEngine->IssueHTTPGetL( iQueryString, aOption )); |
230 |
221 |
231 if ( iTimer && iTimer->IsActive() ) |
222 if ( iTimer && iTimer->IsActive() ) |
232 { |
223 { |