harmony(鸿蒙)JS API Changes of the Location Subsystem

2022-08-09 浏览 (675)

JS API Changes of the Location Subsystem

The table below lists the APIs changes of the location subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.

API Changes

ModuleClassMethod/Attribute/Enumeration/ConstantChange Type
ohos.geolocationLocationCommandcommand: string;Added
ohos.geolocationLocationCommandscenario: LocationRequestScenario;Added
ohos.geolocationLocationPrivacyTypeCORE_LOCATIONAdded
ohos.geolocationLocationPrivacyTypeSTARTUPAdded
ohos.geolocationLocationPrivacyTypeOTHERS = 0Added
ohos.geolocationGeoLocationErrorCodeLOCATION_REQUEST_TIMEOUT_ERRORAdded
ohos.geolocationGeoLocationErrorCodeLAST_KNOWN_LOCATION_ERRORAdded
ohos.geolocationGeoLocationErrorCodeLOCATION_SWITCH_ERRORAdded
ohos.geolocationGeoLocationErrorCodeLOCATOR_ERRORAdded
ohos.geolocationGeoLocationErrorCodeGEOCODE_ERRORAdded
ohos.geolocationGeoLocationErrorCodeREVERSE_GEOCODE_ERRORAdded
ohos.geolocationGeoLocationErrorCodeINPUT_PARAMS_ERROR = 101Added
ohos.geolocationLocationRequestScenarioNO_POWERAdded
ohos.geolocationLocationRequestScenarioDAILY_LIFE_SERVICEAdded
ohos.geolocationLocationRequestScenarioCAR_HAILINGAdded
ohos.geolocationLocationRequestScenarioTRAJECTORY_TRACKINGAdded
ohos.geolocationLocationRequestScenarioNAVIGATIONAdded
ohos.geolocationLocationRequestScenarioUNSET = 0x300Added
ohos.geolocationLocationRequestPriorityFIRST_FIXAdded
ohos.geolocationLocationRequestPriorityLOW_POWERAdded
ohos.geolocationLocationRequestPriorityACCURACYAdded
ohos.geolocationLocationRequestPriorityUNSET = 0x200Added
ohos.geolocationLocationadditionSize?: number;Added
ohos.geolocationLocationadditions?: Array<string>;Added
ohos.geolocationLocationtimeSinceBoot: number;Added
ohos.geolocationLocationdirection: number;Added
ohos.geolocationLocationtimeStamp: number;Added
ohos.geolocationLocationspeed: number;Added
ohos.geolocationLocationaccuracy: number;Added
ohos.geolocationLocationaltitude: number;Added
ohos.geolocationLocationlongitude: number;Added
ohos.geolocationLocationlatitude: number;Added
ohos.geolocationCurrentLocationRequesttimeoutMs?: number;Added
ohos.geolocationCurrentLocationRequestmaxAccuracy?: number;Added
ohos.geolocationCurrentLocationRequestscenario?: LocationRequestScenario;Added
ohos.geolocationCurrentLocationRequestpriority?: LocationRequestPriority;Added
ohos.geolocationLocationRequestmaxAccuracy?: number;Added
ohos.geolocationLocationRequestdistanceInterval?: number;Added
ohos.geolocationLocationRequesttimeInterval?: number;Added
ohos.geolocationLocationRequestscenario?: LocationRequestScenario;Added
ohos.geolocationLocationRequestpriority?: LocationRequestPriority;Added
ohos.geolocationGeoAddressdescriptionsSize?: number;Added
ohos.geolocationGeoAddressdescriptions?: Array<string>;Added
ohos.geolocationGeoAddressaddressUrl?: string;Added
ohos.geolocationGeoAddressphoneNumber?: string;Added
ohos.geolocationGeoAddresspostalCode?: string;Added
ohos.geolocationGeoAddresspremises?: string;Added
ohos.geolocationGeoAddresssubRoadName?: string;Added
ohos.geolocationGeoAddressroadName?: string;Added
ohos.geolocationGeoAddresssubLocality?: string;Added
ohos.geolocationGeoAddresslocality?: string;Added
ohos.geolocationGeoAddresssubAdministrativeArea?: string;Added
ohos.geolocationGeoAddressadministrativeArea?: string;Added
ohos.geolocationGeoAddresscountryName?: string;Added
ohos.geolocationGeoAddresscountryCode?: string;Added
ohos.geolocationGeoAddressplaceName?: string;Added
ohos.geolocationGeoAddresslocale?: string;Added
ohos.geolocationGeoAddresslongitude?: number;Added
ohos.geolocationGeoAddresslatitude?: number;Added
ohos.geolocationGeoCodeRequestmaxLongitude?: number;Added
ohos.geolocationGeoCodeRequestmaxLatitude?: number;Added
ohos.geolocationGeoCodeRequestminLongitude?: number;Added
ohos.geolocationGeoCodeRequestminLatitude?: number;Added
ohos.geolocationGeoCodeRequestmaxItems?: number;Added
ohos.geolocationGeoCodeRequestdescription: string;Added
ohos.geolocationGeoCodeRequestlocale?: string;Added
ohos.geolocationReverseGeoCodeRequestmaxItems?: number;Added
ohos.geolocationReverseGeoCodeRequestlongitude: number;Added
ohos.geolocationReverseGeoCodeRequestlatitude: number;Added
ohos.geolocationReverseGeoCodeRequestlocale?: string;Added
ohos.geolocationGeofenceexpiration: number;Added
ohos.geolocationGeofenceradius: number;Added
ohos.geolocationGeofencelongitude: number;Added
ohos.geolocationGeofencelatitude: number;Added
ohos.geolocationGeofenceRequestgeofence: Geofence;Added
ohos.geolocationGeofenceRequestscenario: LocationRequestScenario;Added
ohos.geolocationGeofenceRequestpriority: LocationRequestPriority;Added
ohos.geolocationCachedGnssLocationsRequestwakeUpCacheQueueFull: boolean;Added
ohos.geolocationCachedGnssLocationsRequestreportingPeriodSec: number;Added
ohos.geolocationSatelliteStatusInfocarrierFrequencies: Array<number>;Added
ohos.geolocationSatelliteStatusInfoazimuths: Array<number>;Added
ohos.geolocationSatelliteStatusInfoaltitudes: Array<number>;Added
ohos.geolocationSatelliteStatusInfocarrierToNoiseDensitys: Array<number>;Added
ohos.geolocationSatelliteStatusInfosatelliteIds: Array<number>;Added
ohos.geolocationSatelliteStatusInfosatellitesNumber: number;Added
ohos.geolocationgeolocationsendCommand(command: LocationCommand, callback: AsyncCallback<boolean>) : void;
sendCommand(command: LocationCommand) : Promise<boolean>;
Added
ohos.geolocationgeolocationflushCachedGnssLocations(callback: AsyncCallback<boolean>) : void;
flushCachedGnssLocations() : Promise<boolean>;
Added
ohos.geolocationgeolocationgetCachedGnssLocationsSize(callback: AsyncCallback<number>) : void;
getCachedGnssLocationsSize() : Promise<number>;
Added
ohos.geolocationgeolocationisGeoServiceAvailable(callback: AsyncCallback<boolean>) : void;
isGeoServiceAvailable() : Promise<boolean>;
Added
ohos.geolocationgeolocationgetAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void;
getAddressesFromLocationName(request: GeoCodeRequest) : Promise<Array<GeoAddress>>;
Added
ohos.geolocationgeolocationgetAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void;
getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise<Array<GeoAddress>>;
Added
ohos.geolocationgeolocationrequestEnableLocation(callback: AsyncCallback<boolean>) : void;
requestEnableLocation() : Promise<boolean>;
Added
ohos.geolocationgeolocationisLocationEnabled(callback: AsyncCallback<boolean>) : void;
isLocationEnabled() : Promise<boolean>;
Added
ohos.geolocationgeolocationgetLastLocation(callback: AsyncCallback<Location>) : void;
getLastLocation() : Promise<Location>;
Added
ohos.geolocationgeolocationgetCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>) : void;
getCurrentLocation(callback: AsyncCallback<Location>) : void;
getCurrentLocation(request?: CurrentLocationRequest) : Promise<Location>;
Added
ohos.geolocationgeolocationoff(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void;Added
ohos.geolocationgeolocationon(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void;Added
ohos.geolocationgeolocationoff(type: 'nmeaMessageChange', callback?: Callback<string>) : void;Added
ohos.geolocationgeolocationon(type: 'nmeaMessageChange', callback: Callback<string>) : void;Added
ohos.geolocationgeolocationoff(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>) : void;Added
ohos.geolocationgeolocationon(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>) : void;Added
ohos.geolocationgeolocationoff(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>) : void;Added
ohos.geolocationgeolocationon(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>) : void;Added
ohos.geolocationgeolocationoff(type: 'locationServiceState', callback?: Callback<boolean>) : void;Added
ohos.geolocationgeolocationon(type: 'locationServiceState', callback: Callback<boolean>) : void;Added
ohos.geolocationgeolocationoff(type: 'locationChange', callback?: Callback<Location>) : void;Added
ohos.geolocationgeolocationon(type: 'locationChange', request: LocationRequest, callback: Callback<Location>) : void;Added

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Readme

harmony(鸿蒙)Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)

harmony(鸿蒙)JS API Changes of the Ability Framework

harmony(鸿蒙)JS API Changes of the Accessibility Subsystem

harmony(鸿蒙)JS API Changes of the Account Subsystem

harmony(鸿蒙)JS API Changes of the ArkUI Development Framework

harmony(鸿蒙)JS API Changes of the Power Management Subsystem

harmony(鸿蒙)JS API Changes of the Bundle Management Framework

harmony(鸿蒙)JS API Changes of the Communication Subsystem

harmony(鸿蒙)JS API Changes of the Utils Subsystem

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/d00cf3cf53624e4ba31ada1e8df17531