public NearbyClinicDetailPage()
        {
            InitializeComponent();
            if (Device.iOS == Device.RuntimePlatform)
            {
                NavigationPage.SetTitleIcon(this, AppConfigurations.IconNavigationBar);
            }
            NearbyClinicsPageViewModel = (NearbyClinicsPageViewModel)BindingContext;
            ClinicSelected             = NearbyClinicsPageViewModel.ClinicSelected;

            map = new ExtendedMap(MapSpan.FromCenterAndRadius(new Position(ClinicSelected.Latitude, ClinicSelected.Longitude), Distance.FromKilometers(1)))
            {
                IsShowingUser = CrossGeolocator.Current.IsGeolocationAvailable && CrossGeolocator.Current.IsGeolocationEnabled,
                ItemsSource   = new List <ClinicViewModel>()
                {
                    new ClinicViewModel()
                    {
                        Icon           = "gps2",
                        HasInteraction = false,
                        Latitude       = ClinicSelected.Latitude,
                        Longitude      = ClinicSelected.Longitude,
                        Name           = ClinicSelected.Name,
                        Description    = ClinicSelected.Description
                    }
                },
            };
            stackMap.Content = map;
            NearbyClinicsPageViewModel.PropertyChanged += NearbyClinicsPageViewModelPropertyChanged;
        }
Esempio n. 2
0
        public MedicalCenterCoordinationDetailPage()
        {
            InitializeComponent();
            if (Device.iOS == Device.RuntimePlatform)
            {
                NavigationPage.SetTitleIcon(this, AppConfigurations.IconNavigationBar);
            }

            pendingCoordination  = (MedicalCenterCoordinationPageViewModel)BindingContext;
            CoordinationSelected = pendingCoordination.CoordinationSelected;

            map = new ExtendedMap(MapSpan.FromCenterAndRadius(new Position(CoordinationSelected.Latitude, CoordinationSelected.Longitude), Distance.FromKilometers(1)))
            {
                IsShowingUser = CrossGeolocator.Current.IsGeolocationAvailable && CrossGeolocator.Current.IsGeolocationEnabled,
                ItemsSource   = new List <ClinicViewModel>()
                {
                    new ClinicViewModel()
                    {
                        Icon           = "gps",
                        HasInteraction = false,
                        Latitude       = CoordinationSelected.Latitude,
                        Longitude      = CoordinationSelected.Longitude,
                        Name           = CoordinationSelected.ClinicName,
                    }
                }
            };
            frameMap.Content = map;
            pendingCoordination.PropertyChanged += pendingCoordinationPropertyChanged;
        }
Esempio n. 3
0
        public MapPage()
        {
            BindingContext = new MapViewModel();;

            var mapSpan = MapSpan.FromCenterAndRadius(Location.DefaultPosition, Distance.FromKilometers(45));

            _map = new ExtendedMap(mapSpan);
            _map.ShowDetailCommand = ViewModel.ShowDetailCommand;

            ViewModel.Monkeys.CollectionChanged += UpdatePins;
            var loadButton = new Button {
                Text = "Load Monkeys"
            };
            var addButton = new Button {
                Text = "Add Monkey"
            };

            loadButton.SetBinding(Button.CommandProperty, "LoadMonkeysCommand");
            addButton.SetBinding(Button.CommandProperty, "AddMonkeyCommand");

            var stack = new StackLayout {
                Spacing = 0, Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0)
            };

            stack.Children.Add(loadButton);
            stack.Children.Add(addButton);
            stack.Children.Add(_map);
            Content = stack;
        }
Esempio n. 4
0
 protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
 {
     base.OnElementChanged(e);
     if (e.NewElement == null)
     {
         return;
     }
     element = Element as ExtendedMap;
 }
Esempio n. 5
0
        public MapCell() : base()
        {
            ViewLayout.HeightRequest = 90;

            TextLabel = new Label
            {
                VerticalOptions = LayoutOptions.Center
            };
            ViewLayout.Children.Add(TextLabel);


            MyMap = new ExtendedMap
            {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                MapType           = MapType.Hybrid,
                HeightRequest     = 80,
                WidthRequest      = 220,
                IsEnabled         = false,
                IsVisible         = false
            };
            ViewLayout.Children.Add(MyMap);

            InfoText = new Label
            {
                IsVisible         = true,
                Text              = "Sett posisjon",
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                TextColor         = Utility.PRIMARY_COLOR
            };
            ViewLayout.Children.Add(InfoText);

            ActivityIndicator = new ActivityIndicator
            {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions   = LayoutOptions.Center,
                IsRunning         = true,
                IsVisible         = false
            };
            ViewLayout.Children.Add(ActivityIndicator);

            var gestureRecognizer = new TapGestureRecognizer();

            gestureRecognizer.Tapped += async(s, e) =>
            {
                await _navigator.PushAsync <InputPositionViewModel>(
                    beforeNavigate : async(arg) =>
                {
                    await arg.InitializeAsync(Position, HuntPosition, CellAction.Save, CellAction.Delete);
                });
            };

            ViewLayout.GestureRecognizers.Add(gestureRecognizer);

            View = ViewLayout;
        }
Esempio n. 6
0
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);
            if (isLoaded)
            {
                nativeMap.RemoveOverlays(nativeMap.Overlays);
            }

            if (e.NewElement == null)
            {
                return;
            }
            if (e.OldElement != null)
            {
                nativeMap = Control as MKMapView;
            }
            element            = Element as ExtendedMap;
            mapDelegate        = new MapDelegate();
            nativeMap          = Control as MKMapView;
            nativeMap.Delegate = null;
            nativeMap.Delegate = mapDelegate;

            var formsMap = (ExtendedMap)e.NewElement;

            CLLocationCoordinate2D[] coords = new CLLocationCoordinate2D[element.RouteCoordinates.Count];

            int    index     = 0;
            int    idCounter = 1;
            string icon      = "";

            icon = element.ImageSource;
            foreach (var circle in element.Circles)
            {
                var annot = new CustomAnnotation(new CLLocationCoordinate2D(circle.Position.Latitude, circle.Position.Longitude), element.CustomPins.FirstOrDefault().Label, "", false, icon);
                annot.Id = idCounter++;
                nativeMap.AddAnnotation(annot);
                //pinCollection.Add(annot.Id, item);
                annotations.Add(annot);
                var circleOverlay = MKCircle.Circle(new CLLocationCoordinate2D(circle.Position.Latitude, circle.Position.Longitude), circle.Radius);
                nativeMap.AddOverlay(circleOverlay);
            }

            foreach (var position in element.RouteCoordinates)
            {
                var annot = new CustomAnnotation(new CLLocationCoordinate2D(position.Latitude, position.Longitude), element.CustomPins.FirstOrDefault().Label, "", false, icon);
                annot.Id = idCounter++;
                nativeMap.AddAnnotation(annot);
                //pinCollection.Add(annot.Id, item);
                annotations.Add(annot);
                coords[index] = new CLLocationCoordinate2D(position.Latitude, position.Longitude);
                index++;
            }
            var routeOverlay = MKPolyline.FromCoordinates(coords);

            nativeMap.AddOverlay(routeOverlay);
        }
Esempio n. 7
0
        public FooterMasterContentView(ExtendedMap extendedMap, UIHelper uiHelper, Footer footer)
        {
            _extendedMap = extendedMap;
            _uiHelper    = uiHelper;
            _footer      = footer;

            BindingContext = new FooterMasterViewModel(extendedMap);
//			BindingContext = extendedMap ;
//			Content = CreateFooter ();
            InitializeComponent();
        }
		public FooterMasterContentView(ExtendedMap extendedMap, UIHelper uiHelper, Footer footer)
		{
			_extendedMap = extendedMap;
			_uiHelper = uiHelper;
			_footer = footer;

						BindingContext = new FooterMasterViewModel(extendedMap) ;
//			BindingContext = extendedMap ;
//			Content = CreateFooter ();
			InitializeComponent ();
		}
        private void InitMap()
        {
            CurrentMap = new ExtendedMap()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand
            };
            CurrentMap.IsShowingUser = true;

            SetPinsAtPositions();

            Content = CurrentMap;
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
        {
            base.OnElementChanged(e);

            ExtendedMap element = (ExtendedMap)Element;

            if (Control != null && element != null)
            {
                CoverageCoordinates = element.CoverageCoordinates;
                Coverages           = element.Coverages;
                Control.GetMapAsync(this);
            }
        }
Esempio n. 11
0
        public MyPage()
        {
            var vm = new ViewModel();

            this.BindingContext = vm;

            var center = GeoHelper.GetCentralPosition(vm.Monkeys.Select(m => m.Location));

            var radius = GeoHelper.GetRadius(center, vm.Monkeys.Select(m => m.Location), true);

            var map = new ExtendedMap(
                MapSpan.FromCenterAndRadius(
                    center,
                    Distance.FromMeters(radius)
                    )
                );

//			map.BindingContext = this.BindingContext;
            map.SetBinding <ViewModel> (ExtendedMap.ItemsSourceProperty, m => m.Monkeys);
            map.SetBinding <ViewModel> (ExtendedMap.SelectedPinProperty, m => m.Selected, BindingMode.TwoWay);
            map.SetBinding <ViewModel> (ExtendedMap.VisibleRegionProperty, m => m.Span, BindingMode.TwoWay);
            map.SetBinding <ViewModel> (ExtendedMap.ShowDetailCommandProperty, m => m.PinSelectedCommand);

            var relativeLayout = new RelativeLayout();

            relativeLayout.Children.Add(
                map,
                widthConstraint: Constraint.RelativeToParent((parent) => { return(parent.Width); }),
                heightConstraint: Constraint.RelativeToParent((parent) => { return(parent.Height * 0.5); }));

            var listView = new ListView();

            listView.RowHeight    = 50;
            listView.ItemTemplate = new DataTemplate(typeof(TextCell));
            listView.ItemTemplate.SetBinding(TextCell.TextProperty, "Name");
            listView.SetBinding <ViewModel> (ListView.ItemsSourceProperty, m => m.Monkeys);
            listView.ItemSelected += async(sender, e) => {
                vm.Selected = e.SelectedItem as CustomPin;
            };

            vm.PinSelected += (sender, e) => {
                this.Navigation.PushAsync(new DetailPage(e));
            };

            relativeLayout.Children.Add(
                listView,
                yConstraint: Constraint.RelativeToView(map, (parent, view) => { return(view.Height + 50); }),
                heightConstraint: Constraint.RelativeToView(map, (parent, view) => { return(parent.Height - view.Height - 50); }));

            this.Content = relativeLayout;
        }
Esempio n. 12
0
        public FooterMasterViewModel(ExtendedMap extendedMap)
        {
            _extendedMap = extendedMap;
            Address      = extendedMap.SelectedPin.Address;
            SvgAssembly  = typeof(CustomMapContentView).GetTypeInfo().Assembly;
//
//				var navImage = new SvgImage {
//				SvgPath = string.Format ("ExtendedMap.Forms.Plugin.Abstractions.Images.{0}", buttonImage),
//				SvgAssembly = typeof(CustomMapContentView).GetTypeInfo ().Assembly,
//				HorizontalOptions = LayoutOptions.Center,
//				HeightRequest = height,
//				WidthRequest = width
//			};
        }
Esempio n. 13
0
        public MyPage()
        {
            var vm = new ViewModel ();
            this.BindingContext = vm;

            var center = GeoHelper.GetCentralPosition (vm.Monkeys.Select (m => m.Location));

            var radius = GeoHelper.GetRadius (center, vm.Monkeys.Select (m => m.Location), true);

            var map = new ExtendedMap (
                MapSpan.FromCenterAndRadius (
                    center,
                    Distance.FromMeters (radius)
                )
            );
            //			map.BindingContext = this.BindingContext;
            map.SetBinding<ViewModel> (ExtendedMap.ItemsSourceProperty, m => m.Monkeys);
            map.SetBinding<ViewModel> (ExtendedMap.SelectedPinProperty, m => m.Selected, BindingMode.TwoWay);
            map.SetBinding<ViewModel> (ExtendedMap.VisibleRegionProperty, m => m.Span, BindingMode.TwoWay);
            map.SetBinding<ViewModel> (ExtendedMap.ShowDetailCommandProperty, m => m.PinSelectedCommand);

            var relativeLayout = new RelativeLayout ();

            relativeLayout.Children.Add(
                map,
                widthConstraint: Constraint.RelativeToParent((parent) => { return parent.Width; }),
                heightConstraint: Constraint.RelativeToParent((parent) => { return parent.Height * 0.5; }));

            var listView = new ListView ();
            listView.RowHeight = 50;
            listView.ItemTemplate = new DataTemplate (typeof(TextCell));
            listView.ItemTemplate.SetBinding (TextCell.TextProperty, "Name");
            listView.SetBinding<ViewModel> (ListView.ItemsSourceProperty, m => m.Monkeys);
            listView.ItemSelected += async (sender, e) => {
                vm.Selected = e.SelectedItem as CustomPin;
            };

            vm.PinSelected += (sender, e) => {
                this.Navigation.PushAsync(new DetailPage(e));
            };

            relativeLayout.Children.Add(
                listView,
                yConstraint: Constraint.RelativeToView(map, (parent, view) => { return view.Height + 50; }),
                heightConstraint: Constraint.RelativeToView(map, (parent, view) => { return parent.Height - view.Height - 50; }));

            this.Content = relativeLayout;
        }
        public NearbyClinicsPage()
        {
            InitializeComponent();
            if (Device.iOS == Device.RuntimePlatform)
            {
                NavigationPage.SetTitleIcon(this, AppConfigurations.IconNavigationBar);
            }

            nearbyClinicsPageViewModel = (NearbyClinicsPageViewModel)BindingContext;

            map = new ExtendedMap(MapSpan.FromCenterAndRadius(new Position(latitude, longitude), Distance.FromKilometers(20)))
            {
                IsShowingUser = CrossGeolocator.Current.IsGeolocationAvailable && CrossGeolocator.Current.IsGeolocationEnabled,
                ItemsSource   = nearbyClinicsPageViewModel.Clinics,
                ZoomDistance  = 2
            };

            stackMap.Children.Add(map);
            nearbyClinicsPageViewModel.PropertyChanged += NearbyClinicsPageViewModelPropertyChanged;
        }
Esempio n. 15
0
        public virtual StackLayout GetStackLayout()
        {
            var map = new ExtendedMap(MapSpan.FromCenterAndRadius(new Position(-16.680849, -49.256236), Distance.FromKilometers(0.5)))
            {
                IsShowingUser   = true,
                HeightRequest   = 100,
                WidthRequest    = 960,
                VerticalOptions = LayoutOptions.FillAndExpand,
                MapType         = MapType.Street
            };
            var gesture = new TapGestureRecognizer();

            gesture.Tapped += Gesture_Tapped;
            map.GestureRecognizers.Add(gesture);
            var stack = new StackLayout {
                Spacing = 0
            };

            stack.Children.Add(map);

            return(stack);
        }
Esempio n. 16
0
        public App()
        {
            MainButton = new Button {
                VerticalOptions = LayoutOptions.End,
                Text            = "Click Me"
            };
            MainButton.Clicked += MainButton_Clicked;
            Map = new ExtendedMap {
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            // The root page of your application
            MainPage = new ContentPage {
                Content = new StackLayout {
                    Children =
                    {
                        Map,
                        MainButton
                    }
                }
            };
        }
Esempio n. 17
0
        public App()
        {
            var map = new ExtendedMap(
                MapSpan.FromCenterAndRadius(
                    new Position(37, -122), Distance.FromMiles(0.3)))
            {
                IsShowingUser   = true,
                HeightRequest   = 100,
                WidthRequest    = 960,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            var stack = new StackLayout {
                Spacing = 0
            };

            stack.Children.Add(map);
            // The root page of your application
            MainPage = new ContentPage
            {
                Content = stack
            };
        }
        public RegisterIncidentMarker()
        {
            Title = "Registro de incidencia";

            _geolocator = CrossGeolocator.Current;
            _map        = new ExtendedMap
            {
                MapType       = MapType.Street,
                IsShowingUser = true
            };
            _map.Tap    += _map_Tap;
            _incidentBtn = new Button
            {
                BackgroundColor = (Color)App.Current.Resources["Blue"],
                TextColor       = Color.White,
                Text            = "Agregar"
            };
            _incidentBtn.Clicked += _incidentBtn_Clicked;
            var grid = new Grid
            {
                RowDefinitions = new RowDefinitionCollection
                {
                    new RowDefinition {
                        Height = GridLength.Star
                    },
                    new RowDefinition {
                        Height = 40
                    }
                },
                RowSpacing = 0
            };

            grid.Children.Add(_map);
            grid.Children.Add(_incidentBtn, 0, 1);

            Content = grid;
        }
Esempio n. 19
0
        //bool isCircle;
        // ExtendedMap formsMap;
        //Circle circle;

        public static void Init()
        {
            var tt = new ExtendedMap();
        }
Esempio n. 20
0
        private void InitMap()
        {
            CurrentMap = new ExtendedMap()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand
            };

            SetPinAtPosition();
            CurrentMap.Tap          += MapOnTap;
            CurrentMap.IsShowingUser = true;

            var btnSave = new Button()
            {
                Text = "Lagre"
            };

            btnSave.Clicked += delegate(object sender, EventArgs args)
            {
                _callback(this);
                Navigation.PopModalAsync(true);
            };
            var btnCancel = new Button()
            {
                Text = "Avbryt"
            };

            btnCancel.Clicked += delegate(object sender, EventArgs args)
            {
                Navigation.PopModalAsync(true);
            };

            var btnRemove = new Button()
            {
                Text = "Slett"
            };

            btnRemove.Clicked += delegate(object sender, EventArgs args)
            {
                VM.Position = new Position();
                _callback(this);
                Navigation.PopModalAsync(true);
            };

            var lblStatus = new Label()
            {
                FontSize          = 12,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };

            lblStatus.SetBinding(Label.TextProperty, "Status");
            var stackLayout = new StackLayout()
            {
                Children =
                {
                    CurrentMap,
                    new StackLayout()
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children    =
                        {
                            btnCancel,
                            btnRemove,
                            lblStatus,
                            btnSave
                        }
                    }
                }
            };

            Content = stackLayout;
        }
Esempio n. 21
0
 public void SetMapView(ExtendedMap mapView)
 {
     _mapView = mapView;
 }
Esempio n. 22
0
		private void myLoad ()
		{
			


			this.rightPanelWDip = App.k_screenW * .11;

			//var span = MapSpan.FromCenterAndRadius (new Position (44.7201029, 11.1439078), Distance.FromMiles (0.4));
			MapSpan span = null;
			if (this.isGeneralMap == false) {
				span = MapSpan.FromCenterAndRadius (new Position (Convert.ToDouble (drCurrent.Latitude.Value), Convert.ToDouble (drCurrent.Longitude.Value)), 
					Distance.FromMiles (3.2));
				//0.4  3.2
			} else {
				span = MapSpan.FromCenterAndRadius (new Position (Convert.ToDouble (Global.currentPosition.Latitude), 
					Convert.ToDouble (Global.currentPosition.Longitude)), 
					Distance.FromMiles (3.2));
			}
			map = new ExtendedMap (span) {
				VerticalOptions = LayoutOptions.FillAndExpand
			};

			map.IsShowingUser = true;

			/*
			Pin item = new Pin ();
			item.Position = new Position (44.73, 11.15);

			item.Clicked += delegate(object sender, EventArgs e) {
				Debug.WriteLine ("..");	
			};
			item.Type = PinType.Place;

			item.Label = "some place";
			map.Pins.Add (item);// = items;
			*/

			/*
			List<ExtendedPin> mypins = new List<ExtendedPin> ();
			mypins.Add (new ExtendedPin () {
				Name = "Baboon",
				Location = new Location { Latitude = 44.73, Longitude = 11.15 },
				Details = "Baboons are African and Arabian Old World monkeys belonging to the genus Papio, part of the subfamily Cercopithecinae.",
				ImageUrl = "http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Papio_anubis_%28Serengeti%2C_2009%29.jpg/200px-Papio_anubis_%28Serengeti%2C_2009%29.jpg"
			});

			mypins.Add (new ExtendedPin () {
				Name = "Capuchin Monkey",
				Location = new Location { Latitude = 44.73, Longitude = 11.25 },
				Details = "The capuchin monkeys are New World monkeys of the subfamily Cebinae. Prior to 2011, the subfamily contained only a single genus, Cebus.",
				ImageUrl = "http://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Capuchin_Costa_Rica.jpg/200px-Capuchin_Costa_Rica.jpg"
			});

			map.UpdatePins (mypins);
			*/
			mypins = new List<ExtendedPin> ();
			this.mapCategories = new List<Categories> ();
			Categories closeMap = new Categories () {
				IDCategory = 0,
				IDMacroCategory = 0,
				MapImageFullPath = "testRestCompressed.Resources.reset_mappa_60.png"
			}; 
			this.mapCategories.Add (closeMap);

			if (this.isGeneralMap) {
				bindMap (0, null);
			} else {
				bindMap (0, null);

			}
			/*
			foreach (POIs myPoi in this.mapPOIs) {
				var currentPlatform = DependencyService.Get<platformSpecific> ();
				var path = Path.Combine (currentPlatform.getLocalDatabasePath (), "C");
				//Categories c = Global.K_Categories.First (x => x.IDCategory == this.idCategory);
				List<Categories_POIs> cp = Global.K_Categories_POIs.Where (x => x.IDPOI == myPoi.IDPOI).ToList ();
				Categories c = Global.K_Categories.First (x => x.IDCategory == cp [0].IDCategory); //take the first category
				path = Path.Combine (path, c.Icon3);
				c.MapImageFullPath = path;
				if (this.mapCategories.Contains (c) == false)
					this.mapCategories.Add (c);
				
				mypins.Add (new ExtendedPin () {
					Name = myPoi.NameOfThePOI,
					Location = new Location () {
						Latitude = Convert.ToDouble (myPoi.Latitude.Value),
						Longitude = Convert.ToDouble (myPoi.Longitude.Value)
					},
					Details = "",
					ImageUrl = path
				});
			}
			map.UpdatePins (mypins);
*/

			map.ShowDetailCommand = new Command (m => ShowDetail ((IMapModel)m));

			if (Device.OS == TargetPlatform.iOS) {

				map.callBackItemSelected += delegate(IMapModel obj) {
					ShowDetail (obj);

				};
			}

			//

			var cell = new DataTemplate (typeof(MapBarCell));

			//cell.SetBinding (TextCell.TextProperty, "Name");
			//cell.SetBinding (TextCell.DetailProperty, new Binding ("Position", stringFormat: "{0}"));
			//cell.SetBinding (ImageCell.ImageSourceProperty, "MapImageFullPath");


			l = new ListView {
				ItemsSource = this.mapCategories.OrderBy (x => x.IDMacroCategory),
				ItemTemplate = cell,
				RowHeight = 45,
				HorizontalOptions = LayoutOptions.CenterAndExpand,
				BackgroundColor = Color.Black,
				SeparatorVisibility = SeparatorVisibility.None,
			};
			l.ItemTapped += async delegate(object sender, ItemTappedEventArgs e) {
				l.SelectedItem = null;
				Int32 www = 0;
				Int32 catID = (e.Item as Categories).IDCategory;
				if (catID == 0) {
					if (this.isGeneralMap)
						catID = 0;
					else
						catID = -1;
				}
				bindMap (catID, this.drCurrent);
				Debug.WriteLine ("Catid: " + catID);
			};




			leftPanel = new StackLayout () {
				//BackgroundColor = Color.Red,
				HeightRequest = App.k_screenHMinusNavigationBarBottomBar,
				WidthRequest = Device.OnPlatform (App.k_screenW /*- ((App.k_screenW / 100) * 11)*/, App.k_screenW, App.k_screenW),
				Children = { map }
			};



			img = new Image () {
				Source = ImageSource.FromResource ("testRestCompressed.Resources.barraMappa.png"),
				//WidthRequest = 20,
				//HeightRequest = 20
				//BackgroundColor = Color.Yellow,
			};

			var mytap = new TapGestureRecognizer ();
			img.GestureRecognizers.Add (mytap);

			mytap.Tapped += async delegate {
				if (!iscollapsed) {
					if (Device.OS == TargetPlatform.Android) {
						await rightPanel.TranslateTo (this.rightPanelWDip, 0, 250, Easing.Linear);
						iscollapsed = true;
					}
					if (Device.OS == TargetPlatform.iOS) {
						rightPanel.TranslateTo (this.rightPanelWDip, 0, 250, Easing.Linear);
						img.TranslateTo (this.rightPanelWDip, 0, 250, Easing.Linear);
						iscollapsed = true;
					}
				} else {
					if (Device.OS == TargetPlatform.Android) {
						await rightPanel.TranslateTo (0, 0, 250, Easing.Linear);
						iscollapsed = false;
					}
					if (Device.OS == TargetPlatform.iOS) {
						rightPanel.TranslateTo (0, 0, 250, Easing.Linear);
						img.TranslateTo (0, 0, 250, Easing.Linear);
						iscollapsed = false;

					}
						
				}
			};


			/*
			ListView l = new ListView ();
			l.ItemsSource = new string[] {"uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno", "due", "uno"
				, "due"
			};
			l.BackgroundColor = Color.Yellow;
			*/

			rightPanel = new AbsoluteLayout () {
				//BackgroundColor = Color.Red,
//				WidthRequest = App.k_screenW,
				WidthRequest = Device.OnPlatform ((App.k_screenW / 100) * 11, App.k_screenW, App.k_screenW),
				HeightRequest = App.k_screenHMinusNavigationBarBottomBar,
//				Children =  { img, l }
			};
			if (Device.OS == TargetPlatform.Android) {
				rightPanel.Children.Add (img);
				rightPanel.Children.Add (l);
			}

			if (Device.OS == TargetPlatform.iOS) {
				rightPanel.Children.Add (l, new Point (0, 0));
				AbsoluteLayout.SetLayoutFlags (l, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (l, new Rectangle (0, 0, 1.0, 1.0));
			}

			if (Device.OS == TargetPlatform.Android) {
				AbsoluteLayout.SetLayoutFlags (l, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (l, new Rectangle (1.0, 0, 0.11, 1.0));

				AbsoluteLayout.SetLayoutFlags (img, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (img, new Rectangle (0.879, 0.1, 0.1, 0.1));
			}

			//0.879 = .89-(.1-0.089) ....0.089 is 89% of 0.1 hat is the image width
			this.mainPanel = new AbsoluteLayout ();
			mainPanel.Children.Add (leftPanel, new Point (0, 0));
			if (Device.OS == TargetPlatform.Android) {
				mainPanel.Children.Add (rightPanel, new Point (0, 0));
			}
			if (Device.OS == TargetPlatform.iOS) {
				mainPanel.Children.Add (rightPanel);

				AbsoluteLayout.SetLayoutFlags (rightPanel, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (rightPanel, new Rectangle (1.0, 0, 0.11, 1.0));
			
				mainPanel.Children.Add (img);
				AbsoluteLayout.SetLayoutFlags (img, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (img, new Rectangle (0.879, 0.1, 0.1, 0.1));

			}
			if (Device.OS == TargetPlatform.Android) {
				Content = this.mainPanel;
			}
			if (Device.OS == TargetPlatform.iOS) {
				/*
				rightPanel.BackgroundColor = Color.Transparent;
				this.mainPanel.RaiseChild (leftPanel);
				this.leftPanel.WidthRequest -= 70;
				*/
				//this.mainPanel.RaiseChild (leftPanel);
				rightPanel.BackgroundColor = Color.Red;
				Content = this.mainPanel;
				img.IsVisible = false;
			}
			this.leftPanel.IsVisible = false;
			this.rightPanel.IsVisible = false;
		}