1 /* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
2 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
3 * text of the license. */
4 // @require: OpenLayers/Layer/Grid.js
5 // @require: OpenLayers/Layer/Markers.js
9 OpenLayers.Layer.WFS = Class.create();
10 OpenLayers.Layer.WFS.prototype =
11 Object.extend(new OpenLayers.Layer.Grid(),
12 Object.extend(new OpenLayers.Layer.Markers(), {
15 featureClass: OpenLayers.Feature.WFS,
17 /** @final @type hash */
18 DEFAULT_PARAMS: { service: "WFS",
20 request: "GetFeature",
29 * @param {hash} params
30 * @param {Object} featureClass
32 initialize: function(name, url, params, featureClass) {
33 if (featureClass != null) this.featureClass = featureClass;
35 var newArguments = new Array();
36 if (arguments.length > 0) {
38 params = OpenLayers.Util.upperCaseObject(params);
39 newArguments.push(name, url, params);
41 OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments);
42 OpenLayers.Layer.Markers.prototype.initialize.apply(this, newArguments);
44 if (arguments.length > 0) {
45 OpenLayers.Util.applyDefaults(
47 OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)
57 OpenLayers.Layer.Grid.prototype.destroy.apply(this, arguments);
58 OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments);
62 * @param {OpenLayers.Bounds} bounds
63 * @param {Boolean} zoomChanged
65 moveTo: function(bounds, zoomChanged) {
66 OpenLayers.Layer.Grid.prototype.moveTo.apply(this, arguments);
67 OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments);
70 /** WFS layer is never a base class.
73 isBaseLayer: function() {
78 * @param {String} name
79 * @param {hash} params
81 * @returns A clone of this OpenLayers.Layer.WMS, with the passed-in
82 * parameters merged in.
83 * @type OpenLayers.Layer.WMS
85 clone: function (name, params) {
87 Object.extend(mergedParams, this.params);
88 Object.extend(mergedParams, params);
89 var obj = new OpenLayers.Layer.WFS(name, this.url, mergedParams);
90 obj.setTileSize(this.tileSize);
95 * addTile creates a tile, initializes it (via 'draw' in this case), and
96 * adds it to the layer div.
98 * @param {OpenLayers.Bounds} bounds
100 * @returns The added OpenLayers.Tile.WFS
101 * @type OpenLayers.Tile.WFS
103 addTile:function(bounds, position) {
104 url = this.getFullRequestString(
105 { BBOX:bounds.toBBOX() });
107 return new OpenLayers.Tile.WFS(this, position, bounds,
112 /** @final @type String */
113 CLASS_NAME: "OpenLayers.Layer.WFS"