summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
diff options
context:
space:
mode:
authorchungryeol lim <cdark.lim@samsung.com>2016-12-20 20:16:18 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-07-10 11:11:16 +0900
commit28ad177fd48d37e4110b636cc17330d8dd08eb5f (patch)
tree35fd1e6133c2d8ebca0e1945b4fe9c03dee5c8af /Xamarin.Forms.Maps.Tizen/FormsMaps.cs
parent002608d955237854b22581d2f60085d5ab65417a (diff)
downloadxamarin-forms-28ad177fd48d37e4110b636cc17330d8dd08eb5f.tar.gz
xamarin-forms-28ad177fd48d37e4110b636cc17330d8dd08eb5f.tar.bz2
xamarin-forms-28ad177fd48d37e4110b636cc17330d8dd08eb5f.zip
Add MapRenderer to enable Xamarin.Forms.Maps on Tizen
- Implementation of MapRenderer under Xamarin.Forms.Maps.Tizen - Implementation of FormsMaps to initialize Tizen Map - Implementation of GeocoderBackend TASK=TCAPI2044 Change-Id: I4b6f15b5190767ca0c92bb27c383af5f66ae5328
Diffstat (limited to 'Xamarin.Forms.Maps.Tizen/FormsMaps.cs')
-rwxr-xr-xXamarin.Forms.Maps.Tizen/FormsMaps.cs54
1 files changed, 42 insertions, 12 deletions
diff --git a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
index b41b50d8..0fd7029c 100755
--- a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
+++ b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
@@ -1,19 +1,49 @@
-´╗┐using Xamarin.Forms.Maps.Tizen;
+´╗┐using System.Diagnostics;
+using Tizen.Maps;
+using Xamarin.Forms.Maps.Tizen;
namespace Xamarin
{
- public static class FormsMaps
- {
- public static bool IsInitialized { get; private set; }
+ public static class FormsMaps
+ {
+ static MapService _mapService = null;
- public static void Init()
- {
- if (IsInitialized)
- return;
+ static string ProviderName { get; set; }
- IsInitialized = true;
+ static string AuthenticationToken { get; set; }
- GeocoderBackend.Register();
- }
- }
+ internal static bool IsInitialized { get; private set; }
+
+ internal static MapService MapService
+ {
+ get
+ {
+ Debug.Assert(_mapService != null, "FormsMaps is not initialized");
+ return _mapService;
+ }
+ }
+
+ public static void Init(string provider, string authenticationToken)
+ {
+ ProviderName = provider;
+ AuthenticationToken = authenticationToken;
+ Init();
+ }
+
+ internal static async void Init()
+ {
+ if (IsInitialized)
+ return;
+ var requestResult = await MapService.RequestUserConsent(ProviderName);
+ if (requestResult)
+ {
+ _mapService = new MapService(ProviderName, AuthenticationToken);
+ if (_mapService != null)
+ {
+ GeocoderBackend.Register();
+ IsInitialized = true;
+ }
+ }
+ }
+ }
} \ No newline at end of file