1# 位置服务子系统JS API变更 2 3OpenHarmony 3.2 Beta2版本相较于OpenHarmony 3.2 Beta1版本,位置服务子系统的API变更如下: 4 5## 接口变更 6 7| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | 8|---|---|---|---| 9| ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_NETWORK | 新增 | 10| ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_LOCATION | 新增 | 11| ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_SIM | 新增 | 12| ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_LOCALE = 1 | 新增 | 13| ohos.geolocation | CountryCode | type: CountryCodeType; | 新增 | 14| ohos.geolocation | CountryCode | country: string; | 新增 | 15| ohos.geolocation | GeoLocationErrorCode | QUERY_COUNTRY_CODE_ERROR | 新增 | 16| ohos.geolocation | GeoLocationErrorCode | NOT_SUPPORTED = 100 | 新增 | 17| ohos.geolocation | Location | isFromMock: Boolean; | 新增 | 18| ohos.geolocation | GeoAddress | isFromMock: Boolean; | 新增 | 19| ohos.geolocation | LocationMockConfig | locations: Array\<Location>; | 新增 | 20| ohos.geolocation | LocationMockConfig | timeInterval: number; | 新增 | 21| ohos.geolocation | ReverseGeocodingMockInfo | geoAddress: GeoAddress; | 新增 | 22| ohos.geolocation | ReverseGeocodingMockInfo | location: ReverseGeoCodeRequest; | 新增 | 23| ohos.geolocation | geolocation | setReverseGeocodingMockInfo(mockInfos: Array\<ReverseGeocodingMockInfo>, callback: AsyncCallback\<void>) : void;<br>setReverseGeocodingMockInfo(mockInfos: Array\<ReverseGeocodingMockInfo>) : Promise\<void>; | 新增 | 24| ohos.geolocation | geolocation | disableReverseGeocodingMock(callback: AsyncCallback\<void>) : void;<br>disableReverseGeocodingMock() : Promise\<void>; | 新增 | 25| ohos.geolocation | geolocation | enableReverseGeocodingMock(callback: AsyncCallback\<void>) : void;<br>enableReverseGeocodingMock() : Promise\<void>; | 新增 | 26| ohos.geolocation | geolocation | setMockedLocations(config: LocationMockConfig, callback: AsyncCallback\<void>) : void;<br>setMockedLocations(config: LocationMockConfig) : Promise\<void>; | 新增 | 27| ohos.geolocation | geolocation | disableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback\<void>) : void;<br>disableLocationMock(scenario?: LocationRequestScenario) : Promise\<void>; | 新增 | 28| ohos.geolocation | geolocation | enableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback\<void>) : void;<br>enableLocationMock(scenario?: LocationRequestScenario) : Promise\<void>; | 新增 | 29| ohos.geolocation | geolocation | getCountryCode(callback: AsyncCallback\<CountryCode>) : void;<br>getCountryCode() : Promise\<CountryCode>; | 新增 | 30| ohos.geolocation | geolocation | off(type: 'countryCodeChange', callback?: Callback\<CountryCode>) : void; | 新增 | 31| ohos.geolocation | geolocation | on(type: 'countryCodeChange', callback: Callback\<CountryCode>) : void; | 新增 | 32 33