Online Maps v3
Loading...
Searching...
No Matches
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 { direct , www }
 Type of request. More...
 

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Static Public Attributes

static Action< OnlineMapsWWWOnCreateRequest
 Called when a request has been created but not yet sent.
 
static Func< string, string > OnInit
 This event is occurs when URL is initialized, and allows you to modify it.
 
static Predicate< string > OnValidate
 Events to validate the request. Return false if you want to cancel the request.
 

Properties

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

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

◆ 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.

Property Documentation

◆ keepWaiting

override bool OnlineMapsWWW.keepWaiting
get

Gets a value indicating whether this coroutine should continue executing.

True if the coroutine should continue waiting; otherwise, false.

◆ request

UnityWebRequest OnlineMapsWWW.request
get

Gets the UnityWebRequest object for this request.

Returns
The UnityWebRequest object.

◆ this[string key]

object OnlineMapsWWW.this[string key]
getset

Gets / sets custom fields value by key.

Parameters
keyCustom field key
Returns
Custom field value