Add geolocation to related data

I am currently required to make a project wherein hotels are supposed to be stored along with their locations. I’m using Google Maps API to retrieve the latitude and longitude, and creating a geopoint on Backendless. I have also created a georelation in my hotels table. But while creating a hotel, I’m unable to add the geolocation relation. How do I do so?

Here’s my code:

.controller('AgAddCtrl', function($scope, $state, $http) {
  console.log("Agent Add");
  $scope.hotelReg = function() {
    var address = $scope.hName + ',' + $scope.hLocality + ',' + $scope.hCity;
    var latitude;
    var longitude;
    var user = $state.params.user;
    var url = "" + address;
      .success(function(data) {
        latitude = data.results[0];
        longitude = data.results[0].geometry.location.lng;
        var point = {
          latitude: latitude,
          longitude: longitude
        Backendless.Geo.addPoint( point )
         .then( function( savedGeoPoint ) {
           $scope.geo = savedGeoPoint.objectId;
           console.log( "geo point saved " + savedGeoPoint.objectId );
         .catch( function( error ) {
           console.log( "error - " + error.message );
          name: $scope.hName,
          locality: $scope.hLocality,
          city: $scope.hCity,
          amenities: $scope.hAmenities,
          latitude: latitude,
          longitude: longitude,
          hotel_geo: $scope.geo,
        }).then( function( savedObject ) {
          .catch( function( error ) {
              console.log("error upload" + error.message);
      .error( function(error) {
        console.log("error map");

Hi Saurav,

Please see the following section in the documentation which describes this very subject:


Can this not be done through the code, instead of having to use the console for every single point?

Yes, it can. If you scroll down the page (same section in the docs), you will see the code.