internal class ServiceHandle : SafeMapsHandle
{
- internal ErrorCode DestroyHandle(IntPtr handle) { return Service.Destroy(handle); }
-
- public ServiceHandle(IntPtr handle, bool ownsHandle = true) : base(handle, ownsHandle) { Destroy = DestroyHandle; }
+ public ServiceHandle(IntPtr handle, bool ownsHandle = true) : base(handle, ownsHandle) { Destroy = Service.Destroy; }
}
}
internal class ViewHandle : SafeMapsHandle
{
- internal ErrorCode DestroyHandle(IntPtr handle) { return Service.Destroy(handle); }
-
- public ViewHandle(IntPtr handle, bool ownsHandle = true) : base(handle, ownsHandle) { Destroy = DestroyHandle; }
+ public ViewHandle(IntPtr handle, bool ownsHandle = true) : base(handle, ownsHandle) { Destroy = View.Destroy; }
}
}
<Compile Include="Tizen.Maps\MapGestureEventArgs.cs" />
<Compile Include="Tizen.Maps\MapObjectEventArgs.cs" />
<Compile Include="Tizen.Maps\MapObject.cs" />
- <Compile Include="Tizen.Maps\MapObjectType.cs" />
<Compile Include="Tizen.Maps\MapTypes.cs" />
<Compile Include="Tizen.Maps\Marker.cs" />
<Compile Include="Interop\Interop.Address.cs" />
<Compile Include="Tizen.Maps\MapGestureEventArgs.cs" />
<Compile Include="Tizen.Maps\MapObjectEventArgs.cs" />
<Compile Include="Tizen.Maps\MapObject.cs" />
- <Compile Include="Tizen.Maps\MapObjectType.cs" />
<Compile Include="Tizen.Maps\MapTypes.cs" />
<Compile Include="Tizen.Maps\Marker.cs" />
<Compile Include="Interop\Interop.Address.cs" />
* limitations under the License.
*/
-using System;
-
namespace Tizen.Maps
{
- [Flags]
+ /// <summary>
+ /// Enumeration of user gestures over map view
+ /// </summary>
public enum GestureType
{
+ /// <summary>
+ /// Indicates empty gesture
+ /// </summary>
None = Interop.ViewGesture.None,
+ /// <summary>
+ /// Indicates the move map user gesture
+ /// </summary>
Scroll = Interop.ViewGesture.Scroll,
+ /// <summary>
+ /// Indicates the zoom user gesture
+ /// </summary>
Zoom = Interop.ViewGesture.Zoom,
+ /// <summary>
+ /// Indicates the tap user gesture
+ /// </summary>
Tap = Interop.ViewGesture.Tap,
+ /// <summary>
+ /// Indicates the double tap user gesture
+ /// </summary>
DoubleTap = Interop.ViewGesture.DoubleTap,
+ /// <summary>
+ /// Indicates the two-finger tap user gesture
+ /// </summary>
TwoFingerTap = Interop.ViewGesture.TwoFingerTap,
+ /// <summary>
+ /// Indicates the rotation user gesture
+ /// </summary>
Rotate = Interop.ViewGesture.Rotate,
+ /// <summary>
+ /// Indicates the long press user gesture
+ /// </summary>
LongPress = Interop.ViewGesture.LongPress,
}
}
\ No newline at end of file
namespace Tizen.Maps
{
+ /// <summary>
+ /// Event arguments for gesture type map events
+ /// </summary>
public class MapGestureEventArgs : EventArgs
{
internal static MapGestureEventArgs Create(IntPtr nativeHandle)
RotationAngle = rotationAngle;
}
+ /// <summary>
+ /// Type of gesture event
+ /// </summary>
public GestureType GestureType { get; }
+
+ /// <summary>
+ /// Screen coordinates for the event
+ /// </summary>
public Point Position { get; }
+
+ /// <summary>
+ /// Number of fingers detected in the event
+ /// </summary>
public int TouchCount { get; }
+
+ /// <summary>
+ /// Zoom factor for zoom gesture event
+ /// </summary>
public double ZoomFactor { get; }
+
+ /// <summary>
+ /// Angle of rotation for rotate gesture event
+ /// </summary>
public double RotationAngle { get; }
+
+ /// <summary>
+ /// Geo-coordinates for the event
+ /// </summary>
public Geocoordinates Geocoordinates { get; }
}
}
handle = nativeHandle;
}
+
+ /// <summary>
+ /// Clicked event
+ /// </summary>
public event EventHandler Clicked;
+ /// <summary>
+ /// Map Object's visibility
+ /// </summary>
public bool IsVisible
{
get
ViewObject = mapObject;
}
+ /// <summary>
+ /// Type of gesture event
+ /// </summary>
public GestureType GestureType { get; }
+
+ /// <summary>
+ /// Screen coordinates for the event
+ /// </summary>
public Point Position { get; }
+
+ /// <summary>
+ /// Number of fingers detected in the event
+ /// </summary>
public int TouchCount { get; }
+
+ /// <summary>
+ /// Map Object on which event has occurred
+ /// </summary>
public MapObject ViewObject { get; }
}
}
+++ /dev/null
-/*
- * 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.
- */
-
-namespace Tizen.Maps
-{
- internal enum MapObjectType
- {
- Marker,
- Overlay,
- Polygon,
- Polyline,
- }
-}
\ No newline at end of file
namespace Tizen.Maps
{
+ /// <summary>
+ /// Map View Type (theme)
+ /// </summary>
public enum MapTypes
{
+ /// <summary>
+ /// Normal street theme
+ /// </summary>
Normal = Interop.ViewType.Normal,
+ /// <summary>
+ /// Satellite theme
+ /// </summary>
Satellite = Interop.ViewType.Satellite,
+ /// <summary>
+ /// Terrain theme
+ /// </summary>
Terrain = Interop.ViewType.Terrain,
+ /// <summary>
+ /// Hybrid theme, has both satellite and normal theme
+ /// </summary>
Hybrid = Interop.ViewType.Hybrid,
}
}
\ No newline at end of file
namespace Tizen.Maps
{
+ /// <summary>
+ /// Map View
+ /// </summary>
public class MapView : Layout
{
internal Interop.ViewHandle handle;
private event EventHandler<MapGestureEventArgs> _longPressedEventHandler;
private event EventHandler _viewReadyEventHandler;
+ /// <summary>
+ /// Creates the View and link it to the instance of map service
+ /// </summary>
+ /// <param name="parent">The evas object to be drawn</param>
+ /// <param name="service">Map service</param>
public MapView(EvasObject parent, MapService service) : base(parent)
{
IntPtr nativeHandle;
SetObjectEventCallback();
}
+ /// <summary>
+ /// Scrolled gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> Scrolled
{
add
}
}
+ /// <summary>
+ /// ZoomChanged gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> ZoomChanged
{
add
}
}
+ /// <summary>
+ /// Clicked gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> Clicked
{
add
}
}
+ /// <summary>
+ /// DoubleClicked gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> DoubleClicked
{
add
}
}
+ /// <summary>
+ /// TwoFingerPressed gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> TwoFingerPressed
{
add
}
}
+ /// <summary>
+ /// Rotated gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> Rotated
{
add
}
}
+ /// <summary>
+ /// LongPressed gesture event
+ /// </summary>
public event EventHandler<MapGestureEventArgs> LongPressed
{
add
}
}
+ /// <summary>
+ /// ViewReady gesture event
+ /// </summary>
public event EventHandler ViewReady
{
add
}
}
+ /// <summary>
+ /// Map View's current zoom level
+ /// </summary>
public int ZoomLevel
{
get
}
}
+ /// <summary>
+ /// Minimum zoom level for map view
+ /// </summary>
public int MinimumZoomLevel
{
get
}
}
+ /// <summary>
+ /// Maximum zoom level for map view
+ /// </summary>
public int MaximumZoomLevel
{
get
}
}
+ /// <summary>
+ /// orientation on the View [0 ~ 360 degrees]
+ /// </summary>
public double Orientation
{
get
}
}
+ /// <summary>
+ /// Map view type (theme)
+ /// </summary>
public MapTypes MapType
{
get
}
}
+ /// <summary>
+ /// Indicates whether the map should show the 3D buildings layer
+ /// </summary>
public bool BuildingsEnabled
{
get
}
}
+ /// <summary>
+ /// Indicates whether the map should show the traffic layer
+ /// </summary>
public bool TrafficEnabled
{
get
}
}
+ /// <summary>
+ /// Indicates whether the map should show the public transit layer
+ /// </summary>
public bool PublicTransitEnabled
{
get
}
}
+ /// <summary>
+ /// Gets whether the scale-bar is enabled or not
+ /// </summary>
public bool ScalebarEnabled
{
get
}
}
+ /// <summary>
+ /// Map view's language
+ /// </summary>
public string Language
{
get
}
}
+ /// <summary>
+ /// Geographical coordinates for map view's center
+ /// </summary>
public Geocoordinates Center
{
get
}
}
+ /// <summary>
+ /// List of map object added to map view
+ /// </summary>
public IEnumerable<MapObject> Children
{
get
}
}
+ /// <summary>
+ /// Changes geographical coordinates to screen coordinates
+ /// </summary>
+ /// <param name="coordinates">Geographical coordinates</param>
+ /// <returns></returns>
public Point GeolocationToScreen(Geocoordinates coordinates)
{
Point screenCoordinates = new Point();
return screenCoordinates;
}
+ /// <summary>
+ /// Changes screen coordinates to geographical coordinates
+ /// </summary>
+ /// <param name="screenCoordinates">screen coordinates</param>
+ /// <returns></returns>
public Geocoordinates ScreenToGeolocation(Point screenCoordinates)
{
IntPtr coordinateHandle;
return new Geocoordinates(coordinateHandle);
}
+ /// <summary>
+ /// Adds map object to map view
+ /// </summary>
+ /// <param name="child">map object to add</param>
public void Add(MapObject child)
{
child.handle.ReleaseOwnership();
Interop.View.AddObject(handle, child.handle);
}
+ /// <summary>
+ /// Removes map object from map view
+ /// </summary>
+ /// <param name="child">map object to remove</param>
public void Remove(MapObject child)
{
_children.Remove(child);
Interop.View.RemoveObject(handle, child.handle);
}
+ /// <summary>
+ /// Removes all map objects from map view
+ /// </summary>
public void RemoveAll()
{
foreach (var child in _children)
Interop.View.RemoveAllObjects(handle);
}
+ /// <summary>
+ /// Captures a snapshot of the Map View
+ /// </summary>
+ /// <param name="type">type of file format</param>
+ /// <param name="quality">quality for encoding (1~100) </param>
+ /// <param name="path">The file path for snapshot</param>
public void CaptureSnapshot(SnapshotType type, int quality, string path)
{
var err = Interop.ViewSnapshot.ViewCaptureSnapshot(handle, (Interop.ViewSnapshotFormatType)type, quality, path);
namespace Tizen.Maps
{
+ /// <summary>
+ /// Marker map object
+ /// </summary>
public class Marker : MapObject
{
internal Marker(Interop.ViewObjectHandle nativeHandle) : base(nativeHandle)
}
}
+ // TODO: Need to rename all Geocoordinates type property to Coordinates and all screen coordinates to Position
+
+ /// <summary>
+ /// Geographical coordinates for marker
+ /// </summary>
public Geocoordinates Position
{
get
}
}
+ /// <summary>
+ /// Image file path for marker
+ /// </summary>
public string ImagePath
{
get
}
}
+ /// <summary>
+ /// Screen size for marker
+ /// </summary>
public Size MarkerSize
{
get
}
}
+ /// <summary>
+ /// Z-order for marker
+ /// </summary>
public int ZOrder
{
get
}
}
+ /// <summary>
+ /// Changes marker size
+ /// </summary>
+ /// <param name="newSize">New size</param>
public void Resize(Size newSize)
{
MarkerSize = newSize;
}
+ /// <summary>
+ /// Changes marker coordinates
+ /// </summary>
+ /// <param name="newPosition">New position for marker</param>
public void Move(Geocoordinates newPosition)
{
Position = newPosition;
}
}
+ /// <summary>
+ /// Pin type marker map object
+ /// </summary>
public class Pin : Marker
{
+ /// <summary>
+ /// Creates Pin type parker
+ /// </summary>
+ /// <param name="coordinates">Marker coordinates</param>
+ /// <param name="imagePath">Image path</param>
public Pin(Geocoordinates coordinates, string imagePath) : base(coordinates, imagePath, Interop.ViewMarkerType.Pin)
{
}
}
+ /// <summary>
+ /// Sticker type marker map object
+ /// </summary>
public class Sticker : Marker
{
+ /// <summary>
+ /// Creates Sticker type parker
+ /// </summary>
+ /// <param name="coordinates">Marker coordinates</param>
+ /// <param name="imagePath">Image path</param>
public Sticker(Geocoordinates coordinates, string imagePath) : base(coordinates, imagePath, Interop.ViewMarkerType.Sticker)
{
}
namespace Tizen.Maps
{
+ /// <summary>
+ /// Overlay map object
+ /// </summary>
public class Overlay : MapObject
{
private EvasObject _containedObject;
+ /// <summary>
+ /// Creates normal overlay map object
+ /// </summary>
+ /// <param name="coordinates"></param>
+ /// <param name="objectToContain"></param>
public Overlay(Geocoordinates coordinates, EvasObject objectToContain) : this(coordinates, objectToContain, Interop.ViewOverlayType.Normal)
{
}
_containedObject = objectToContain;
}
+ /// <summary>
+ /// Geographical coordinates for overlay
+ /// </summary>
public Geocoordinates Coordinates
{
get
}
}
+ /// <summary>
+ /// Minimum zoom level for overlay
+ /// </summary>
public int MinimumZoomLevel
{
get
}
}
+ /// <summary>
+ /// Maximum zoom lever for overlay
+ /// </summary>
public int MaximumZoomLevel
{
get
}
}
+ /// <summary>
+ /// Bubble overlay map object
+ /// </summary>
public class BubbleOverlay : Overlay
{
public BubbleOverlay(Geocoordinates coordinates, EvasObject objectToContain) : base(coordinates, objectToContain, Interop.ViewOverlayType.Bubble)
}
}
+ /// <summary>
+ /// Box Overlay map object
+ /// </summary>
public class BoxOverlay : Overlay
{
+ /// <summary>
+ /// Creates Box overlay
+ /// </summary>
public BoxOverlay(Geocoordinates coordinates, EvasObject objectToContain) : base(coordinates, objectToContain, Interop.ViewOverlayType.Box)
{
}
namespace Tizen.Maps
{
+ /// <summary>
+ /// Polygon map object
+ /// </summary>
public class Polygon : MapObject
{
private List<Geocoordinates> _coordinateList;
+ /// <summary>
+ /// Creates a polygon visual object
+ /// </summary>
+ /// <param name="coordinates">list of geographical coordinates</param>
+ /// <param name="color">background color</param>
public Polygon(IEnumerable<Geocoordinates> coordinates, Color color) : base(CreateNativeHandle(coordinates, color))
{
var err = Interop.ErrorCode.InvalidParameter;
{
}
+ /// <summary>
+ /// List of geographical coordinates of polygon vertices
+ /// </summary>
public IEnumerable<Geocoordinates> Coordinates
{
get
}
}
+ /// <summary>
+ /// Background fill color
+ /// </summary>
public Color FillColor
{
get
namespace Tizen.Maps
{
+ /// <summary>
+ /// Polyline map object
+ /// </summary>
public class Polyline : MapObject
{
private List<Geocoordinates> _coordinateList;
+ /// <summary>
+ /// Creates polyline visual object
+ /// </summary>
+ /// <param name="coordinates">List of geographical coordinates</param>
+ /// <param name="color">Line color</param>
+ /// <param name="width">The width of line [1 ~ 100] (pixels)</param>
public Polyline(List<Geocoordinates> coordinates, Color color, int width) : base(CreateNativeHandle(coordinates, color, width))
{
var err = Interop.ErrorCode.InvalidParameter;
{
}
+ /// <summary>
+ /// List of geographical coordinates for polyline vertices
+ /// </summary>
public IEnumerable<Geocoordinates> Coordinates
{
get
}
}
+ /// <summary>
+ /// Line color
+ /// </summary>
public Color LineColor
{
get
}
}
+ /// <summary>
+ /// line width [1 ~ 100 pixels]
+ /// </summary>
public int Width
{
get