Beispiel #1
0
        private static void OnMapCenterChanged(BindableObject instance, object oldValue, object newValue)
        {
            TKMapView map = (TKMapView)instance;

            map.MapCenter = (GeoLocation)newValue;
            if (map.MyMap.Height > 0)
            {
                map.InvalidateLayout();                                                                                                       //map will not center if it's still loading the view - call invalidate to force move after setting value
                map.MyMap.MoveToMapRegion(TK.CustomMap.MapSpan.FromCenterAndRadius(map.MyMap.MapCenter, TK.CustomMap.Distance.FromMiles(2))); //zoom level is lost when loaded, so re-zoom
            }
        }
Beispiel #2
0
        private static void OnLocationsChanged(BindableObject instance, object oldValue, object newValue)
        {
            TKMapView map = (TKMapView)instance;

            map.Locations = (ObservableCollection <GeoLocation>)newValue;
        }