summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-10-23 07:13:51 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2017-10-23 07:13:51 +0000
commit46e568d0cc6bd134fdfd73ca62b1c6549b37d6a4 (patch)
tree75cae06bc765b645f2e9a3b9c18b477430a55909
parent00b2a18605b34c092c8fb588188353c300e7bba1 (diff)
parent663299df6e3e51a3f457be992aba788be504f3d2 (diff)
downloadxamarin-forms-46e568d0cc6bd134fdfd73ca62b1c6549b37d6a4.tar.gz
xamarin-forms-46e568d0cc6bd134fdfd73ca62b1c6549b37d6a4.tar.bz2
xamarin-forms-46e568d0cc6bd134fdfd73ca62b1c6549b37d6a4.zip
Merge "[Maps] Add handling platform not supported exception" into tizen
-rw-r--r--Xamarin.Forms.Maps.Tizen/MapRenderer.cs27
1 files changed, 22 insertions, 5 deletions
diff --git a/Xamarin.Forms.Maps.Tizen/MapRenderer.cs b/Xamarin.Forms.Maps.Tizen/MapRenderer.cs
index 23252c44..f3039e1c 100644
--- a/Xamarin.Forms.Maps.Tizen/MapRenderer.cs
+++ b/Xamarin.Forms.Maps.Tizen/MapRenderer.cs
@@ -151,8 +151,8 @@ namespace Xamarin.Forms.Maps.Tizen
int x = Control.Geometry.X;
int y = Control.Geometry.Y;
- Geocoordinates ul = Control.ScreenToGeolocation(new ElmSharp.Point { X = x, Y = y});
- Geocoordinates ur = Control.ScreenToGeolocation(new ElmSharp.Point { X = x + width, Y = y});
+ Geocoordinates ul = Control.ScreenToGeolocation(new ElmSharp.Point { X = x, Y = y });
+ Geocoordinates ur = Control.ScreenToGeolocation(new ElmSharp.Point { X = x + width, Y = y });
Geocoordinates ll = Control.ScreenToGeolocation(new ElmSharp.Point { X = x, Y = y + height });
Geocoordinates lr = Control.ScreenToGeolocation(new ElmSharp.Point { X = x + width, Y = y + height });
@@ -253,17 +253,34 @@ namespace Xamarin.Forms.Maps.Tizen
Control.ZoomLevel = 13;
}
}
- void UpdateIsShowingUser()
+
+ bool IsLocatorSupported()
{
- if (Element.IsShowingUser)
+ try
{
if (!LocatorHelper.IsEnabledType(LocationType.Hybrid))
{
Log.Error("Failed to start Locator. Please check if the Location setting on your device is On.");
+ return false;
+ }
+ }
+ catch (NotSupportedException)
+ {
+ Log.Error("Platform Not Supported");
+ return false;
+ }
+ return true;
+ }
+
+ void UpdateIsShowingUser()
+ {
+ if (Element.IsShowingUser)
+ {
+ if (!IsLocatorSupported())
+ {
Element.IsShowingUser = false;
return;
}
-
_locator.Value.LocationChanged += OnLocationChanged;
if (!_isLocatorStarted)
{