SuperMap.Protocol.HTTP

矢量图层HTTP基础协议类。

Inherits from

Summary
SuperMap.Protocol.HTTP 矢量图层HTTP基础协议类。
Properties
deleteWithPOST {Boolean} 当delete操作为POST请求时,此值为true ,默认为false 当值为true时, POST data 将作为 format.write()的输出。
readWithPOST {Boolean} 当read操作为POST请求时,此值为true ,默认为false 。
srsInBBOX {Boolean} BBOX查询字符串参数是否包含SRS标识.默认为false.。 如果此值为true,而且其图层的projection已经被设置了, 则BBOX参数将被序列化为包括空间参照系总共五项字符串参数。例如:bbox=-1000,-1000,1000,1000,EPSG:900913
updateWithPOST {Boolean} 当update操作为POST请求时,此值为true ,默认为false。
Constructor
SuperMap.Protocol.HTTP 图层通用的HTTP协议的类。
Functions
abort 强行停止一个正在执行的请求,被传递给此函数的参数必须来自此HTTP protocol(必须是create, read, update, delete 或 commit操作的结果)
commit 遍历所有的 feature 并根据每个feature的状态对其执行不同的操作,例如:create, update and delete.
create 构建用于创建要素的请求。
delete 构建一个删除要素的请求
destroy 清除协议对象.
filterToParams 将<SuperMap.Filter>对象序列化成请求的查询字符串的自定义方法。 如果没有提供自定义的方法,该过滤器将使用<SuperMap.Format.QueryStringFilter>来序列化。
read 构建一个读取新要素的请求。
update 构建一个更新要素的请求。

Properties

readWithPOST

{Boolean} 当read操作为POST请求时,此值为true ,默认为false 。

updateWithPOST

{Boolean} 当update操作为POST请求时,此值为true ,默认为false。

deleteWithPOST

{Boolean} 当delete操作为POST请求时,此值为true ,默认为false 当值为true时, POST data 将作为 format.write()的输出。

srsInBBOX

{Boolean} BBOX查询字符串参数是否包含SRS标识.默认为false.。 如果此值为true,而且其图层的projection已经被设置了, 则BBOX参数将被序列化为包括空间参照系总共五项字符串参数。例如:bbox=-1000,-1000,1000,1000,EPSG:900913

Constructor

SuperMap.Protocol.HTTP

图层通用的HTTP协议的类。

Parameters

options {Object} 其属性将在实例中设置的可选的对象。 Valid options include:
url {String}
headers {Object}
params {Object} GET请求的URL参数
format {<SuperMap.Format>}
callback {Function}
scope {Object}

Functions

destroy

destroy: function()

清除协议对象.

filterToParams

将<SuperMap.Filter>对象序列化成请求的查询字符串的自定义方法。 如果没有提供自定义的方法,该过滤器将使用<SuperMap.Format.QueryStringFilter>来序列化。

Parameters

filter {SuperMap.Filter} 过滤转换
params {Object} 参数对象.

Returns

{Object} 返回的参数对象

read

read: function( options )

构建一个读取新要素的请求。

Parameters

options {Object} 配置请求的可选对象。这个对象可被修改,但不应被重用。

Valid options

url {String} 请求url
params {Object} 将被序列化为字符串的参数
headers {Object} 请求的头信息
filter {SuperMap.Filter} 序列化字符串时用到的过滤器
readWithPOST {Boolean} 是否使用POST请求

Returns

{SuperMap.Protocol.Response} 响应对象,其“priv”属性引用了HTTP请求。 请求完成时,该对象也被传递给回调函数时, 它的“features”属性也会新添加从服务器端返回的数据

create

create: function( features,
options )

构建用于创建要素的请求。

Parameters

features {Array({SuperMap.Feature.Vector})} or {SuperMap.Feature.Vector}
options {Object} 配置新请求的选项。 这个对象可被修改,但不应被重用。

Returns

{SuperMap.Protocol.Response} 响应对象,其”priv“属性引用http请求, 在请求完成时,这个对象将被传递给回调函数, 其“features”属性会新增从服务器端返回的features数据。

update

update: function( feature,
options )

构建一个更新要素的请求。

Parameters

feature {SuperMap.Feature.Vector}
options {Object} 用来设置请求的可选参数.这个参数可被修改,但不应被重用。

Returns

{SuperMap.Protocol.Response} 结果类型对象。 其”priv” 属性引用了 HTTP 请求, 当请求完成后,这个参数也将会被传递给回调函数, 其”features” 属性会新增从服务器返回来的数据。

delete

"delete": function( feature,
options )

构建一个删除要素的请求

Parameters

feature {SuperMap.Feature.Vector}
options {Object} 用来设置请求的可选参数.这个参数可被修改,但不应被重用

Returns

{SuperMap.Protocol.Response} 返回的结果对象。 其”priv” 属性引用了 HTTP请求, 当请求完成后,这个参数也将会被传递给回调函数。 其”features” 属性也将增加从服务器返回来的数据。

commit

commit: function( features,
options )

遍历所有的 feature 并根据每个feature的状态对其执行不同的操作,例如:create, update and delete.

Parameters

features {Array({SuperMap.Feature.Vector})}
options {Object} 设置commit中的回调函数的参数

Valid options

create {Object} 要传递给create函数的可选参数
update {Object} 要传递给update函数的可选参数
delete {Object} 要传递给delete函数的可选参数
callback {Function} 提交完成后的回调函数
scope {Object} 用来设置回调函数的可选域对象

Returns

{Array(SuperMap.Protocol.Response)} 结果数组,每个对象的“priv”属性都引用相应的http请求。

abort

abort: function( response )

强行停止一个正在执行的请求,被传递给此函数的参数必须来自此HTTP protocol(必须是create, read, update, delete 或 commit操作的结果)

Parameters

response {SuperMap.Protocol.Response}
destroy: function()
清除协议对象.
read: function( options )
构建一个读取新要素的请求。
create: function( features,
options )
构建用于创建要素的请求。
update: function( feature,
options )
构建一个更新要素的请求。
"delete": function( feature,
options )
构建一个删除要素的请求
commit: function( features,
options )
遍历所有的 feature 并根据每个feature的状态对其执行不同的操作,例如:create, update and delete.
abort: function( response )
强行停止一个正在执行的请求,被传递给此函数的参数必须来自此HTTP protocol(必须是create, read, update, delete 或 commit操作的结果)
抽象的矢量图层协议类。它不能够被直接实例化,如果要使用其实例,应该使 用它的一个实现子类。
这个类代表一个OGC过滤器。
协议向用户返回的响应对象。
矢量要素类。该类具有 Geometry 属性存放几何信息, attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式, 其中,默认的样式在 SuperMap.Feature.Vector.style 类中定义,如果没有特别的指定将使用默认的样式,
Close