| | | 1 | | using GMap.NET; |
| | | 2 | | using GMap.NET.MapProviders; |
| | | 3 | | using GMap.NET.WindowsPresentation; |
| | | 4 | | using System.Collections.ObjectModel; |
| | | 5 | | using System.Windows.Input; |
| | | 6 | | namespace OffRouteMap |
| | | 7 | | { |
| | | 8 | | |
| | | 9 | | public class GMapControlWrapper : IGMapControl |
| | | 10 | | { |
| | | 11 | | private readonly GMapControl _control; |
| | | 12 | | |
| | 0 | 13 | | public GMapControlWrapper (GMapControl control) |
| | | 14 | | { |
| | 0 | 15 | | _control = control; |
| | 0 | 16 | | } |
| | | 17 | | |
| | | 18 | | public double Zoom |
| | | 19 | | { |
| | 0 | 20 | | get => _control.Zoom; |
| | 0 | 21 | | set => _control.Zoom = value; |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | public bool ShowCenter |
| | | 25 | | { |
| | 0 | 26 | | get => _control.ShowCenter; |
| | 0 | 27 | | set => _control.ShowCenter = value; |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | public bool CanDragMap |
| | | 31 | | { |
| | 0 | 32 | | get => _control.CanDragMap; |
| | 0 | 33 | | set => _control.CanDragMap = value; |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | public MouseButton DragButton |
| | | 37 | | { |
| | 0 | 38 | | get => _control.DragButton; |
| | 0 | 39 | | set => _control.DragButton = value; |
| | | 40 | | } |
| | | 41 | | |
| | | 42 | | public PointLatLng Position |
| | | 43 | | { |
| | 0 | 44 | | get => _control.Position; |
| | 0 | 45 | | set => _control.Position = value; |
| | | 46 | | } |
| | | 47 | | |
| | | 48 | | public GMapProvider MapProvider |
| | | 49 | | { |
| | 0 | 50 | | get => _control.MapProvider; |
| | 0 | 51 | | set => _control.MapProvider = value; |
| | | 52 | | } |
| | | 53 | | |
| | 0 | 54 | | public ObservableCollection<GMapMarker> Markers => _control.Markers; |
| | | 55 | | |
| | | 56 | | |
| | | 57 | | PureImageCache IGMapControl.PrimaryCache |
| | | 58 | | { |
| | 0 | 59 | | get => _control.Manager.PrimaryCache; |
| | 0 | 60 | | set => _control.Manager.PrimaryCache = value; |
| | | 61 | | } |
| | | 62 | | |
| | | 63 | | AccessMode IGMapControl.CacheMode |
| | | 64 | | { |
| | 0 | 65 | | get => _control.Manager.Mode; |
| | 0 | 66 | | set => _control.Manager.Mode = value; |
| | | 67 | | } |
| | | 68 | | |
| | 0 | 69 | | public PointLatLng FromLocalToLatLng (int x, int y) => _control.FromLocalToLatLng(x, y); |
| | | 70 | | |
| | | 71 | | } |
| | | 72 | | |
| | | 73 | | } |