コード例 #1
0
ファイル: ExtMap.cs プロジェクト: rishikabhatia97/Carpool
        protected virtual void OnTap(MapTapEventArgs e)
        {
            var handler = Tapped;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
        private async void MyMap_Tapped(object sender, MapTapEventArgs e)
        {
            if (pinFlag == false)
            {
                infoLabel.Text = "Adding starting point";
                pinFlag        = true;
                var latitude  = e.Position.Latitude;
                var longitude = e.Position.Longitude;

                var position = new Position(latitude, longitude);

                var pin = new Pin
                {
                    Type     = PinType.Place,
                    Position = position,
                    Label    = "Start",
                    Address  = "",
                };

                myMap.Pins.Add(pin);

                var saveButton = new ToolbarItem
                {
                    Name    = "Save",
                    Command = new Command(this.Save),
                };

                var cancelButton = new ToolbarItem
                {
                    Name    = "Cancel",
                    Command = new Command(this.Cancel),
                };

                this.ToolbarItems.Add(saveButton);
                this.ToolbarItems.Add(cancelButton);

                infoLabel.Text = "";
            }
        }