struct LocalizationTarget (Niantic.ARDK.VPSCoverage.LocalizationTarget)

Overview

A real world target for localization using VPS. More…

struct LocalizationTarget {
    // properties

    LatLng Center;
    string Identifier;
    string ImageURL;
    string Name;

    // methods

    async void DownloadImage(Action<Texture> onImageDownloaded);

    async void DownloadImage(
        int width,
        int height,
        Action<Texture> onImageDownloaded
    );

    async Task<Texture> DownloadImageAsync();
    async Task<Texture> DownloadImageAsync(int width, int height);
    string ToGeoJson();
};

Detailed Documentation

A real world target for localization using VPS.

Properties

LatLng Center

Geolocation of the LocalizationTarget.

string Identifier

Unique identifier of the LocalizationTarget.

string ImageURL

Url where hint image is stored.

string Name

Name of the LocalizationTarget.

Methods

async void DownloadImage(Action<Texture> onImageDownloaded)

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

Parameters:

onImageReceived

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

async void DownloadImage(
    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:

width

Fixed width of cropped image

height

Fixed height of cropped image

onImageReceived

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

async Task<Texture> DownloadImageAsync()

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

Parameters:

onImageReceived

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

async Task<Texture> DownloadImageAsync(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:

width

Fixed width of cropped image

height

Fixed height of cropped image

onImageReceived

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