summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
diff options
context:
space:
mode:
authorchungryeol lim <cdark.lim@samsung.com>2016-12-20 11:16:18 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 04:18:59 (GMT)
commit11fa683302f23c3a00a51d5e554fc40c51d31348 (patch)
treec8285321b25a9a59e4318435a9f2011db9a732bc /Xamarin.Forms.Maps.Tizen/FormsMaps.cs
parent78f2c9fc9b607770f64177dfba632b80f2ed46db (diff)
downloadxamarin-forms-11fa683302f23c3a00a51d5e554fc40c51d31348.zip
xamarin-forms-11fa683302f23c3a00a51d5e554fc40c51d31348.tar.gz
xamarin-forms-11fa683302f23c3a00a51d5e554fc40c51d31348.tar.bz2
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 b41b50d..0fd7029 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