source:
trunk/workshop-routing-foss4g/web/OpenLayers/lib/OpenLayers/Protocol/SQL.js
@
76
Revision 76, 2.5 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | /* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for |
2 | * full list of contributors). Published under the Clear BSD license. |
3 | * See http://svn.openlayers.org/trunk/openlayers/license.txt for the |
4 | * full text of the license. */ |
5 | |
6 | /** |
7 | * @requires OpenLayers/Protocol.js |
8 | */ |
9 | |
10 | /** |
11 | * Class: OpenLayers.Protocol.SQL |
12 | * Abstract SQL protocol class. Not to be instantiated directly. Use |
13 | * one of the SQL protocol subclasses instead. |
14 | * |
15 | * Inherits from: |
16 | * - <OpenLayers.Protocol> |
17 | */ |
18 | OpenLayers.Protocol.SQL = OpenLayers.Class(OpenLayers.Protocol, { |
19 | |
20 | /** |
21 | * APIProperty: databaseName |
22 | * {String} |
23 | */ |
24 | databaseName: 'ol', |
25 | |
26 | /** |
27 | * APIProperty: tableName |
28 | * Name of the database table into which Features should be saved. |
29 | */ |
30 | tableName: "ol_vector_features", |
31 | |
32 | /** |
33 | * Property: postReadFiltering |
34 | * {Boolean} Whether the filter (if there's one) must be applied after |
35 | * the features have been read from the database; for example the |
36 | * BBOX strategy passes the read method a BBOX spatial filter, if |
37 | * postReadFiltering is true every feature read from the database |
38 | * will go through the BBOX spatial filter, which can be costly; |
39 | * defaults to true. |
40 | */ |
41 | postReadFiltering: true, |
42 | |
43 | /** |
44 | * Constructor: OpenLayers.Protocol.SQL |
45 | */ |
46 | initialize: function(options) { |
47 | OpenLayers.Protocol.prototype.initialize.apply(this, [options]); |
48 | }, |
49 | |
50 | /** |
51 | * APIMethod: destroy |
52 | * Clean up the protocol. |
53 | */ |
54 | destroy: function() { |
55 | OpenLayers.Protocol.prototype.destroy.apply(this); |
56 | }, |
57 | |
58 | /** |
59 | * APIMethod: supported |
60 | * This should be overridden by specific subclasses |
61 | * |
62 | * Returns: |
63 | * {Boolean} Whether or not the browser supports the SQL backend |
64 | */ |
65 | supported: function() { |
66 | return false; |
67 | }, |
68 | |
69 | /** |
70 | * Method: evaluateFilter |
71 | * If postReadFiltering is true evaluate the filter against the feature |
72 | * and return the result of the evaluation, otherwise return true. |
73 | * |
74 | * Parameters: |
75 | * {<OpenLayers.Feature.Vector>} The feature. |
76 | * {<OpenLayers.Filter>} The filter. |
77 | * |
78 | * Returns: |
79 | * {Boolean} true if postReadFiltering if false, the result of the |
80 | * filter evaluation otherwise. |
81 | */ |
82 | evaluateFilter: function(feature, filter) { |
83 | return filter && this.postReadFiltering ? |
84 | filter.evaluate(feature) : true; |
85 | }, |
86 | |
87 | CLASS_NAME: "OpenLayers.Protocol.SQL" |
88 | }); |
Note: See TracBrowser
for help on using the repository browser.