]> dev.renevier.net Git - syp.git/blob - openlayers/lib/OpenLayers/Geometry/MultiPoint.js
initial commit
[syp.git] / openlayers / lib / OpenLayers / Geometry / MultiPoint.js
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/Geometry/Collection.js
7  * @requires OpenLayers/Geometry/Point.js
8  */
9
10 /**
11  * Class: OpenLayers.Geometry.MultiPoint
12  * MultiPoint is a collection of Points.  Create a new instance with the
13  * <OpenLayers.Geometry.MultiPoint> constructor.
14  *
15  * Inherits from:
16  *  - <OpenLayers.Geometry.Collection>
17  *  - <OpenLayers.Geometry>
18  */
19 OpenLayers.Geometry.MultiPoint = OpenLayers.Class(
20   OpenLayers.Geometry.Collection, {
21
22     /**
23      * Property: componentTypes
24      * {Array(String)} An array of class names representing the types of
25      * components that the collection can include.  A null value means the
26      * component types are not restricted.
27      */
28     componentTypes: ["OpenLayers.Geometry.Point"],
29
30     /**
31      * Constructor: OpenLayers.Geometry.MultiPoint
32      * Create a new MultiPoint Geometry
33      *
34      * Parameters:
35      * components - {Array(<OpenLayers.Geometry.Point>)} 
36      *
37      * Returns:
38      * {<OpenLayers.Geometry.MultiPoint>}
39      */
40     initialize: function(components) {
41         OpenLayers.Geometry.Collection.prototype.initialize.apply(this, 
42                                                                   arguments);
43     },
44
45     /**
46      * APIMethod: addPoint
47      * Wrapper for <OpenLayers.Geometry.Collection.addComponent>
48      *
49      * Parameters:
50      * point - {<OpenLayers.Geometry.Point>} Point to be added
51      * index - {Integer} Optional index
52      */
53     addPoint: function(point, index) {
54         this.addComponent(point, index);
55     },
56     
57     /**
58      * APIMethod: removePoint
59      * Wrapper for <OpenLayers.Geometry.Collection.removeComponent>
60      *
61      * Parameters:
62      * point - {<OpenLayers.Geometry.Point>} Point to be removed
63      */
64     removePoint: function(point){
65         this.removeComponent(point);
66     },
67
68     CLASS_NAME: "OpenLayers.Geometry.MultiPoint"
69 });