summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonghyun Cho <jh5.cho@samsung.com>2017-10-23 06:45:19 (GMT)
committerJoonghyun Cho <jh5.cho@samsung.com>2017-10-23 06:50:42 (GMT)
commit663299df6e3e51a3f457be992aba788be504f3d2 (patch)
treeaae0d4ed8204aaa3b3ca65158cbde45eb16225d2
parent3ea0dc31dfd8d8a1850952d0cfb4ea93b3defd40 (diff)
downloadxamarin-forms-663299df6e3e51a3f457be992aba788be504f3d2.zip
xamarin-forms-663299df6e3e51a3f457be992aba788be504f3d2.tar.gz
xamarin-forms-663299df6e3e51a3f457be992aba788be504f3d2.tar.bz2
[Maps] Add handling platform not supported exceptionrefs/changes/27/157027/1
- Add exception handling code for TV profile which does not support Location feature Change-Id: Ibf86e5e3496f56866976f8fb93b4e93c665ed8c3 Signed-off-by: Joonghyun Cho <jh5.cho@samsung.com>
-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 23252c4..f3039e1 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)
{