diff options
author | chanywa <cbible.kim@samsung.com> | 2017-04-17 19:13:28 +0900 |
---|---|---|
committer | chanywa <cbible.kim@samsung.com> | 2017-04-17 19:13:28 +0900 |
commit | 2e42b4a975adae50ee7a46b168989b3b009f20bc (patch) | |
tree | f285098b93f5aabc7d5197f388b84370849579a0 | |
parent | 6bb5e954c86747304f6f2348df55a802908833e7 (diff) | |
download | maps-2e42b4a975adae50ee7a46b168989b3b009f20bc.tar.gz maps-2e42b4a975adae50ee7a46b168989b3b009f20bc.tar.bz2 maps-2e42b4a975adae50ee7a46b168989b3b009f20bc.zip |
Change-Id: I5c993ed86af1261f9ce0e385f344166aabcf235d
-rwxr-xr-x | Tizen.Maps/Interop/Interop.SafeMapsHandle.cs | 4 | ||||
-rwxr-xr-x | Tizen.Maps/Tizen.Maps.csproj | 55 | ||||
-rwxr-xr-x | Tizen.Maps/Tizen.Maps.project.json | 4 | ||||
-rwxr-xr-x | Tizen.Maps/Tizen.Maps/Log.cs | 56 | ||||
-rwxr-xr-x | Tizen.Maps/Tizen.Maps/MapView.cs | 38 | ||||
-rwxr-xr-x | Tizen.Maps/Tizen.Maps/SearchPreference.cs | 10 | ||||
-rw-r--r-- | packaging/csapi-maps.spec | 2 |
7 files changed, 136 insertions, 33 deletions
diff --git a/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs b/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs index 0ecc7e5..6f915cc 100755 --- a/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs +++ b/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs @@ -36,7 +36,7 @@ internal static partial class Interop return value; } - err.WarnIfFailed($"Native getter for {propertyName} failed"); + //err.WarnIfFailed($"Native getter for {propertyName} failed"); return default(T); } @@ -59,7 +59,7 @@ internal static partial class Interop return value; } - err.WarnIfFailed($"Native getter for {propertyName} failed"); + //err.WarnIfFailed($"Native getter for {propertyName} failed"); return string.Empty; } diff --git a/Tizen.Maps/Tizen.Maps.csproj b/Tizen.Maps/Tizen.Maps.csproj index a3fcd12..9a72947 100755 --- a/Tizen.Maps/Tizen.Maps.csproj +++ b/Tizen.Maps/Tizen.Maps.csproj @@ -52,35 +52,18 @@ <None Include="Tizen.Maps.snk" /> </ItemGroup> <ItemGroup> - <Compile Include="Interop\Interop.AddressList.cs" /> - <Compile Include="Interop\Interop.CoordinatesList.cs" /> - <Compile Include="Interop\Interop.PlaceList.cs" /> - <Compile Include="Interop\Interop.SafeMapsHandle.cs" /> - <Compile Include="Interop\Interop.View.Marker.cs" /> - <Compile Include="Interop\Interop.View.Overlay.cs" /> - <Compile Include="Interop\Interop.View.Polygon.cs" /> - <Compile Include="Interop\Interop.View.Polyline.cs" /> - <Compile Include="Tizen.Maps\IGeocodePreference.cs" /> - <Compile Include="Tizen.Maps\IPlaceSearchPreference.cs" /> - <Compile Include="Tizen.Maps\IRouteSearchPreference.cs" /> - <Compile Include="Tizen.Maps\MapView.cs" /> - <Compile Include="Tizen.Maps\GestureType.cs" /> - <Compile Include="Tizen.Maps\Overlay.cs" /> - <Compile Include="Tizen.Maps\Polygon.cs" /> - <Compile Include="Tizen.Maps\Polyline.cs" /> - <Compile Include="Tizen.Maps\MapGestureEventArgs.cs" /> - <Compile Include="Tizen.Maps\MapObject.cs" /> - <Compile Include="Tizen.Maps\MapTypes.cs" /> - <Compile Include="Tizen.Maps\Marker.cs" /> <Compile Include="Interop\Interop.Address.cs" /> + <Compile Include="Interop\Interop.AddressList.cs" /> <Compile Include="Interop\Interop.Area.cs" /> - <Compile Include="Interop\Interop.Libraries.cs" /> <Compile Include="Interop\Interop.Coordinates.cs" /> + <Compile Include="Interop\Interop.CoordinatesList.cs" /> <Compile Include="Interop\Interop.ErrorCode.cs" /> + <Compile Include="Interop\Interop.Libraries.cs" /> + <Compile Include="Interop\Interop.PlaceList.cs" /> + <Compile Include="Interop\Interop.Place.cs" /> <Compile Include="Interop\Interop.Place.Attribute.cs" /> <Compile Include="Interop\Interop.Place.Category.cs" /> <Compile Include="Interop\Interop.Place.Contact.cs" /> - <Compile Include="Interop\Interop.Place.cs" /> <Compile Include="Interop\Interop.Place.Editorial.cs" /> <Compile Include="Interop\Interop.Place.Filter.cs" /> <Compile Include="Interop\Interop.Place.Image.cs" /> @@ -92,24 +75,40 @@ <Compile Include="Interop\Interop.Route.cs" /> <Compile Include="Interop\Interop.Route.Maneuver.cs" /> <Compile Include="Interop\Interop.Route.Segment.cs" /> + <Compile Include="Interop\Interop.SafeMapsHandle.cs" /> <Compile Include="Interop\Interop.Service.cs" /> <Compile Include="Interop\Interop.View.cs" /> <Compile Include="Interop\Interop.View.Event.Data.cs" /> + <Compile Include="Interop\Interop.View.Marker.cs" /> <Compile Include="Interop\Interop.View.Object.cs" /> + <Compile Include="Interop\Interop.View.Overlay.cs" /> + <Compile Include="Interop\Interop.View.Polygon.cs" /> + <Compile Include="Interop\Interop.View.Polyline.cs" /> <Compile Include="Interop\Interop.View.Snapshot.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Tizen.Maps\PlaceAddress.cs" /> - <Compile Include="Tizen.Maps\PlaceAddressList.cs" /> <Compile Include="Tizen.Maps\Area.cs" /> - <Compile Include="Tizen.Maps\Geocoordinates.cs" /> - <Compile Include="Tizen.Maps\GeocoordinatesList.cs" /> <Compile Include="Tizen.Maps\Direction.cs" /> <Compile Include="Tizen.Maps\DistanceUnit.cs" /> + <Compile Include="Tizen.Maps\Geocoordinates.cs" /> + <Compile Include="Tizen.Maps\GeocoordinatesList.cs" /> <Compile Include="Tizen.Maps\GeocodeRequest.cs" /> + <Compile Include="Tizen.Maps\GestureType.cs" /> + <Compile Include="Tizen.Maps\IGeocodePreference.cs" /> + <Compile Include="Tizen.Maps\IPlaceSearchPreference.cs" /> + <Compile Include="Tizen.Maps\IRouteSearchPreference.cs" /> + <Compile Include="Tizen.Maps\Log.cs" /> + <Compile Include="Tizen.Maps\MapGestureEventArgs.cs" /> + <Compile Include="Tizen.Maps\MapObject.cs" /> <Compile Include="Tizen.Maps\MapService.cs" /> <Compile Include="Tizen.Maps\MapServiceRequest.cs" /> + <Compile Include="Tizen.Maps\MapTypes.cs" /> + <Compile Include="Tizen.Maps\MapView.cs" /> + <Compile Include="Tizen.Maps\Marker.cs" /> <Compile Include="Tizen.Maps\MultiReverseGeocodeRequest.cs" /> + <Compile Include="Tizen.Maps\Overlay.cs" /> <Compile Include="Tizen.Maps\Place.cs" /> + <Compile Include="Tizen.Maps\PlaceAddress.cs" /> + <Compile Include="Tizen.Maps\PlaceAddressList.cs" /> <Compile Include="Tizen.Maps\PlaceAttribute.cs" /> <Compile Include="Tizen.Maps\PlaceCategory.cs" /> <Compile Include="Tizen.Maps\PlaceContact.cs" /> @@ -120,8 +119,10 @@ <Compile Include="Tizen.Maps\PlaceList.cs" /> <Compile Include="Tizen.Maps\PlaceMedia.cs" /> <Compile Include="Tizen.Maps\PlaceRating.cs" /> - <Compile Include="Tizen.Maps\PlaceSearchRequest.cs" /> <Compile Include="Tizen.Maps\PlaceReview.cs" /> + <Compile Include="Tizen.Maps\PlaceSearchRequest.cs" /> + <Compile Include="Tizen.Maps\Polygon.cs" /> + <Compile Include="Tizen.Maps\Polyline.cs" /> <Compile Include="Tizen.Maps\ReverseGeocodeRequest.cs" /> <Compile Include="Tizen.Maps\Route.cs" /> <Compile Include="Tizen.Maps\RouteFeature.cs" /> diff --git a/Tizen.Maps/Tizen.Maps.project.json b/Tizen.Maps/Tizen.Maps.project.json index 8977ef3..5e51cb7 100755 --- a/Tizen.Maps/Tizen.Maps.project.json +++ b/Tizen.Maps/Tizen.Maps.project.json @@ -2,9 +2,9 @@ "dependencies": { "ElmSharp": "1.1.0-*", "NETStandard.Library": "1.6.1", - "Tizen": "1.0.2" + "Tizen": "1.0.3" }, "frameworks": { "netstandard1.3": {} } -}
\ No newline at end of file +} diff --git a/Tizen.Maps/Tizen.Maps/Log.cs b/Tizen.Maps/Tizen.Maps/Log.cs new file mode 100755 index 0000000..8340d2e --- /dev/null +++ b/Tizen.Maps/Tizen.Maps/Log.cs @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Runtime.CompilerServices; + +namespace Tizen.Maps +{ + internal static class Log + { + private static String tag = "Tizen.Maps"; + + public static void Debug(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Debug(tag, message, file, func, line); + } + + public static void Error(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Error(tag, message, file, func, line); + } + + public static void Fatal(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Fatal(tag, message, file, func, line); + } + + public static void Info(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Info(tag, message, file, func, line); + } + + public static void Verbose(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Verbose(tag, message, file, func, line); + } + + public static void Warn(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Warn(tag, message, file, func, line); + } + } +} diff --git a/Tizen.Maps/Tizen.Maps/MapView.cs b/Tizen.Maps/Tizen.Maps/MapView.cs index d1d4ffc..178fc06 100755 --- a/Tizen.Maps/Tizen.Maps/MapView.cs +++ b/Tizen.Maps/Tizen.Maps/MapView.cs @@ -53,8 +53,9 @@ namespace Tizen.Maps public MapView(EvasObject parent, MapService service) : base(parent) { handle = new Interop.ViewHandle(service.handle, this); - _service = service; + Log.Info(string.Format("MapView is created")); + _service = service; this.Resize(1, 1); // We need to keep Gesture Tap event enabled for object event to work @@ -72,10 +73,12 @@ namespace Tizen.Maps SetGestureEventCallback(); handle.SetGestureEnabled(Interop.ViewGesture.Scroll, true); _scrolledEventHandler += value; + Log.Info(string.Format("Scrolled event handler is added")); } remove { _scrolledEventHandler -= value; + Log.Info(string.Format("Scrolled event handler is removed")); if (_scrolledEventHandler == null) { handle.SetGestureEnabled(Interop.ViewGesture.Scroll, false); @@ -94,10 +97,12 @@ namespace Tizen.Maps SetGestureEventCallback(); handle.SetGestureEnabled(Interop.ViewGesture.Zoom, true); _zoomedEventHandler += value; + Log.Info(string.Format("ZoomChanged event handler is added")); } remove { _zoomedEventHandler -= value; + Log.Info(string.Format("ZoomChanged event handler is removed")); if (_zoomedEventHandler == null) { handle.SetGestureEnabled(Interop.ViewGesture.Zoom, false); @@ -116,10 +121,12 @@ namespace Tizen.Maps SetGestureEventCallback(); //handle.SetGestureEnabled(Interop.ViewGesture.Tap, true); _tappedEventHandler += value; + Log.Info(string.Format("Clicked event handler is added")); } remove { _tappedEventHandler -= value; + Log.Info(string.Format("Clicked event handler is removed")); if (_tappedEventHandler == null) { //handle.SetGestureEnabled(Interop.ViewGesture.Tap, false); @@ -138,10 +145,12 @@ namespace Tizen.Maps SetGestureEventCallback(); handle.SetGestureEnabled(Interop.ViewGesture.DoubleTap, true); _doubleTappedEventHandler += value; + Log.Info(string.Format("DoubleClicked event handler is removed")); } remove { _doubleTappedEventHandler -= value; + Log.Info(string.Format("DoubleClicked event handler is removed")); if (_doubleTappedEventHandler == null) { handle.SetGestureEnabled(Interop.ViewGesture.DoubleTap, false); @@ -160,10 +169,12 @@ namespace Tizen.Maps SetGestureEventCallback(); handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerTap, true); _twoFingerTappedEventHandler += value; + Log.Info(string.Format("TwoFingerPressed event handler is added")); } remove { _twoFingerTappedEventHandler -= value; + Log.Info(string.Format("TwoFingerPressed event handler is removed")); if (_twoFingerTappedEventHandler == null) { handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerTap, false); @@ -182,10 +193,12 @@ namespace Tizen.Maps SetGestureEventCallback(); handle.SetGestureEnabled(Interop.ViewGesture.Rotate, true); _rotatedEventHandler += value; + Log.Info(string.Format("Rotated event handler is added")); } remove { _rotatedEventHandler -= value; + Log.Info(string.Format("Rotated event handler is removed")); if (_rotatedEventHandler == null) { handle.SetGestureEnabled(Interop.ViewGesture.Rotate, false); @@ -204,10 +217,12 @@ namespace Tizen.Maps SetGestureEventCallback(); handle.SetGestureEnabled(Interop.ViewGesture.LongPress, true); _longPressedEventHandler += value; + Log.Info(string.Format("LongPressed event handler is added")); } remove { _longPressedEventHandler -= value; + Log.Info(string.Format("LongPressed event handler is removed")); if (_longPressedEventHandler == null) { handle.SetGestureEnabled(Interop.ViewGesture.LongPress, false); @@ -225,10 +240,12 @@ namespace Tizen.Maps { SetViewReadyEventCallback(); _viewReadyEventHandler += value; + Log.Info(string.Format("ViewReady event handler is added")); } remove { _viewReadyEventHandler -= value; + Log.Info(string.Format("ViewReady event handler is removed")); UnsetGestureEventCallback(); } } @@ -244,6 +261,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("ZoomLevel is changed from {0} to {1}", handle.ZoomLevel, value)); handle.ZoomLevel = value; } } @@ -259,6 +277,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("MinimumZoomLevel is changed from {0} to {1}", handle.MinimumZoomLevel, value)); handle.MinimumZoomLevel = value; } } @@ -274,6 +293,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("MaximumZoomLevel is changed from {0} to {1}", handle.MaximumZoomLevel, value)); handle.MaximumZoomLevel = value; } } @@ -289,6 +309,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Orientation is changed from {0} to {1}", handle.Orientation, value)); handle.Orientation = value; } } @@ -304,6 +325,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("MapType is changed from {0} to {1}", handle.MapType, value)); handle.MapType = (Interop.ViewType)value; } } @@ -319,6 +341,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Showing the 3D buildings is {0}", (value ? "enabled" : "disabled"))); handle.BuildingsEnabled = value; } } @@ -334,6 +357,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Showing the traffic is {0}", (value ? "enabled" : "disabled"))); handle.TrafficEnabled = value; } } @@ -349,6 +373,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Showing the public transit is {0}", (value ? "enabled" : "disabled"))); handle.PublicTransitEnabled = value; } } @@ -364,6 +389,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Showing the scale-bar is {0}", (value ? "enabled" : "disabled"))); handle.ScalebarEnabled = value; } } @@ -379,6 +405,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Language is changed from {0} to {1}", handle.Language, value)); handle.Language = value; } } @@ -394,6 +421,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Center is changed from {0} to {1}", handle.Center, value.handle)); handle.Center = value.handle; } } @@ -435,6 +463,7 @@ namespace Tizen.Maps /// <param name="child">map object to add</param> public void Add(MapObject child) { + Log.Info(string.Format("Add a object")); var objectHandle = child.GetHandle(); if (!_handleToObjectTable.ContainsKey(objectHandle)) { @@ -453,6 +482,7 @@ namespace Tizen.Maps /// <remarks>Once removed, child object will be become invalid</remarks> public void Remove(MapObject child) { + Log.Info(string.Format("Remove a object")); var objectHandle = child.GetHandle(); if (_handleToObjectTable.Remove(objectHandle)) { @@ -468,6 +498,7 @@ namespace Tizen.Maps /// </summary> public void RemoveAll() { + Log.Info(string.Format("Remove all of objects")); foreach (var child in _handleToObjectTable.Values) { child.InvalidateMapObject(); @@ -508,6 +539,7 @@ namespace Tizen.Maps } }; handle.SetEventCb(Interop.ViewEventType.Gesture, _gestureEventCallback, IntPtr.Zero); + Log.Info(string.Format("Gesture event callback is set")); } } @@ -523,6 +555,7 @@ namespace Tizen.Maps handle.UnsetEventCb(Interop.ViewEventType.Gesture); _gestureEventCallback = null; + Log.Info(string.Format("Gesture event callback is unset")); } private void SetObjectEventCallback() @@ -544,6 +577,7 @@ namespace Tizen.Maps } }; handle.SetEventCb(Interop.ViewEventType.Object, _objectEventCallback, IntPtr.Zero); + Log.Info(string.Format("Object event callback is set")); } } @@ -556,6 +590,7 @@ namespace Tizen.Maps _viewReadyEventHandler?.Invoke(this, EventArgs.Empty); }; handle.SetEventCb(Interop.ViewEventType.Ready, _viewReadyEventCallback, IntPtr.Zero); + Log.Info(string.Format("ViewReady event callback is set")); } } @@ -565,6 +600,7 @@ namespace Tizen.Maps { handle.UnsetEventCb(Interop.ViewEventType.Ready); _viewReadyEventCallback = null; + Log.Info(string.Format("ViewReady event callback is unset")); } } diff --git a/Tizen.Maps/Tizen.Maps/SearchPreference.cs b/Tizen.Maps/Tizen.Maps/SearchPreference.cs index 7ae0987..b27ef18 100755 --- a/Tizen.Maps/Tizen.Maps/SearchPreference.cs +++ b/Tizen.Maps/Tizen.Maps/SearchPreference.cs @@ -57,6 +57,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Language is changed from {0} to {1}", handle.Language, value)); handle.Language = value; } } @@ -73,6 +74,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("MaxResult is changed from {0} to {1}", handle.MaxResult, value)); handle.MaxResult = value; } } @@ -88,6 +90,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Unit is changed from {0} to {1}", handle.Unit, value)); handle.Unit = (Interop.DistanceUnit)value; } } @@ -103,6 +106,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("CountryCode is changed from {0} to {1}", handle.CountryCode, value)); handle.CountryCode = value; } } @@ -118,6 +122,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Properties is changed from {0} to {1}", Properties.ToString(), value.ToString())); _properties = value; } } @@ -133,6 +138,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("Optimization is changed from {0} to {1}", handle.Optimization, value)); handle.Optimization = (Interop.RouteOptimization)value; } } @@ -148,6 +154,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("TransportMode is changed from {0} to {1}", handle.TransportMode, value)); handle.TransportMode = (Interop.RouteTransportMode)value; } } @@ -163,6 +170,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("RouteFeatureWeight is changed from {0} to {1}", handle.FeatureWeight, value)); handle.FeatureWeight = (Interop.RouteFeatureWeight)value; } } @@ -178,6 +186,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("RouteFeature is changed from {0} to {1}", handle.Feature, value)); handle.Feature = (Interop.RouteRequestFeature)value; } } @@ -193,6 +202,7 @@ namespace Tizen.Maps } set { + Log.Info(string.Format("SearchAlternativeRoutes is {0}", (value ? "enabled" : "disabled"))); handle.AlternativesEnabled = value; } } diff --git a/packaging/csapi-maps.spec b/packaging/csapi-maps.spec index 527f424..e469b87 100644 --- a/packaging/csapi-maps.spec +++ b/packaging/csapi-maps.spec @@ -1,7 +1,7 @@ Name: csapi-maps Summary: Tizen Map Service API for C# Version: 1.0.10 -Release: 3 +Release: 4 Group: Development/Libraries License: Apache-2.0 and SAMSUNG URL: https://www.tizen.org |