# JS API Changes of the Location Subsystem The table below lists the APIs changes of the location subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS. ## API Changes | Module| Class| Method/Attribute/Enumeration/Constant| Change Type| |---|---|---|---| | ohos.geolocation | LocationCommand | command: string; | Added| | ohos.geolocation | LocationCommand | scenario: LocationRequestScenario; | Added| | ohos.geolocation | LocationPrivacyType | CORE_LOCATION | Added| | ohos.geolocation | LocationPrivacyType | STARTUP | Added| | ohos.geolocation | LocationPrivacyType | OTHERS = 0 | Added| | ohos.geolocation | GeoLocationErrorCode | LOCATION_REQUEST_TIMEOUT_ERROR | Added| | ohos.geolocation | GeoLocationErrorCode | LAST_KNOWN_LOCATION_ERROR | Added| | ohos.geolocation | GeoLocationErrorCode | LOCATION_SWITCH_ERROR | Added| | ohos.geolocation | GeoLocationErrorCode | LOCATOR_ERROR | Added| | ohos.geolocation | GeoLocationErrorCode | GEOCODE_ERROR | Added| | ohos.geolocation | GeoLocationErrorCode | REVERSE_GEOCODE_ERROR | Added| | ohos.geolocation | GeoLocationErrorCode | INPUT_PARAMS_ERROR = 101 | Added| | ohos.geolocation | LocationRequestScenario | NO_POWER | Added| | ohos.geolocation | LocationRequestScenario | DAILY_LIFE_SERVICE | Added| | ohos.geolocation | LocationRequestScenario | CAR_HAILING | Added| | ohos.geolocation | LocationRequestScenario | TRAJECTORY_TRACKING | Added| | ohos.geolocation | LocationRequestScenario | NAVIGATION | Added| | ohos.geolocation | LocationRequestScenario | UNSET = 0x300 | Added| | ohos.geolocation | LocationRequestPriority | FIRST_FIX | Added| | ohos.geolocation | LocationRequestPriority | LOW_POWER | Added| | ohos.geolocation | LocationRequestPriority | ACCURACY | Added| | ohos.geolocation | LocationRequestPriority | UNSET = 0x200 | Added| | ohos.geolocation | Location | additionSize?: number; | Added| | ohos.geolocation | Location | additions?: Array\; | Added| | ohos.geolocation | Location | timeSinceBoot: number; | Added| | ohos.geolocation | Location | direction: number; | Added| | ohos.geolocation | Location | timeStamp: number; | Added| | ohos.geolocation | Location | speed: number; | Added| | ohos.geolocation | Location | accuracy: number; | Added| | ohos.geolocation | Location | altitude: number; | Added| | ohos.geolocation | Location | longitude: number; | Added| | ohos.geolocation | Location | latitude: number; | Added| | ohos.geolocation | CurrentLocationRequest | timeoutMs?: number; | Added| | ohos.geolocation | CurrentLocationRequest | maxAccuracy?: number; | Added| | ohos.geolocation | CurrentLocationRequest | scenario?: LocationRequestScenario; | Added| | ohos.geolocation | CurrentLocationRequest | priority?: LocationRequestPriority; | Added| | ohos.geolocation | LocationRequest | maxAccuracy?: number; | Added| | ohos.geolocation | LocationRequest | distanceInterval?: number; | Added| | ohos.geolocation | LocationRequest | timeInterval?: number; | Added| | ohos.geolocation | LocationRequest | scenario?: LocationRequestScenario; | Added| | ohos.geolocation | LocationRequest | priority?: LocationRequestPriority; | Added| | ohos.geolocation | GeoAddress | descriptionsSize?: number; | Added| | ohos.geolocation | GeoAddress | descriptions?: Array\; | Added| | ohos.geolocation | GeoAddress | addressUrl?: string; | Added| | ohos.geolocation | GeoAddress | phoneNumber?: string; | Added| | ohos.geolocation | GeoAddress | postalCode?: string; | Added| | ohos.geolocation | GeoAddress | premises?: string; | Added| | ohos.geolocation | GeoAddress | subRoadName?: string; | Added| | ohos.geolocation | GeoAddress | roadName?: string; | Added| | ohos.geolocation | GeoAddress | subLocality?: string; | Added| | ohos.geolocation | GeoAddress | locality?: string; | Added| | ohos.geolocation | GeoAddress | subAdministrativeArea?: string; | Added| | ohos.geolocation | GeoAddress | administrativeArea?: string; | Added| | ohos.geolocation | GeoAddress | countryName?: string; | Added| | ohos.geolocation | GeoAddress | countryCode?: string; | Added| | ohos.geolocation | GeoAddress | placeName?: string; | Added| | ohos.geolocation | GeoAddress | locale?: string; | Added| | ohos.geolocation | GeoAddress | longitude?: number; | Added| | ohos.geolocation | GeoAddress | latitude?: number; | Added| | ohos.geolocation | GeoCodeRequest | maxLongitude?: number; | Added| | ohos.geolocation | GeoCodeRequest | maxLatitude?: number; | Added| | ohos.geolocation | GeoCodeRequest | minLongitude?: number; | Added| | ohos.geolocation | GeoCodeRequest | minLatitude?: number; | Added| | ohos.geolocation | GeoCodeRequest | maxItems?: number; | Added| | ohos.geolocation | GeoCodeRequest | description: string; | Added| | ohos.geolocation | GeoCodeRequest | locale?: string; | Added| | ohos.geolocation | ReverseGeoCodeRequest | maxItems?: number; | Added| | ohos.geolocation | ReverseGeoCodeRequest | longitude: number; | Added| | ohos.geolocation | ReverseGeoCodeRequest | latitude: number; | Added| | ohos.geolocation | ReverseGeoCodeRequest | locale?: string; | Added| | ohos.geolocation | Geofence | expiration: number; | Added| | ohos.geolocation | Geofence | radius: number; | Added| | ohos.geolocation | Geofence | longitude: number; | Added| | ohos.geolocation | Geofence | latitude: number; | Added| | ohos.geolocation | GeofenceRequest | geofence: Geofence; | Added| | ohos.geolocation | GeofenceRequest | scenario: LocationRequestScenario; | Added| | ohos.geolocation | GeofenceRequest | priority: LocationRequestPriority; | Added| | ohos.geolocation | CachedGnssLocationsRequest | wakeUpCacheQueueFull: boolean; | Added| | ohos.geolocation | CachedGnssLocationsRequest | reportingPeriodSec: number; | Added| | ohos.geolocation | SatelliteStatusInfo | carrierFrequencies: Array\; | Added| | ohos.geolocation | SatelliteStatusInfo | azimuths: Array\; | Added| | ohos.geolocation | SatelliteStatusInfo | altitudes: Array\; | Added| | ohos.geolocation | SatelliteStatusInfo | carrierToNoiseDensitys: Array\; | Added| | ohos.geolocation | SatelliteStatusInfo | satelliteIds: Array\; | Added| | ohos.geolocation | SatelliteStatusInfo | satellitesNumber: number; | Added| | ohos.geolocation | geolocation | sendCommand(command: LocationCommand, callback: AsyncCallback\) : void;
sendCommand(command: LocationCommand) : Promise\; | Added| | ohos.geolocation | geolocation | flushCachedGnssLocations(callback: AsyncCallback\) : void;
flushCachedGnssLocations() : Promise\; | Added| | ohos.geolocation | geolocation | getCachedGnssLocationsSize(callback: AsyncCallback\) : void;
getCachedGnssLocationsSize() : Promise\; | Added| | ohos.geolocation | geolocation | isGeoServiceAvailable(callback: AsyncCallback\) : void;
isGeoServiceAvailable() : Promise\; | Added| | ohos.geolocation | geolocation | getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback\>) : void;
getAddressesFromLocationName(request: GeoCodeRequest) : Promise\>; | Added| | ohos.geolocation | geolocation | getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback\>) : void;
getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise\>; | Added| | ohos.geolocation | geolocation | requestEnableLocation(callback: AsyncCallback\) : void;
requestEnableLocation() : Promise\; | Added| | ohos.geolocation | geolocation | isLocationEnabled(callback: AsyncCallback\) : void;
isLocationEnabled() : Promise\; | Added| | ohos.geolocation | geolocation | getLastLocation(callback: AsyncCallback\) : void;
getLastLocation() : Promise\; | Added| | ohos.geolocation | geolocation | getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback\) : void;
getCurrentLocation(callback: AsyncCallback\) : void;
getCurrentLocation(request?: CurrentLocationRequest) : Promise\; | Added| | ohos.geolocation | geolocation | off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Added| | ohos.geolocation | geolocation | on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Added| | ohos.geolocation | geolocation | off(type: 'nmeaMessageChange', callback?: Callback\) : void; | Added| | ohos.geolocation | geolocation | on(type: 'nmeaMessageChange', callback: Callback\) : void; | Added| | ohos.geolocation | geolocation | off(type: 'gnssStatusChange', callback?: Callback\) : void; | Added| | ohos.geolocation | geolocation | on(type: 'gnssStatusChange', callback: Callback\) : void; | Added| | ohos.geolocation | geolocation | off(type: 'cachedGnssLocationsReporting', callback?: Callback\>) : void; | Added| | ohos.geolocation | geolocation | on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback\>) : void; | Added| | ohos.geolocation | geolocation | off(type: 'locationServiceState', callback?: Callback\) : void; | Added| | ohos.geolocation | geolocation | on(type: 'locationServiceState', callback: Callback\) : void; | Added| | ohos.geolocation | geolocation | off(type: 'locationChange', callback?: Callback\) : void; | Added| | ohos.geolocation | geolocation | on(type: 'locationChange', request: LocationRequest, callback: Callback\) : void; | Added|