Online Maps  v3
OnlineMapsWWW Class Reference

The wrapper class for WWW.
It allows you to control requests.
To create is recommended to use OnlineMapsUtils.GetWWW. More...

Inherits CustomYieldInstruction, and IDisposable.

Public Types

enum  RequestType { RequestType.direct, RequestType.www }
 Type of request. More...
 

Public Member Functions

 OnlineMapsWWW (string url)
 Constructor More...
 
 OnlineMapsWWW (StringBuilder url)
 Constructor More...
 
 OnlineMapsWWW (string url, RequestType type, string reqID)
 Constructor More...
 
void Dispose ()
 Disposes of an existing object. More...
 
void LoadImageIntoTexture (Texture2D tex)
 Replaces the contents of an existing Texture2D with an image from the downloaded data. More...
 
void SetBytes (string responseHeadersString, byte[] _bytes)
 Sets the contents and headers of the response for type = direct. More...
 
void SetError (string errorStr)
 Sets the error for type = direct. More...
 

Static Public Member Functions

static string EscapeURL (string s)
 Escapes characters in a string to ensure they are URL-friendly. More...
 

Public Attributes

Action< OnlineMapsWWWOnComplete
 Event that occurs when a request is completed. More...
 

Static Public Attributes

static Func< string, string > OnInit
 This event is occurs when URL is initialized, and allows you to modify it. More...
 
static Predicate< string > OnValidate
 Events to validate the request. Return false if you want to cancel the request. More...
 

Properties

object? this[string key] [get, set]
 Gets / sets custom fields value by key More...
 
byte [] bytes [get]
 Returns the contents of the fetched web page as a byte array. More...
 
int? bytesDownloaded [get]
 The number of bytes downloaded by this query. More...
 
Dictionary< string, object > customFields [get]
 Gets customFields dictionary More...
 
string error [get]
 Returns an error message if there was an error during the download. More...
 
bool hasError [get]
 This property is true if the request has encountered an error. More...
 
string id [get]
 ID of query. More...
 
bool isDone [get]
 Is the download already finished? More...
 
Dictionary< string, string > responseHeaders [get]
 Dictionary of headers returned by the request. More...
 
string? text [get]
 Returns the contents of the fetched web page as a string. More...
 
string url [get]
 The URL of this request. More...
 

Detailed Description

The wrapper class for WWW.
It allows you to control requests.
To create is recommended to use OnlineMapsUtils.GetWWW.

Member Enumeration Documentation

◆ RequestType

Type of request.

Enumerator
direct 

The request will be processed independently.
Use OnlineMapsUtils.OnGetWWW to process of request.

www 

The request will be processed using WWW or UnityWebClient class.

Constructor & Destructor Documentation

◆ OnlineMapsWWW() [1/3]

OnlineMapsWWW.OnlineMapsWWW ( string  url)

Constructor

Parameters
urlURL of request

◆ OnlineMapsWWW() [2/3]

OnlineMapsWWW.OnlineMapsWWW ( StringBuilder  url)

Constructor

Parameters
urlURL of request

◆ OnlineMapsWWW() [3/3]

OnlineMapsWWW.OnlineMapsWWW ( string  url,
RequestType  type,
string  reqID 
)

Constructor

Parameters
urlURL of request
typeType of request
reqIDRequest ID

Member Function Documentation

◆ Dispose()

void OnlineMapsWWW.Dispose ( )

Disposes of an existing object.

◆ EscapeURL()

static string OnlineMapsWWW.EscapeURL ( string  s)
static

Escapes characters in a string to ensure they are URL-friendly.

Parameters
sA string with characters to be escaped.
Returns
Escaped string.

◆ LoadImageIntoTexture()

void OnlineMapsWWW.LoadImageIntoTexture ( Texture2D  tex)

Replaces the contents of an existing Texture2D with an image from the downloaded data.

Parameters
texAn existing texture object to be overwritten with the image data.

◆ SetBytes()

void OnlineMapsWWW.SetBytes ( string  responseHeadersString,
byte []  _bytes 
)

Sets the contents and headers of the response for type = direct.

Parameters
responseHeadersStringHeaders of response.
_bytesContent of response.

◆ SetError()

void OnlineMapsWWW.SetError ( string  errorStr)

Sets the error for type = direct.

Parameters
errorStrError message.

Member Data Documentation

◆ OnComplete

Action<OnlineMapsWWW> OnlineMapsWWW.OnComplete

Event that occurs when a request is completed.

◆ OnInit

Func<string, string> OnlineMapsWWW.OnInit
static

This event is occurs when URL is initialized, and allows you to modify it.

◆ OnValidate

Predicate<string> OnlineMapsWWW.OnValidate
static

Events to validate the request. Return false if you want to cancel the request.

Property Documentation

◆ bytes

byte [] OnlineMapsWWW.bytes
get

Returns the contents of the fetched web page as a byte array.

◆ bytesDownloaded

int? OnlineMapsWWW.bytesDownloaded
get

The number of bytes downloaded by this query.

◆ customFields

Dictionary<string, object> OnlineMapsWWW.customFields
get

Gets customFields dictionary

◆ error

string OnlineMapsWWW.error
get

Returns an error message if there was an error during the download.

◆ hasError

bool OnlineMapsWWW.hasError
get

This property is true if the request has encountered an error.

◆ id

string OnlineMapsWWW.id
get

ID of query.

◆ isDone

bool OnlineMapsWWW.isDone
get

Is the download already finished?

◆ responseHeaders

Dictionary<string, string> OnlineMapsWWW.responseHeaders
get

Dictionary of headers returned by the request.

◆ text

string? OnlineMapsWWW.text
get

Returns the contents of the fetched web page as a string.

◆ this[string key]

object? OnlineMapsWWW.this[string key]
getset

Gets / sets custom fields value by key

Parameters
keyCustom field key
Returns
Custom field value

◆ url

string OnlineMapsWWW.url
get

The URL of this request.