コード例 #1
0
        private async void AddSite_Clicked(object sender, EventArgs e) // TODO: only allow for logged in users
        {
            AddSite addSite = new AddSite(database);
            await Navigation.PushAsync(addSite);

            addSite.Disappearing += (x, y) => {
                if (addSite.NewSite != null)
                {
                    addPin(addSite.NewSite);
                    SitesMap.MoveToRegion(MapSpan.FromCenterAndRadius(addSite.NewSite.Location, DEFAULT_ZOOM));
                }
            };
        }
コード例 #2
0
        private void refreshMap()
        {
            SitesMap.Pins.Clear();

            Site displaySite = null;

            foreach (Site site in database.getSites())
            {
                addPin(site);
                displaySite = site;
            }

            if (displaySite != null)
            {
                SitesMap.MoveToRegion(MapSpan.FromCenterAndRadius(displaySite.Location, DEFAULT_ZOOM));
            }
        }