diff options
-rw-r--r-- | Xamarin.Forms.Maps.Tizen/FormsMaps.cs | 35 | ||||
-rw-r--r--[-rwxr-xr-x] | Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Maps.Tizen/project.json | 4 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Log/ILogger.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Log/Log.cs | 4 |
5 files changed, 18 insertions, 29 deletions
diff --git a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs index 1961fada..2b1ba17a 100644 --- a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs +++ b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs @@ -11,29 +11,24 @@ namespace Xamarin { static MapService _mapService = null; - static string ProviderName { get; set; } - - static string AuthenticationToken { get; set; } - internal static bool IsInitialized { get; private set; } internal static MapService MapService { get { - Debug.Assert(_mapService != null, "FormsMaps is not initialized"); + Debug.Assert(_mapService != null, "FormsMaps is not initialized properly."); return _mapService; } } public static void Init(string provider, string authenticationToken) { - ProviderName = provider; - AuthenticationToken = authenticationToken; - if (IsInitialized) return; + _mapService = new MapService(provider, authenticationToken); + FormsApplication.RequestingUserConsentFunc = new Func<Task>(() => { TaskCompletionSource<bool> userConsentWaiter = new TaskCompletionSource<bool>(); @@ -44,23 +39,17 @@ namespace Xamarin static async void UserConsentAction(TaskCompletionSource<bool> tcs) { - var result = await MapService.RequestUserConsent(ProviderName); + var result = await MapService.RequestUserConsent(); + if (result) + { + GeocoderBackend.Register(); + IsInitialized = true; + } + else { - if (result) - { - _mapService = new MapService(ProviderName, AuthenticationToken); - if (_mapService != null) - { - GeocoderBackend.Register(); - IsInitialized = true; - } - } - else - { - Debug.WriteLine("Failed to get user consent which is required to use map service"); - } - tcs.SetResult(result); + Log.Warn("Failed to get user consent which is required to use map service."); } + tcs.SetResult(result); } } }
\ No newline at end of file diff --git a/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs b/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs index dbf93979..65389f39 100755..100644 --- a/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs +++ b/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs @@ -25,7 +25,7 @@ namespace Xamarin.Forms.Maps.Tizen var request = FormsMaps.MapService.CreateReverseGeocodeRequest(position.Latitude, position.Longitude); var addresses = new List<string>(); foreach (var result in await request.GetResponseAsync()) - addresses.Add(result.Freetext); + addresses.Add(result.FreeText); return addresses; } } diff --git a/Xamarin.Forms.Maps.Tizen/project.json b/Xamarin.Forms.Maps.Tizen/project.json index 41f306f9..99a5ae0f 100644 --- a/Xamarin.Forms.Maps.Tizen/project.json +++ b/Xamarin.Forms.Maps.Tizen/project.json @@ -4,11 +4,11 @@ "NETStandard.Library": "1.6.1", "Tizen.Applications.UI": "1.5.8", "Tizen.Location": "1.0.8", - "Tizen.Maps": "1.0.12" + "Tizen.Maps": "1.0.16" }, "frameworks": { "netstandard1.6": { "imports": "portable-net45+win8+wpa81+wp8" } } -}
\ No newline at end of file +} diff --git a/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs b/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs index 6874641f..4144d091 100644 --- a/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs +++ b/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs @@ -5,7 +5,7 @@ namespace Xamarin.Forms.Platform.Tizen /// <summary> /// Reports log messages with various log levels. /// </summary> - internal interface ILogger + public interface ILogger { /// <summary> /// Reports a debug log message. diff --git a/Xamarin.Forms.Platform.Tizen/Log/Log.cs b/Xamarin.Forms.Platform.Tizen/Log/Log.cs index 3ebeb118..63305e27 100644 --- a/Xamarin.Forms.Platform.Tizen/Log/Log.cs +++ b/Xamarin.Forms.Platform.Tizen/Log/Log.cs @@ -6,7 +6,7 @@ namespace Xamarin.Forms.Platform.Tizen /// <summary> /// Provides logging functionality. /// </summary> - internal static class Log + public static class Log { static String _tag = "Xamarin"; @@ -981,7 +981,7 @@ namespace Xamarin.Forms.Platform.Tizen /// In case of any compilation errors, please make sure you're not using /// explicit <c>null</c> value as one of the parameters. /// </summary> - internal struct Guardian + public struct Guardian { } } |