Class: Ajax

ol.ext. Ajax

Ajax request


new Ajax(options)

Parameters:
Name Type Description
options *
Properties
Name Type Description
auth string

Authorisation as btoa("username:password");

dataType string

The type of data that you're expecting back from the server, default JSON

Fires:
  • event:success
  • event:error

Methods


<static> get(options)

Helper for get

Parameters:
Name Type Description
options *
Properties
Name Type Description
url string
auth string

Authorisation as btoa("username:password");

dataType string

The type of data that you're expecting back from the server, default JSON

success string
error string
options *

get options


<static> getCORS(url, callback)

Helper to get cors header

Parameters:
Name Type Description
url string
callback string

send(url, data, options)

Send an ajax request (GET)

Parameters:
Name Type Description
url string
data *

Data to send to the server as key / value

options *

a set of options that are returned in the

Properties
Name Type Description
abort boolean

false to prevent aborting the current request, default true

Fires:
  • event:success
  • event:error