Interface ILocationListener

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ILocationListener
Callback interface used in the location service ILocationService and for GeoProps.
Author:
Christopher Mindus
  • Method Details

    • onLocationChanged

      void onLocationChanged(IClientSessionGyro clientGyro, DeviceLocation deviceLocation)
      Called when the device location has been received or changed.

      The clientGyro parameter is always set when the location has been updated when the program is running in the foreground and that the client is a browser or the program does not support background location updates.

      Parameters:
      clientGyro - The client session's gyro when possible to find, null otherwise.
      deviceLocation - The device location.
    • onLocationRequestCancelled

      default void onLocationRequestCancelled(IClientSessionGyro clientGyro)
      Called when a location requested with GeoProps.requestLocation(ILocationListener) or ILocationService.requestLocation(ILocationListener) will never arrive: the client session it was requested from is disposed of, so the client is gone and cannot answer. The application requests the location again on another client session if it still needs it.

      This is a default method with an empty body: a listener compiled before it existed keeps compiling and working, it is simply not told.

      Parameters:
      clientGyro - The client session that is disposed of.