Skip to content

Deleting a GeoPoint

There are two ways to delete a geopoint from the Geolocation storage:

Deleting a GeoPoint using the Backendless Console

To delete a geo point using the Backendless Console:

  1. Log in to the Backendless Console, select your app and click the Geolocation icon.
  2. Select a geo category containing the geopoint to be deleted.
  3. Click the checkboxes next to the geopoint(s) which should be deleted.
  4. Click Delete Selected from the button bar as shown below:
    geo-delete-geopoints.zoom50
  5. Click Delete in the confirmation popup to confirm the deletion.
  6. A confirmation notification will appear in the top right corner.

Deleting a GeoPoint with the API

Blocking API

public void Backendless.Geo.removePoint( GeoPoint geoPoint )

Non-Blocking API

public void Backendless.Geo.removePoint( GeoPoint geoPoint, AsyncCallback<Void> responder )

where:

Argument                Description
geoPoint a geopoint object to delete from the Geolocation storage.
responder a responder object which receives a callback when the method successfully delete the geopoint. Applies to the asynchronous method only.

Return Value

None

Example

The code below demonstrates how to delete a geopoint. A geopoint is added first, then subsequently deleted.
Synchronous API sample:

GeoPoint geoPoint = new GeoPoint( -31.96, 115.84 ); 
// save a geopoint (so there is something to delete)
GeoPoint savedGeoPoint = Backendless.Geo.savePoint( geoPoint );

// now delete the saved geopoint
Backendless.Geo.removePoint( savedGeoPoint );

Asynchronous API sample:

GeoPoint geoPoint = new GeoPoint( -31.96, 115.84 );

// save a geopoint, so there is something to delete 
Backendless.Geo.savePoint( geoPoint, new AsyncCallback<GeoPoint>() 
{ 
  @Override 
  public void handleResponse( GeoPoint savedGeoPoint ) 
  { 
    // now delete the saved geopoint
    Backendless.Geo.removePoint( savedGeoPoint, new AsyncCallback<Void>() 
    { 
      @Override 
      public void handleResponse( Void response ) 
      { 
        // GeoPoint has been deleted 
      } 

      @Override 
      public void handleFault( BackendlessFault fault ) 
      { 
        // an error has occurred, the error code can be retrieved with fault.getCode() 
      } 
    } ); 
  } 
  @Override 
  public void handleFault( BackendlessFault fault ) 
  { 
    // an error has occurred, the error code can be retrieved with fault.getCode() 
  } 
});