internal AreaHandle(CoordinatesHandle topLeft, CoordinatesHandle bottomRight) : this(IntPtr.Zero, true) { IntPtr _topLeft = (topLeft != null ? topLeft : IntPtr.Zero); IntPtr _bottomRight = (bottomRight != null ? bottomRight : IntPtr.Zero); CreateRectangle(_topLeft, _bottomRight, out handle).ThrowIfFailed("Failed to create native handle"); }
internal MarkerHandle(CoordinatesHandle coordinates, string imagePath, ViewMarkerType type) : base(IntPtr.Zero, true) { var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates); CreateMarker(clonedCoordinatesHandle, imagePath, type, out handle).ThrowIfFailed("Failed to create native handle for marker"); clonedCoordinatesHandle.HasOwnership = false; }
internal CoordinatesHandle ScreenToGeolocation(Point position) { IntPtr coordinates; this.ScreenToGeolocation(position.X, position.Y, out coordinates).WarnIfFailed("Failed to convert screen position to geocoordinates"); return(CoordinatesHandle.Create(coordinates)); }
internal OverlayHandle(CoordinatesHandle coordinates, EvasObject viewObject, ViewOverlayType type) : base(IntPtr.Zero, true) { var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates); CreateOverlay(clonedCoordinatesHandle, viewObject, type, out handle).ThrowIfFailed("Failed to create native overlay handle"); clonedCoordinatesHandle.HasOwnership = false; }
internal void ForEach(Action <CoordinatesHandle> action) { CoordinatesCallback callback = (index, handle, userData) => { action(CoordinatesHandle.CloneFrom(handle)); return(true); }; Foreach(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get coordinates list from native handle"); }
internal Point GeolocationToScreen(CoordinatesHandle coordinates) { int x, y; this.GeolocationToScreen(coordinates, out x, out y).WarnIfFailed("Failed to convert geocoordinates to screen position"); return(new Point() { X = x, Y = y }); }
internal void Add(CoordinatesHandle handleToAdd) { using (var clonedHandle = CoordinatesHandle.CloneFrom(handleToAdd)) { if (this.Append(clonedHandle).WarnIfFailed("Failed to add coordinates to the list")) { clonedHandle.HasOwnership = false; } } }
internal void ForeachPath(Action <CoordinatesHandle> action) { PathCallback callback = (index, total, nativeHandle, userData) => { if (handle != IntPtr.Zero) { action(CoordinatesHandle.CloneFrom(nativeHandle)); //Destroy(nativeHandle); } return(true); }; ForeachPath(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get path coordinates list from native handle"); }
internal static extern ErrorCode CreateOverlay(CoordinatesHandle /* maps_coordinates_h */ coordinates, IntPtr viewObject, ViewOverlayType /* maps_view_overlay_type_e */ type, out IntPtr /* maps_view_object_h */ overlay);
internal static extern ErrorCode SetCoordinates(this OverlayHandle /* maps_view_object_h */ overlay, CoordinatesHandle /* maps_coordinates_h */ coordinates);
internal AreaHandle(CoordinatesHandle center, double radius) : this(IntPtr.Zero, true) { IntPtr _center = (center != null ? center : IntPtr.Zero); CreateCircle(_center, radius, out handle).ThrowIfFailed("Failed to create native handle"); }
internal static extern ErrorCode GeolocationToScreen(this ViewHandle /* maps_view_h */ view, CoordinatesHandle /* maps_coordinates_h */ coordinates, out int x, out int y);
internal static extern ErrorCode SearchRoute(this ServiceHandle /* maps_service_h */ maps, CoordinatesHandle /* maps_coordinates_h */ origin, CoordinatesHandle /* maps_coordinates_h */ destination, PreferenceHandle /* maps_preference_h */ preference, SearchRouteCallback callback, IntPtr /* void */ userData, out int requestId);
internal static extern ErrorCode CreateMarker(CoordinatesHandle /* maps_coordinates_h */ coordinates, string imageFilePath, ViewMarkerType /* maps_view_marker_type_e */ type, out IntPtr /* maps_view_object_h */ marker);
internal static extern ErrorCode SetCoordinates(this MarkerHandle /* maps_view_object_h */ marker, CoordinatesHandle /* maps_coordinates_h */ coordinates);
internal static extern ErrorCode SearchPlace(this ServiceHandle /* maps_service_h */ maps, CoordinatesHandle /* maps_coordinates_h */ position, int distance, PlaceFilterHandle /* maps_place_filter_h */ filter, PreferenceHandle /* maps_preference_h */ preference, SearchPlaceCallback callback, IntPtr /* void */ userData, out int requestId);
internal static extern ErrorCode Remove(this CoordinatesListHandle /* maps_coordinates_list_h */ coordinatesList, CoordinatesHandle /* maps_coordinates_h */ coordinates);
internal static extern ErrorCode GetLongitude(this CoordinatesHandle /* maps_coordinates_h */ coordinates, out double longitude);
internal static extern ErrorCode SetCenter(this ViewHandle /* maps_view_h */ view, CoordinatesHandle /* maps_coordinates_h */ coordinates);