harmony(鸿蒙)位置服务子系统JS API变更

2022-08-09 浏览 (711)

位置服务子系统JS API变更

OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,位置服务子系统的API变更如下:

接口变更

模块名类名方法/属性/枚举/常量变更类型
ohos.geolocationLocationCommandcommand: string;新增
ohos.geolocationLocationCommandscenario: LocationRequestScenario;新增
ohos.geolocationLocationPrivacyTypeCORE_LOCATION新增
ohos.geolocationLocationPrivacyTypeSTARTUP新增
ohos.geolocationLocationPrivacyTypeOTHERS = 0新增
ohos.geolocationGeoLocationErrorCodeLOCATION_REQUEST_TIMEOUT_ERROR新增
ohos.geolocationGeoLocationErrorCodeLAST_KNOWN_LOCATION_ERROR新增
ohos.geolocationGeoLocationErrorCodeLOCATION_SWITCH_ERROR新增
ohos.geolocationGeoLocationErrorCodeLOCATOR_ERROR新增
ohos.geolocationGeoLocationErrorCodeGEOCODE_ERROR新增
ohos.geolocationGeoLocationErrorCodeREVERSE_GEOCODE_ERROR新增
ohos.geolocationGeoLocationErrorCodeINPUT_PARAMS_ERROR = 101新增
ohos.geolocationLocationRequestScenarioNO_POWER新增
ohos.geolocationLocationRequestScenarioDAILY_LIFE_SERVICE新增
ohos.geolocationLocationRequestScenarioCAR_HAILING新增
ohos.geolocationLocationRequestScenarioTRAJECTORY_TRACKING新增
ohos.geolocationLocationRequestScenarioNAVIGATION新增
ohos.geolocationLocationRequestScenarioUNSET = 0x300新增
ohos.geolocationLocationRequestPriorityFIRST_FIX新增
ohos.geolocationLocationRequestPriorityLOW_POWER新增
ohos.geolocationLocationRequestPriorityACCURACY新增
ohos.geolocationLocationRequestPriorityUNSET = 0x200新增
ohos.geolocationLocationadditionSize?: number;新增
ohos.geolocationLocationadditions?: Array<string>;新增
ohos.geolocationLocationtimeSinceBoot: number;新增
ohos.geolocationLocationdirection: number;新增
ohos.geolocationLocationtimeStamp: number;新增
ohos.geolocationLocationspeed: number;新增
ohos.geolocationLocationaccuracy: number;新增
ohos.geolocationLocationaltitude: number;新增
ohos.geolocationLocationlongitude: number;新增
ohos.geolocationLocationlatitude: number;新增
ohos.geolocationCurrentLocationRequesttimeoutMs?: number;新增
ohos.geolocationCurrentLocationRequestmaxAccuracy?: number;新增
ohos.geolocationCurrentLocationRequestscenario?: LocationRequestScenario;新增
ohos.geolocationCurrentLocationRequestpriority?: LocationRequestPriority;新增
ohos.geolocationLocationRequestmaxAccuracy?: number;新增
ohos.geolocationLocationRequestdistanceInterval?: number;新增
ohos.geolocationLocationRequesttimeInterval?: number;新增
ohos.geolocationLocationRequestscenario?: LocationRequestScenario;新增
ohos.geolocationLocationRequestpriority?: LocationRequestPriority;新增
ohos.geolocationGeoAddressdescriptionsSize?: number;新增
ohos.geolocationGeoAddressdescriptions?: Array<string>;新增
ohos.geolocationGeoAddressaddressUrl?: string;新增
ohos.geolocationGeoAddressphoneNumber?: string;新增
ohos.geolocationGeoAddresspostalCode?: string;新增
ohos.geolocationGeoAddresspremises?: string;新增
ohos.geolocationGeoAddresssubRoadName?: string;新增
ohos.geolocationGeoAddressroadName?: string;新增
ohos.geolocationGeoAddresssubLocality?: string;新增
ohos.geolocationGeoAddresslocality?: string;新增
ohos.geolocationGeoAddresssubAdministrativeArea?: string;新增
ohos.geolocationGeoAddressadministrativeArea?: string;新增
ohos.geolocationGeoAddresscountryName?: string;新增
ohos.geolocationGeoAddresscountryCode?: string;新增
ohos.geolocationGeoAddressplaceName?: string;新增
ohos.geolocationGeoAddresslocale?: string;新增
ohos.geolocationGeoAddresslongitude?: number;新增
ohos.geolocationGeoAddresslatitude?: number;新增
ohos.geolocationGeoCodeRequestmaxLongitude?: number;新增
ohos.geolocationGeoCodeRequestmaxLatitude?: number;新增
ohos.geolocationGeoCodeRequestminLongitude?: number;新增
ohos.geolocationGeoCodeRequestminLatitude?: number;新增
ohos.geolocationGeoCodeRequestmaxItems?: number;新增
ohos.geolocationGeoCodeRequestdescription: string;新增
ohos.geolocationGeoCodeRequestlocale?: string;新增
ohos.geolocationReverseGeoCodeRequestmaxItems?: number;新增
ohos.geolocationReverseGeoCodeRequestlongitude: number;新增
ohos.geolocationReverseGeoCodeRequestlatitude: number;新增
ohos.geolocationReverseGeoCodeRequestlocale?: string;新增
ohos.geolocationGeofenceexpiration: number;新增
ohos.geolocationGeofenceradius: number;新增
ohos.geolocationGeofencelongitude: number;新增
ohos.geolocationGeofencelatitude: number;新增
ohos.geolocationGeofenceRequestgeofence: Geofence;新增
ohos.geolocationGeofenceRequestscenario: LocationRequestScenario;新增
ohos.geolocationGeofenceRequestpriority: LocationRequestPriority;新增
ohos.geolocationCachedGnssLocationsRequestwakeUpCacheQueueFull: boolean;新增
ohos.geolocationCachedGnssLocationsRequestreportingPeriodSec: number;新增
ohos.geolocationSatelliteStatusInfocarrierFrequencies: Array<number>;新增
ohos.geolocationSatelliteStatusInfoazimuths: Array<number>;新增
ohos.geolocationSatelliteStatusInfoaltitudes: Array<number>;新增
ohos.geolocationSatelliteStatusInfocarrierToNoiseDensitys: Array<number>;新增
ohos.geolocationSatelliteStatusInfosatelliteIds: Array<number>;新增
ohos.geolocationSatelliteStatusInfosatellitesNumber: number;新增
ohos.geolocationgeolocationsendCommand(command: LocationCommand, callback: AsyncCallback<boolean>) : void;
sendCommand(command: LocationCommand) : Promise<boolean>;
新增
ohos.geolocationgeolocationflushCachedGnssLocations(callback: AsyncCallback<boolean>) : void;
flushCachedGnssLocations() : Promise<boolean>;
新增
ohos.geolocationgeolocationgetCachedGnssLocationsSize(callback: AsyncCallback<number>) : void;
getCachedGnssLocationsSize() : Promise<number>;
新增
ohos.geolocationgeolocationisGeoServiceAvailable(callback: AsyncCallback<boolean>) : void;
isGeoServiceAvailable() : Promise<boolean>;
新增
ohos.geolocationgeolocationgetAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void;
getAddressesFromLocationName(request: GeoCodeRequest) : Promise<Array<GeoAddress>>;
新增
ohos.geolocationgeolocationgetAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void;
getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise<Array<GeoAddress>>;
新增
ohos.geolocationgeolocationrequestEnableLocation(callback: AsyncCallback<boolean>) : void;
requestEnableLocation() : Promise<boolean>;
新增
ohos.geolocationgeolocationisLocationEnabled(callback: AsyncCallback<boolean>) : void;
isLocationEnabled() : Promise<boolean>;
新增
ohos.geolocationgeolocationgetLastLocation(callback: AsyncCallback<Location>) : void;
getLastLocation() : Promise<Location>;
新增
ohos.geolocationgeolocationgetCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>) : void;
getCurrentLocation(callback: AsyncCallback<Location>) : void;
getCurrentLocation(request?: CurrentLocationRequest) : Promise<Location>;
新增
ohos.geolocationgeolocationoff(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void;新增
ohos.geolocationgeolocationon(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void;新增
ohos.geolocationgeolocationoff(type: 'nmeaMessageChange', callback?: Callback<string>) : void;新增
ohos.geolocationgeolocationon(type: 'nmeaMessageChange', callback: Callback<string>) : void;新增
ohos.geolocationgeolocationoff(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>) : void;新增
ohos.geolocationgeolocationon(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>) : void;新增
ohos.geolocationgeolocationoff(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>) : void;新增
ohos.geolocationgeolocationon(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>) : void;新增
ohos.geolocationgeolocationoff(type: 'locationServiceState', callback?: Callback<boolean>) : void;新增
ohos.geolocationgeolocationon(type: 'locationServiceState', callback: Callback<boolean>) : void;新增
ohos.geolocationgeolocationoff(type: 'locationChange', callback?: Callback<Location>) : void;新增
ohos.geolocationgeolocationon(type: 'locationChange', request: LocationRequest, callback: Callback<Location>) : void;新增

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Readme

harmony(鸿蒙)3.1 release相对于3.1 beta变更详细说明

harmony(鸿蒙)元能力子系统JS API变更

harmony(鸿蒙)元能力子系统JS API变更

harmony(鸿蒙)无障碍子系统JS API变更

harmony(鸿蒙)帐号子系统JS API变更

harmony(鸿蒙)ArkUI子系统JS API变更

harmony(鸿蒙)电源服务子系统JS API变更

harmony(鸿蒙)包管理子系统JS API变更

harmony(鸿蒙)包管理子系统JS API变更

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