Example #1
0
        async void Locator()
        {
            var locator = CrossGeolocator.Current;

            locator.DesiredAccuracy = 25;
            var location = await locator.GetPositionAsync();

            var position = new TK.CustomMap.Position(location.Latitude, location.Longitude);
            await Task.Delay(3000);

            _mapRegion = TK.CustomMap.MapSpan.FromCenterAndRadius(position, TK.CustomMap.Distance.FromKilometers(2));

            MapRegion = TK.CustomMap.MapSpan.FromCenterAndRadius(_mapRegion.Center, TK.CustomMap.Distance.FromKilometers(.3));



            //  Mapa.MoveToMapRegion((MapSpan.FromCenterAndRadius((position), Distance.FromMiles(.3))), true);
            //Mapa.MoveToRegion(MapSpan.FromCenterAndRadius((position), Distance.FromMiles(.3)));
        }
 public LectureVenueLocatorPage(ObservableCollection <TKRoute> routes, ObservableCollection <TKCustomMapPin> pins, TK.CustomMap.MapSpan bounds)
 {
     InitializeComponent();
     BindingContext = new AddRouteViewModel(routes, pins, bounds);
 }
Example #3
0
 /// <summary>
 /// Moves the visible region to the specified <see cref="MapSpan"/>
 /// </summary>
 /// <param name="region">Region to move the map to</param>
 /// <param name="animate">If the region change should be animated or not</param>
 public void MoveToMapRegion(MapSpan region, bool animate = false)
 {
     MapFunctions.MoveToMapRegion(region, animate);
 }
Example #4
0
 /// <summary>
 /// Creates a new instance of <see cref="TKCustomMap"/>
 /// </summary>
 /// <param name="initialLatitude">The initial latitude value</param>
 /// <param name="initialLongitude">The initial longitude value</param>
 /// <param name="distanceInKilometers">The initial zoom distance in kilometers</param>
 public TKCustomMap(double initialLatitude, double initialLongitude, double distanceInKilometers) :
     base(MapSpan.FromCenterAndRadius(new Position(initialLatitude, initialLongitude), Distance.FromKilometers(distanceInKilometers)))
 {
 }
Example #5
0
 /// <summary>
 /// Creates a new instance of <c>TKCustomMap</c>
 /// </summary>
 /// <param name="region">The initial region of the map</param>
 public TKCustomMap(MapSpan region)
     : base(region)
 {
     MapCenter = region.Center;
 }
 public AddRouteViewModel(ObservableCollection <TKRoute> routes, ObservableCollection <TKCustomMapPin> pins, TK.CustomMap.MapSpan bounds)
 {
     this.Routes = routes;
     this.Pins   = pins;
     this.Bounds = bounds;
     db          = new RealmDataBase();
 }