Google.Maps.Event.MapLoadErrorArgs

Encapsulates the set of arguments for MapEvents.LoadError.

Summary

When part of the map fails to load after a call to MapsService.LoadMap, a MapEvents.LoadError event is fired before attempting to load it again. A listener can modify the fields of MapLoadErrorArgs to change whether it will retry, and if so, after what delay.

The default behavior starts with a delay of 0.5 seconds with 1.0 jitter, doubling the delay with each attempt, up to 3 attempts.

Recommendations

Example


  mapsService.Events.MapEvents.LoadError.AddListener(e => {
    if (e.DetailedErrorCode == DetailedErrorEnum.UnsupportedClientVersion) {
      log.Error("Update app to latest version");
      return;
    }
// Retry up to 5 attempts. e.Retry = e.Attempts <= 5;
// Log to the console. if (e.Retry && e.IsRetriable) { log.Warning(e); } else { log.Error(e); } });

Inheritance

Inherits from: Google.Maps.Event.ErrorArgs

Public attributes

Attempts
readonly int
The number of attempts at loading this part of the map.
DelayJitter
float
Jitter in the delay before retrying.
DelaySeconds
float
The length of time to wait before retrying.
IsRetriable
readonly bool
Indicates whether the request can be retried.
Retry
bool
Indicates whether to retry loading this part of the map.
TimeoutSeconds
int
The length of time (in seconds) to wait until the next attempt.

Public functions

GetBounds(Coords coords)
Bounds
Gets the bounds of the area that failed to load.

Public attributes

Attempts

readonly int Attempts

The number of attempts at loading this part of the map.

DelayJitter

float DelayJitter

Jitter in the delay before retrying.

The amount of time before retrying is (DelaySeconds * (1.0 + random(0.0, DelayJitter))). Event listeners can modify this value to change the behavior.

DelaySeconds

float DelaySeconds

The length of time to wait before retrying.

Event listeners can modify this value to change the behavior.

IsRetriable

readonly bool IsRetriable

Indicates whether the request can be retried.

Retry

bool Retry

Indicates whether to retry loading this part of the map.

Event listeners can modify this value to change the behavior.

But it has no effect if IsRetriable is true.

TimeoutSeconds

int TimeoutSeconds

The length of time (in seconds) to wait until the next attempt.

If set to 0, the next attempts waits forever.

Public functions

GetBounds

Bounds GetBounds(
  Coords coords
)

Gets the bounds of the area that failed to load.

Details
Parameters
coords
The coordinate system of the MapsService (Coord.Coords).

Send feedback about...

Google Maps Platform gaming solution
Google Maps Platform gaming solution