English
Fx.location
About 460 wordsAbout 2 min
2026-01-09
Table of Contents
Summary
The overview of this document is as follows: This document introduces the API definitions of Fx.location, usage methods, and related notes.
1. findByMobile Query single number attribution
Fx.location.findByMobile()
Code examples
def(Boolean error, Map result, String errroMessage) = Fx.location.findByMobile("11111111111")
//Two new parameters added to return values
//province_code String type, region code of the province
//city_code String type, region code of the cityOwner:吕杰lvjie
2. findByMobiles Batch Query Mobile Number Attribution
Batch Query Phone Number Location
Fx.location.findByMobiles()
Code examples
def(Boolean error, Map result, String errorMessage) = Fx.location.findByMobiles(["11111111111", "12252225222"])Owner:吕杰lvjie
3. distance Calculate the distance between two points based on latitude and longitude coordinates
Calculate the distance between two points based on latitude and longitude
Fx.location.distance()
Code examples
BigDecimal longitude1 = 116.374409 //Longitude of location 1
BigDecimal latitude1 = 39.942939 //Latitude of location 1
BigDecimal longitude2 = 116.375721 //Longitude of location 2
BigDecimal latitude2 = 39.942925 //Latitude of location 2
def (Boolean error, Long result, String errorMessage) = Fx.location.distance(longitude1, latitude1, longitude2, latitude2)
if( error ){
Fx.log.info("Calculation error: " + errorMessage)
}else{
Fx.log.info(result)
}Owner:吕杰lvjie
4. findCountryAreaLabel Query province/city names in Chinese based on area code
Query provinces and cities in Chinese based on region codes
Fx.location.findCountryAreaLabel()
Code examples
String label = Fx.location.findCountryAreaLabel("249","province")Owner:吕杰lvjie
5. findCountryAreaCode Query area code based on Chinese province/city names
Query region codes based on Chinese province/city names
Fx.location.findCountryAreaCode()
Code examples
String provinceCode = Fx.location.findCountryAreaCode("Heilongjiang","province")Owner:吕杰lvjie
6. getCountryAreaOptions Query Country/Region/Province Options
Query Countries, Provinces, and Cities
Fx.location.getCountryAreaOptions()
Code examples
def(Boolean error, Map data, String mesage) = Fx.location.getCountryAreaOptions()
if (error) {
log.info("error: " + mesage)
}
log.info(data['country'])
log.info(data['province'])
log.info(data['city'])
log.info(data['district'])Owner:吕杰lvjie
7. getZoningCodeByLabel Retrieve standardized administrative division codes by province/city/district labels
Retrieve standard administrative division codes based on province/city/district labels
Fx.location.getZoningCodeByLabel()
Code examples
def(Boolean error, Map data, String mesage) = Fx.location.getZoningCodeByLabel("city", "Beijing")
if (error) {
log.info("error: " + mesage)
}
log.info(data)Owner:吕杰lvjie
Changelog
| Version | Date | Changes | Author |
|---|---|---|---|
| v1.0 | 2026-05-20 | Initial version |
Background
This document provides detailed information about the Fx.location API functionality and usage, helping developers integrate relevant capabilities.
Applicable Scenarios
Specific applicable scenarios are determined by actual business needs. Developers can select the appropriate API for integration as required.
Prerequisites
- Access to Fxiaoke Open Platform
- Application authorization and configuration completed
- Basic knowledge of relevant business domain
Steps
Please refer to the detailed instructions for each API.
Notes
- Ensure prerequisites are met before calling APIs
- Pay attention to API call frequency limits
- Refer to error code documentation for exception handling
Compatibility note: This version currently has no deprecated or compatibility notes.
