private bool OnTimerTick()
        {
            Task.Run(async() =>
            {
                Items.Clear();
                Items = await RefreshDataAsync();
                PinCollection.Clear();

                if (SelectedBus != null)
                {
                    var qw = Items.Where(n => n.BusNumber == SelectedBus);
                    foreach (var item in qw)
                    {
                        PinCollection.Add(new Pin()
                        {
                            Position = new Position(item.Latitude, item.Longitude), Type = PinType.Generic, Label = item.BusNumber
                        });
                    }
                }
                else
                {
                    foreach (var item in Items)
                    {
                        PinCollection.Add(new Pin()
                        {
                            Position = new Position(item.Latitude, item.Longitude), Type = PinType.Generic, Label = item.BusNumber
                        });
                    }
                }
            });

            return(true);
        }
 private void UpdateMap(double latitude, double longitude)
 {
     PinCollection.Clear();
     MyPosition = new Xamarin.Forms.Maps.Position(latitude, longitude);
     PinCollection.Add(new Pin()
     {
         Position = MyPosition, Type = PinType.Generic, Label = _selectedAsar.AsarName
     });
 }
Beispiel #3
0
 internal void UpdateMapPins()
 {
     PinCollection.Clear();
     foreach (var f in FugitiveCollection)
     {
         PinCollection.Add(new ColouredMapPin()
         {
             Position = f.Position,
             Label    = f.Username,
             Type     = PinType.Generic,
             Colour   = f.Colour
         });
     }
 }
Beispiel #4
0
        void onInputTypeChanged(bool wasInput, bool isInput)
        {
            var pin = PinCollection.Get("Value");

            if (pin != null)
            {
                Pin.Disconnect(pin);
            }

            PinCollection.Clear();
            if (IsInput)
            {
                PinCollection.AddInput("Value", Type);
            }
            else
            {
                PinCollection.AddOutput("Value", Type);
            }
        }
        void onInputTypeChanged(bool wasInput, bool isInput)
        {
            string removeName = (IsInput) ? "OUT" : "IN";
            var    pin        = PinCollection.Get(removeName);

            if (pin != null)
            {
                Pin.Disconnect(pin);
            }

            PinCollection.Clear();
            if (IsInput)
            {
                PinCollection.AddInTransition("IN");
            }
            else
            {
                PinCollection.AddOutTransition("OUT");
            }
        }