~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/openlayers/lib/OpenLayers/Format.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
 
2
 * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
 
3
 * full text of the license. */
 
4
 
 
5
/**
 
6
 * @requires OpenLayers/Util.js
 
7
 */
 
8
 
 
9
/**
 
10
 * Class: OpenLayers.Format
 
11
 * Base class for format reading/writing a variety of formats.  Subclasses
 
12
 *     of OpenLayers.Format are expected to have read and write methods.
 
13
 */
 
14
OpenLayers.Format = OpenLayers.Class({
 
15
    
 
16
    /**
 
17
     * Property: options
 
18
     * {Object} A reference to options passed to the constructor.
 
19
     */
 
20
    options: null,
 
21
    
 
22
    /**
 
23
     * APIProperty: externalProjection
 
24
     * {<OpenLayers.Projection>} When passed a externalProjection and
 
25
     *     internalProjection, the format will reproject the geometries it
 
26
     *     reads or writes. The externalProjection is the projection used by
 
27
     *     the content which is passed into read or which comes out of write.
 
28
     *     In order to reproject, a projection transformation function for the
 
29
     *     specified projections must be available. This support may be 
 
30
     *     provided via proj4js or via a custom transformation function. See
 
31
     *     {<OpenLayers.Projection.addTransform>} for more information on
 
32
     *     custom transformations.
 
33
     */
 
34
    externalProjection: null,
 
35
 
 
36
    /**
 
37
     * APIProperty: internalProjection
 
38
     * {<OpenLayers.Projection>} When passed a externalProjection and
 
39
     *     internalProjection, the format will reproject the geometries it
 
40
     *     reads or writes. The internalProjection is the projection used by
 
41
     *     the geometries which are returned by read or which are passed into
 
42
     *     write.  In order to reproject, a projection transformation function
 
43
     *     for the specified projections must be available. This support may be
 
44
     *     provided via proj4js or via a custom transformation function. See
 
45
     *     {<OpenLayers.Projection.addTransform>} for more information on
 
46
     *     custom transformations.
 
47
     */
 
48
    internalProjection: null,
 
49
 
 
50
    /**
 
51
     * Constructor: OpenLayers.Format
 
52
     * Instances of this class are not useful.  See one of the subclasses.
 
53
     *
 
54
     * Parameters:
 
55
     * options - {Object} An optional object with properties to set on the
 
56
     *           format
 
57
     *
 
58
     * Returns:
 
59
     * An instance of OpenLayers.Format
 
60
     */
 
61
    initialize: function(options) {
 
62
        OpenLayers.Util.extend(this, options);
 
63
        this.options = options;
 
64
    },
 
65
    
 
66
    /**
 
67
     * APIMethod: destroy
 
68
     * Clean up.
 
69
     */
 
70
    destroy: function() {
 
71
    },
 
72
 
 
73
    /**
 
74
     * Method: read
 
75
     * Read data from a string, and return an object whose type depends on the
 
76
     * subclass. 
 
77
     * 
 
78
     * Parameters:
 
79
     * data - {string} Data to read/parse.
 
80
     *
 
81
     * Returns:
 
82
     * Depends on the subclass
 
83
     */
 
84
    read: function(data) {
 
85
        OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"));
 
86
    },
 
87
    
 
88
    /**
 
89
     * Method: write
 
90
     * Accept an object, and return a string. 
 
91
     *
 
92
     * Parameters:
 
93
     * object - {Object} Object to be serialized
 
94
     *
 
95
     * Returns:
 
96
     * {String} A string representation of the object.
 
97
     */
 
98
    write: function(object) {
 
99
        OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"));
 
100
    },
 
101
 
 
102
    CLASS_NAME: "OpenLayers.Format"
 
103
});