コード例 #1
0
        public async Task <Pin> LoadPin()
        {
            Position p = _GeoCodingService.NullPosition;

            var address = Account.AddressString;

            //Lookup Lat/Long all the time unless an account where the address is read-only
            //TODO: Only look up if no value, or if address properties have changed.
            //if (Contact.Latitude == 0)
            if (Account.IsLead)
            {
                p = await _GeoCodingService.GeoCodeAddress(address);

                Account.Latitude  = p.Latitude;
                Account.Longitude = p.Longitude;
            }
            else
            {
                p = new Position(Account.Latitude, Account.Longitude);
            }

            var pin = new Pin
            {
                Type     = PinType.Place,
                Position = p,
                Label    = Account.Company,
                Address  = address
            };

            return(pin);
        }
コード例 #2
0
        public async Task <Pin> LoadPin()
        {
            Position p       = _GeoCodingService.NullPosition;
            var      address = Lead.AddressString;

            //Lookup Lat/Long all the time.
            //TODO: Only look up if no value, or if address properties have changed.
            //if (Contact.Latitude == 0)
            if (true)
            {
                p = await _GeoCodingService.GeoCodeAddress(address);

                //p = p == null ? Utils.NullPosition : p;

                Lead.Latitude  = p.Latitude;
                Lead.Longitude = p.Longitude;
            }

            var pin = new Pin
            {
                Type     = PinType.Place,
                Position = p,
                Label    = Lead.DisplayName,
                Address  = address
            };

            return(pin);
        }