conflicts later on. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2920 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
|
|
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
|
|
* for the full text of the license. */
|
|
|
|
/**
|
|
* @class
|
|
*
|
|
* A MultiLineString is a collection of LineStrings
|
|
*
|
|
* @requires OpenLayers/Geometry/Collection.js
|
|
*/
|
|
OpenLayers.Geometry.MultiLineString = OpenLayers.Class.create();
|
|
OpenLayers.Geometry.MultiLineString.prototype =
|
|
OpenLayers.Class.inherit(OpenLayers.Geometry.Collection, {
|
|
|
|
/**
|
|
* @constructor
|
|
*
|
|
* @param {Array(OpenLayers.Geometry.LineString)} components
|
|
*/
|
|
initialize: function(components) {
|
|
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,
|
|
arguments);
|
|
},
|
|
|
|
/**
|
|
* adds a component to the MultiPoint, checking type
|
|
*
|
|
* @param {OpenLayers.Geometry.LineString} component lineString to add
|
|
* @param {int} index Index into the array to insert the component
|
|
*/
|
|
addComponent: function(component, index) {
|
|
if (!(component instanceof OpenLayers.Geometry.LineString)) {
|
|
throw "component should be an OpenLayers.Geometry.LineString";
|
|
}
|
|
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,
|
|
arguments);
|
|
},
|
|
|
|
/** @final @type String */
|
|
CLASS_NAME: "OpenLayers.Geometry.MultiLineString"
|
|
});
|