Skip to main content

Geolocation / Adress

info

As the location data comes from OpenStreetMap, some addresses might not be correct or may not exist.

Mutation that is used below

mutation updateFolderLocation(
$id: String!
$locationAddress: CustomLocationObjectInputType!
$location: LocationInputType
) {
updateFolder(
input: { id: $id, locationAddress: $locationAddress, location: $location }
) {
folder {
id
geoLocationDetails {
latitude
longitude
address {
houseNr
street
city
postcode
country
}
}
}
}
}

Setting the Location

To set the address, you need to have the variables of the mutation above like:

{
"id": "...",
"locationAddress": {
"postalcode": "70188",
"city": "Stuttgart",
"address": "Ameisenbergstraße",
"houseNr": "29",
"country": "Deutschland"
}
}
info

Every field except the address field is optional.

info

You can set the house number into the address too, but if you have it already separately, it is preferred not to set it in address.

If you have the GPS location that you wanna use for that address, as maybe you know that the address does not exist or is too far off, then you can set the location field too.

{
"id": "...",
"locationAddress": {
"postalcode": "70188",
"city": "Stuttgart",
"address": "Ameisenbergstraße",
"houseNr": "29",
"country": "Deutschland"
},
"location": { "latitude": 48.784294, "longitude": 9.198418 }
}
note

Note that the latitude and longitude must be a float

Removing the location

To entirely remove the location, you set the variables like this:

{
"id": "...",
"locationAddress": {
"postalcode": "",
"city": "",
"address": "",
"houseNr": "",
"country": ""
},
"location": { "latitude": 0, "longitude": 0 }
}

It will ensure that the address, Latitude, and longitude are removed from the folder correctly.