English
Fx.location
About 320 wordsAbout 1 min
2026-01-09
1. findByMobile Query single number attribution
Query Single Number Location
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
