1e41f4b71Sopenharmony_ci# Location Subsystem ChangeLog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.location.1 API Migration from @system.geolocation.d.ts to @ohos.geoLocationManager.d.ts 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciAPIs in **@system.geolocation.d.ts** do not support throwing error codes. To support this function, all APIs in **@system.geolocation.d.ts** are migrated to the newly added **@ohos.geoLocationManager.d.ts** file, and corresponding error code description is added. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciTo use APIs of the location subsystem, you need to import **@ohos.geoLocationManager**. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ciimport geoLocationManager from '@ohos.geoLocationManager'; 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**Change Impacts** 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ciAll APIs of the location subsystem are affected. To ensure normal use of these APIs, you need to import **@ohos.geoLocationManager**. 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ciimport geoLocationManager from '@ohos.geoLocationManager'; 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci**Key API/Component Changes** 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci| Class | API Type | Declaration | Change Type | 21e41f4b71Sopenharmony_ci| ----------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 22e41f4b71Sopenharmony_ci| Geolocation | class | Geolocation | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager**.| 23e41f4b71Sopenharmony_ci| Geolocation | interface | static getLocation(options?: GetLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.getCurrentLocation**.| 24e41f4b71Sopenharmony_ci| Geolocation | interface | static getLocationType(options?: GetLocationTypeOption): void; | Deprecated. | 25e41f4b71Sopenharmony_ci| Geolocation | interface | static subscribe(options: SubscribeLocationOption): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.on#event:locationChange**.| 26e41f4b71Sopenharmony_ci| Geolocation | interface | static unsubscribe(): void; | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.off#event:locationChange**.| 27e41f4b71Sopenharmony_ci| Geolocation | interface | static getSupportedCoordTypes(): Array<string>; | Deprecated. | 28e41f4b71Sopenharmony_ci| | interface | GeolocationResponse | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.Location**.| 29e41f4b71Sopenharmony_ci| | interface | GetLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest**.| 30e41f4b71Sopenharmony_ci| | interface | GetLocationTypeResponse | Deprecated. | 31e41f4b71Sopenharmony_ci| | interface | GetLocationTypeOption | Deprecated. | 32e41f4b71Sopenharmony_ci| | interface | SubscribeLocationOption | Migrated to **@ohos.geoLocationManager.d.ts** and replaced by **ohos.geoLocationManager/geoLocationManager.LocationRequest**.| 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci**(Optional) Adaptation Guide** 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ciThe following sample code shows how to call **enableLocation** in the new version: 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci ```ts 40e41f4b71Sopenharmony_ci import geoLocationManager from '@ohos.geoLocationManager'; 41e41f4b71Sopenharmony_ci try { 42e41f4b71Sopenharmony_ci geoLocationManager.enableLocation((err, data) => { 43e41f4b71Sopenharmony_ci if (err) { 44e41f4b71Sopenharmony_ci console.log('enableLocation: err=' + JSON.stringify(err)); 45e41f4b71Sopenharmony_ci } 46e41f4b71Sopenharmony_ci }); 47e41f4b71Sopenharmony_ci } catch (err) { 48e41f4b71Sopenharmony_ci console.error("errCode:" + err.code + ",errMessage:" + err.message); 49e41f4b71Sopenharmony_ci } 50e41f4b71Sopenharmony_ci ``` 51