Skip to main content
Version: 3.5

class CoverageClient

(Niantic.Lightship.AR.VpsCoverage.CoverageClient)

Overview

Client to request CoverageAreas and LocalizationTargets.

class CoverageClient {
public:
// methods

CoverageClient(LightshipSettings lightshipSettings);

async void TryGetCoverageAreas(
LatLng queryLocation,
int queryRadius,
Action<CoverageAreasResult> onAreasReceived
);

async void TryGetLocalizationTargets(
string[] targetIdentifiers,
Action<LocalizationTargetsResult> onTargetsReceived
);

async void TryGetCoverage(
LatLng queryLocation,
int queryRadius,
Action<AreaTargetsResult> onLocationsReceived,
LocalizationTarget[] privateScanLocalizationTargets = null
);

async Task<Texture> TryGetImageFromUrl(string imageUrl);

async void TryGetImageFromUrl(
string imageUrl,
Action<Texture> onImageDownloaded
);

async Task<Texture> TryGetImageFromUrl(string imageUrl, int width, int height);

async void TryGetImageFromUrl(
string imageUrl,
int width,
int height,
Action<Texture> onImageDownloaded
);
};

Detailed Documentation

Client to request CoverageAreas and LocalizationTargets.

Methods

TryGetCoverageAreas

async void TryGetCoverageAreas(
LatLng queryLocation,
int queryRadius,
Action<CoverageAreasResult> onAreasReceived
)

Request CoverageAreas at device location within a radius using the callback pattern.

    Parameters:

    queryLocation - Center of query

    queryRadius - Radius for query between 0m and 2000m. A negative radius will default to the maximum radius of 2000m.

    onAreasReceived - Callback invoked when the requested CoverageAreas are ready.

TryGetLocalizationTargets

async void TryGetLocalizationTargets(
string[] targetIdentifiers,
Action<LocalizationTargetsResult> onTargetsReceived
)

Request LocalizationTargets for a set of identifiers using the callback pattern.

    Parameters:

    targetIdentifiers - Set of unique identifiers of the requested targets.

    onTargetsReceived - Callback invoked when the requested LocalizationTargets are ready.

TryGetCoverage

async void TryGetCoverage(
LatLng queryLocation,
int queryRadius,
Action<AreaTargetsResult> onLocationsReceived,
LocalizationTarget[] privateScanLocalizationTargets = null
)

Request coupled CoverageAreas and LocalizationTargets within a radius, using the callback pattern.

    Parameters:

    queryLocation - Center of query

    queryRadius - Radius for query between 0m and 2000m. A negative radius will default to the maximum radius of 2000m.

    onLocationsReceived - Callback invoked when the requested CoverageAreas and LocalizationTargets are ready.

    privateScanLocalizationTargets - Optional. For any LocalizationTarget included in this array, a corresponding AreaTarget will be added to the AreaTargets returned through the onLocationsReceived callback. Specify your private AR Locations via the CoverageClientManager in order to utilize this parameter.

TryGetImageFromUrl

async Task<Texture> TryGetImageFromUrl(string imageUrl)

Downloads the image from the provided url as a texture, using the async await pattern.

    Parameters:

    imageUrl - URL of the localization target's hint image

TryGetImageFromUrl

async void TryGetImageFromUrl(
string imageUrl,
Action<Texture> onImageDownloaded
)

Downloads the image from the provided url as a texture, using the callback pattern.

    Parameters:

    imageUrl -

    onImageDownloaded - Callback for downloaded image as texture. When download fails, texture is returned as null.

TryGetImageFromUrl

async Task<Texture> TryGetImageFromUrl(string imageUrl, int width, int height)

Downloads the image from the provided url as a texture cropped to a fixed size, using the async await pattern. The source image is first resampled so the image is fitting for the limiting dimension, then it gets cropped to the fixed size.

    Parameters:

    imageUrl - URL of the localization target's hint image

    width - Fixed width of cropped image

    height - Fixed height of cropped image

TryGetImageFromUrl

async void TryGetImageFromUrl(
string imageUrl,
int width,
int height,
Action<Texture> onImageDownloaded
)

Downloads the image from the provided url as a texture cropped to a fixed size, using the callback pattern. The source image is first resampled so the image is fitting for the limiting dimension, then it gets cropped to the fixed size.

    Parameters:

    imageUrl - URL of the localization target's hint image

    width - Fixed width of cropped image

    height - Fixed height Fixed height of cropped image

    onImageDownloaded - Callback for downloaded image as texture. When download fails texture is returned as null.