1# JS API Changes of the Location Subsystem 2 3The table below lists the APIs changes of the location subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS. 4 5## API Changes 6 7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| 8|---|---|---|---| 9| ohos.geolocation | LocationCommand | command: string; | Added| 10| ohos.geolocation | LocationCommand | scenario: LocationRequestScenario; | Added| 11| ohos.geolocation | LocationPrivacyType | CORE_LOCATION | Added| 12| ohos.geolocation | LocationPrivacyType | STARTUP | Added| 13| ohos.geolocation | LocationPrivacyType | OTHERS = 0 | Added| 14| ohos.geolocation | GeoLocationErrorCode | LOCATION_REQUEST_TIMEOUT_ERROR | Added| 15| ohos.geolocation | GeoLocationErrorCode | LAST_KNOWN_LOCATION_ERROR | Added| 16| ohos.geolocation | GeoLocationErrorCode | LOCATION_SWITCH_ERROR | Added| 17| ohos.geolocation | GeoLocationErrorCode | LOCATOR_ERROR | Added| 18| ohos.geolocation | GeoLocationErrorCode | GEOCODE_ERROR | Added| 19| ohos.geolocation | GeoLocationErrorCode | REVERSE_GEOCODE_ERROR | Added| 20| ohos.geolocation | GeoLocationErrorCode | INPUT_PARAMS_ERROR = 101 | Added| 21| ohos.geolocation | LocationRequestScenario | NO_POWER | Added| 22| ohos.geolocation | LocationRequestScenario | DAILY_LIFE_SERVICE | Added| 23| ohos.geolocation | LocationRequestScenario | CAR_HAILING | Added| 24| ohos.geolocation | LocationRequestScenario | TRAJECTORY_TRACKING | Added| 25| ohos.geolocation | LocationRequestScenario | NAVIGATION | Added| 26| ohos.geolocation | LocationRequestScenario | UNSET = 0x300 | Added| 27| ohos.geolocation | LocationRequestPriority | FIRST_FIX | Added| 28| ohos.geolocation | LocationRequestPriority | LOW_POWER | Added| 29| ohos.geolocation | LocationRequestPriority | ACCURACY | Added| 30| ohos.geolocation | LocationRequestPriority | UNSET = 0x200 | Added| 31| ohos.geolocation | Location | additionSize?: number; | Added| 32| ohos.geolocation | Location | additions?: Array\<string>; | Added| 33| ohos.geolocation | Location | timeSinceBoot: number; | Added| 34| ohos.geolocation | Location | direction: number; | Added| 35| ohos.geolocation | Location | timeStamp: number; | Added| 36| ohos.geolocation | Location | speed: number; | Added| 37| ohos.geolocation | Location | accuracy: number; | Added| 38| ohos.geolocation | Location | altitude: number; | Added| 39| ohos.geolocation | Location | longitude: number; | Added| 40| ohos.geolocation | Location | latitude: number; | Added| 41| ohos.geolocation | CurrentLocationRequest | timeoutMs?: number; | Added| 42| ohos.geolocation | CurrentLocationRequest | maxAccuracy?: number; | Added| 43| ohos.geolocation | CurrentLocationRequest | scenario?: LocationRequestScenario; | Added| 44| ohos.geolocation | CurrentLocationRequest | priority?: LocationRequestPriority; | Added| 45| ohos.geolocation | LocationRequest | maxAccuracy?: number; | Added| 46| ohos.geolocation | LocationRequest | distanceInterval?: number; | Added| 47| ohos.geolocation | LocationRequest | timeInterval?: number; | Added| 48| ohos.geolocation | LocationRequest | scenario?: LocationRequestScenario; | Added| 49| ohos.geolocation | LocationRequest | priority?: LocationRequestPriority; | Added| 50| ohos.geolocation | GeoAddress | descriptionsSize?: number; | Added| 51| ohos.geolocation | GeoAddress | descriptions?: Array\<string>; | Added| 52| ohos.geolocation | GeoAddress | addressUrl?: string; | Added| 53| ohos.geolocation | GeoAddress | phoneNumber?: string; | Added| 54| ohos.geolocation | GeoAddress | postalCode?: string; | Added| 55| ohos.geolocation | GeoAddress | premises?: string; | Added| 56| ohos.geolocation | GeoAddress | subRoadName?: string; | Added| 57| ohos.geolocation | GeoAddress | roadName?: string; | Added| 58| ohos.geolocation | GeoAddress | subLocality?: string; | Added| 59| ohos.geolocation | GeoAddress | locality?: string; | Added| 60| ohos.geolocation | GeoAddress | subAdministrativeArea?: string; | Added| 61| ohos.geolocation | GeoAddress | administrativeArea?: string; | Added| 62| ohos.geolocation | GeoAddress | countryName?: string; | Added| 63| ohos.geolocation | GeoAddress | countryCode?: string; | Added| 64| ohos.geolocation | GeoAddress | placeName?: string; | Added| 65| ohos.geolocation | GeoAddress | locale?: string; | Added| 66| ohos.geolocation | GeoAddress | longitude?: number; | Added| 67| ohos.geolocation | GeoAddress | latitude?: number; | Added| 68| ohos.geolocation | GeoCodeRequest | maxLongitude?: number; | Added| 69| ohos.geolocation | GeoCodeRequest | maxLatitude?: number; | Added| 70| ohos.geolocation | GeoCodeRequest | minLongitude?: number; | Added| 71| ohos.geolocation | GeoCodeRequest | minLatitude?: number; | Added| 72| ohos.geolocation | GeoCodeRequest | maxItems?: number; | Added| 73| ohos.geolocation | GeoCodeRequest | description: string; | Added| 74| ohos.geolocation | GeoCodeRequest | locale?: string; | Added| 75| ohos.geolocation | ReverseGeoCodeRequest | maxItems?: number; | Added| 76| ohos.geolocation | ReverseGeoCodeRequest | longitude: number; | Added| 77| ohos.geolocation | ReverseGeoCodeRequest | latitude: number; | Added| 78| ohos.geolocation | ReverseGeoCodeRequest | locale?: string; | Added| 79| ohos.geolocation | Geofence | expiration: number; | Added| 80| ohos.geolocation | Geofence | radius: number; | Added| 81| ohos.geolocation | Geofence | longitude: number; | Added| 82| ohos.geolocation | Geofence | latitude: number; | Added| 83| ohos.geolocation | GeofenceRequest | geofence: Geofence; | Added| 84| ohos.geolocation | GeofenceRequest | scenario: LocationRequestScenario; | Added| 85| ohos.geolocation | GeofenceRequest | priority: LocationRequestPriority; | Added| 86| ohos.geolocation | CachedGnssLocationsRequest | wakeUpCacheQueueFull: boolean; | Added| 87| ohos.geolocation | CachedGnssLocationsRequest | reportingPeriodSec: number; | Added| 88| ohos.geolocation | SatelliteStatusInfo | carrierFrequencies: Array\<number>; | Added| 89| ohos.geolocation | SatelliteStatusInfo | azimuths: Array\<number>; | Added| 90| ohos.geolocation | SatelliteStatusInfo | altitudes: Array\<number>; | Added| 91| ohos.geolocation | SatelliteStatusInfo | carrierToNoiseDensitys: Array\<number>; | Added| 92| ohos.geolocation | SatelliteStatusInfo | satelliteIds: Array\<number>; | Added| 93| ohos.geolocation | SatelliteStatusInfo | satellitesNumber: number; | Added| 94| ohos.geolocation | geolocation | sendCommand(command: LocationCommand, callback: AsyncCallback\<boolean>) : void;<br>sendCommand(command: LocationCommand) : Promise\<boolean>; | Added| 95| ohos.geolocation | geolocation | flushCachedGnssLocations(callback: AsyncCallback\<boolean>) : void;<br>flushCachedGnssLocations() : Promise\<boolean>; | Added| 96| ohos.geolocation | geolocation | getCachedGnssLocationsSize(callback: AsyncCallback\<number>) : void;<br>getCachedGnssLocationsSize() : Promise\<number>; | Added| 97| ohos.geolocation | geolocation | isGeoServiceAvailable(callback: AsyncCallback\<boolean>) : void;<br>isGeoServiceAvailable() : Promise\<boolean>; | Added| 98| ohos.geolocation | geolocation | getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback\<Array\<GeoAddress>>) : void;<br>getAddressesFromLocationName(request: GeoCodeRequest) : Promise\<Array\<GeoAddress>>; | Added| 99| ohos.geolocation | geolocation | getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback\<Array\<GeoAddress>>) : void;<br>getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise\<Array\<GeoAddress>>; | Added| 100| ohos.geolocation | geolocation | requestEnableLocation(callback: AsyncCallback\<boolean>) : void;<br>requestEnableLocation() : Promise\<boolean>; | Added| 101| ohos.geolocation | geolocation | isLocationEnabled(callback: AsyncCallback\<boolean>) : void;<br>isLocationEnabled() : Promise\<boolean>; | Added| 102| ohos.geolocation | geolocation | getLastLocation(callback: AsyncCallback\<Location>) : void;<br>getLastLocation() : Promise\<Location>; | Added| 103| ohos.geolocation | geolocation | getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback\<Location>) : void;<br>getCurrentLocation(callback: AsyncCallback\<Location>) : void;<br>getCurrentLocation(request?: CurrentLocationRequest) : Promise\<Location>; | Added| 104| ohos.geolocation | geolocation | off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Added| 105| ohos.geolocation | geolocation | on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Added| 106| ohos.geolocation | geolocation | off(type: 'nmeaMessageChange', callback?: Callback\<string>) : void; | Added| 107| ohos.geolocation | geolocation | on(type: 'nmeaMessageChange', callback: Callback\<string>) : void; | Added| 108| ohos.geolocation | geolocation | off(type: 'gnssStatusChange', callback?: Callback\<SatelliteStatusInfo>) : void; | Added| 109| ohos.geolocation | geolocation | on(type: 'gnssStatusChange', callback: Callback\<SatelliteStatusInfo>) : void; | Added| 110| ohos.geolocation | geolocation | off(type: 'cachedGnssLocationsReporting', callback?: Callback\<Array\<Location>>) : void; | Added| 111| ohos.geolocation | geolocation | on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback\<Array\<Location>>) : void; | Added| 112| ohos.geolocation | geolocation | off(type: 'locationServiceState', callback?: Callback\<boolean>) : void; | Added| 113| ohos.geolocation | geolocation | on(type: 'locationServiceState', callback: Callback\<boolean>) : void; | Added| 114| ohos.geolocation | geolocation | off(type: 'locationChange', callback?: Callback\<Location>) : void; | Added| 115| ohos.geolocation | geolocation | on(type: 'locationChange', request: LocationRequest, callback: Callback\<Location>) : void; | Added| 116