1
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
2
|
* full list of contributors). Published under the 2-clause BSD license.
|
3
|
* See license.txt in the OpenLayers distribution or repository for the
|
4
|
* full text of the license. */
|
5
|
|
6
|
/**
|
7
|
* @requires OpenLayers/Protocol/WFS/v1.js
|
8
|
* @requires OpenLayers/Format/WFST/v1_1_0.js
|
9
|
*/
|
10
|
|
11
|
/**
|
12
|
* Class: OpenLayers.Protocol.WFS.v1_1_0
|
13
|
* A WFS v1.1.0 protocol for vector layers. Create a new instance with the
|
14
|
* <OpenLayers.Protocol.WFS.v1_1_0> constructor.
|
15
|
*
|
16
|
* Differences from the v1.0.0 protocol:
|
17
|
* - uses Filter Encoding 1.1.0 instead of 1.0.0
|
18
|
* - uses GML 3 instead of 2 if no format is provided
|
19
|
*
|
20
|
* Inherits from:
|
21
|
* - <OpenLayers.Protocol.WFS.v1>
|
22
|
*/
|
23
|
OpenLayers.Protocol.WFS.v1_1_0 = OpenLayers.Class(OpenLayers.Protocol.WFS.v1, {
|
24
|
|
25
|
/**
|
26
|
* Property: version
|
27
|
* {String} WFS version number.
|
28
|
*/
|
29
|
version: "1.1.0",
|
30
|
|
31
|
/**
|
32
|
* Constructor: OpenLayers.Protocol.WFS.v1_1_0
|
33
|
* A class for giving layers WFS v1.1.0 protocol.
|
34
|
*
|
35
|
* Parameters:
|
36
|
* options - {Object} Optional object whose properties will be set on the
|
37
|
* instance.
|
38
|
*
|
39
|
* Valid options properties:
|
40
|
* featureType - {String} Local (without prefix) feature typeName (required).
|
41
|
* featureNS - {String} Feature namespace (optional).
|
42
|
* featurePrefix - {String} Feature namespace alias (optional - only used
|
43
|
* if featureNS is provided). Default is 'feature'.
|
44
|
* geometryName - {String} Name of geometry attribute. Default is 'the_geom'.
|
45
|
* outputFormat - {String} Optional output format to use for WFS GetFeature
|
46
|
* requests. This can be any format advertized by the WFS's
|
47
|
* GetCapabilities response. If set, an appropriate readFormat also
|
48
|
* has to be provided, unless outputFormat is GML3, GML2 or JSON.
|
49
|
* readFormat - {<OpenLayers.Format>} An appropriate format parser if
|
50
|
* outputFormat is none of GML3, GML2 or JSON.
|
51
|
*/
|
52
|
initialize: function(options) {
|
53
|
OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this, arguments);
|
54
|
if (this.outputFormat && !this.readFormat) {
|
55
|
if (this.outputFormat.toLowerCase() == "gml2") {
|
56
|
this.readFormat = new OpenLayers.Format.GML.v2({
|
57
|
featureType: this.featureType,
|
58
|
featureNS: this.featureNS,
|
59
|
geometryName: this.geometryName
|
60
|
});
|
61
|
} else if (this.outputFormat.toLowerCase() == "json") {
|
62
|
this.readFormat = new OpenLayers.Format.GeoJSON();
|
63
|
}
|
64
|
}
|
65
|
},
|
66
|
|
67
|
CLASS_NAME: "OpenLayers.Protocol.WFS.v1_1_0"
|
68
|
});
|