# 位置服务子系统JS API变更 OpenHarmony 3.2 Beta2版本相较于OpenHarmony 3.2 Beta1版本,位置服务子系统的API变更如下: ## 接口变更 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| | ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_NETWORK | 新增 | | ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_LOCATION | 新增 | | ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_SIM | 新增 | | ohos.geolocation | CountryCodeType | COUNTRY_CODE_FROM_LOCALE = 1 | 新增 | | ohos.geolocation | CountryCode | type: CountryCodeType; | 新增 | | ohos.geolocation | CountryCode | country: string; | 新增 | | ohos.geolocation | GeoLocationErrorCode | QUERY_COUNTRY_CODE_ERROR | 新增 | | ohos.geolocation | GeoLocationErrorCode | NOT_SUPPORTED = 100 | 新增 | | ohos.geolocation | Location | isFromMock: Boolean; | 新增 | | ohos.geolocation | GeoAddress | isFromMock: Boolean; | 新增 | | ohos.geolocation | LocationMockConfig | locations: Array\; | 新增 | | ohos.geolocation | LocationMockConfig | timeInterval: number; | 新增 | | ohos.geolocation | ReverseGeocodingMockInfo | geoAddress: GeoAddress; | 新增 | | ohos.geolocation | ReverseGeocodingMockInfo | location: ReverseGeoCodeRequest; | 新增 | | ohos.geolocation | geolocation | setReverseGeocodingMockInfo(mockInfos: Array\, callback: AsyncCallback\) : void;
setReverseGeocodingMockInfo(mockInfos: Array\) : Promise\; | 新增 | | ohos.geolocation | geolocation | disableReverseGeocodingMock(callback: AsyncCallback\) : void;
disableReverseGeocodingMock() : Promise\; | 新增 | | ohos.geolocation | geolocation | enableReverseGeocodingMock(callback: AsyncCallback\) : void;
enableReverseGeocodingMock() : Promise\; | 新增 | | ohos.geolocation | geolocation | setMockedLocations(config: LocationMockConfig, callback: AsyncCallback\) : void;
setMockedLocations(config: LocationMockConfig) : Promise\; | 新增 | | ohos.geolocation | geolocation | disableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback\) : void;
disableLocationMock(scenario?: LocationRequestScenario) : Promise\; | 新增 | | ohos.geolocation | geolocation | enableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback\) : void;
enableLocationMock(scenario?: LocationRequestScenario) : Promise\; | 新增 | | ohos.geolocation | geolocation | getCountryCode(callback: AsyncCallback\) : void;
getCountryCode() : Promise\; | 新增 | | ohos.geolocation | geolocation | off(type: 'countryCodeChange', callback?: Callback\) : void; | 新增 | | ohos.geolocation | geolocation | on(type: 'countryCodeChange', callback: Callback\) : void; | 新增 |