Ejemplo n.º 1
0
        private void handleABC(BMKLocation location, BMKLocationKitIdfa_Structs.BMKLocationNetworkState networkState, NSError error)
        {
            if (error != null)
            {
                string errorMsg = "[{0}]{1}".FormatWith(error.Code, error.LocalizedDescription);
                System.Diagnostics.Debug.WriteLine(errorMsg);
            }

            Client.Common.LBSModel r = null;

            //r = new Common.LBSModel
            //(
            //    _GPSInfoType: tmpGPSInfoType,
            //    _Latitude: location.Location.Coordinate.Latitude.ToString(),
            //    _Longitude: location.Location.Coordinate.Longitude.ToString(),
            //    _Radius: location.Radius.ToString(),
            //    _Address: location.AddrStr,
            //    _LocationDescribe: location.LocationDescribe
            //);

            r = new Common.LBSModel
                (
                _GPSInfoType: "", // tmpGPSInfoType,
                _Latitude: location.Location.Coordinate.Latitude.ToString(),
                _Longitude: location.Location.Coordinate.Longitude.ToString(),
                _Radius: "",          // location.Radius.ToString(),
                _Address: "",         // location.AddrStr,
                _LocationDescribe: "" // location.LocationDescribe
                );

            Client.Common.LBS.OnGetGPSInfo(r);
        }
Ejemplo n.º 2
0
        public void LocationsUpdated(BMKLocation r_Location, CLLocation[] locations)
        {
            var location = locations.LastOrDefault();

            if (location != null)
            {
                // altitudeLabel.Text = $"{location.Altitude} meters";
                // lblLongitude.Text = "Lng:{0}º".FormatWith(location.Coordinate.Longitude);
                // lblLatitude.Text = "Lat:{0}º".FormatWith(location.Coordinate.Latitude);
                // courseLabel.Text = $"{location.Course}º";
                // speedLabel.Text = $"{location.Speed} meters/s";

                // get the distance from here to paris
                //distanceLabel.Text = $"{location.DistanceFrom(new CLLocation(48.857, 2.351)) / 1000} km";



                Client.Common.LBSModel r = null;

                r = new Common.LBSModel
                    (
                    _GPSInfoType: string.Empty,
                    _Latitude: location.Coordinate.Latitude.ToString(),
                    _Longitude: location.Coordinate.Longitude.ToString(),
                    _Radius: string.Empty,          // location.Radius.ToString(),
                    _Address: string.Empty,         // location.AddrStr,
                    _LocationDescribe: string.Empty //location.LocationDescribe
                    );

                Client.Common.LBS.OnGetGPSInfo(r);
            }
        }