Rename ol.geom.Layout to ol.geom.GeometryLayout

This commit is contained in:
Tom Payne
2013-12-04 16:27:03 +01:00
parent 600cb3a0ff
commit c2228b1d19
13 changed files with 71 additions and 70 deletions

View File

@@ -27,7 +27,7 @@ ol.geom.Type = {
/**
* @enum {string}
*/
ol.geom.Layout = {
ol.geom.GeometryLayout = {
XY: 'XY',
XYZ: 'XYZ',
XYM: 'XYM',
@@ -46,9 +46,9 @@ ol.geom.Geometry = function() {
/**
* @protected
* @type {ol.geom.Layout}
* @type {ol.geom.GeometryLayout}
*/
this.layout = ol.geom.Layout.XY;
this.layout = ol.geom.GeometryLayout.XY;
/**
* @protected
@@ -87,15 +87,15 @@ goog.inherits(ol.geom.Geometry, goog.events.EventTarget);
/**
* @param {number} stride Stride.
* @private
* @return {ol.geom.Layout} layout Layout.
* @return {ol.geom.GeometryLayout} layout Layout.
*/
ol.geom.Geometry.getLayoutForStride_ = function(stride) {
if (stride == 2) {
return ol.geom.Layout.XY;
return ol.geom.GeometryLayout.XY;
} else if (stride == 3) {
return ol.geom.Layout.XYZ;
return ol.geom.GeometryLayout.XYZ;
} else if (stride == 4) {
return ol.geom.Layout.XYZM;
return ol.geom.GeometryLayout.XYZM;
} else {
throw new Error('unsupported stride: ' + stride);
}
@@ -103,18 +103,18 @@ ol.geom.Geometry.getLayoutForStride_ = function(stride) {
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @private
* @return {number} Stride.
*/
ol.geom.Geometry.getStrideForLayout_ = function(layout) {
if (layout == ol.geom.Layout.XY) {
if (layout == ol.geom.GeometryLayout.XY) {
return 2;
} else if (layout == ol.geom.Layout.XYZ) {
} else if (layout == ol.geom.GeometryLayout.XYZ) {
return 3;
} else if (layout == ol.geom.Layout.XYM) {
} else if (layout == ol.geom.GeometryLayout.XYM) {
return 3;
} else if (layout == ol.geom.Layout.XYZM) {
} else if (layout == ol.geom.GeometryLayout.XYZM) {
return 4;
} else {
throw new Error('unsupported layout: ' + layout);
@@ -172,7 +172,7 @@ ol.geom.Geometry.prototype.getFlatCoordinates = function() {
/**
* @return {ol.geom.Layout} Layout.
* @return {ol.geom.GeometryLayout} Layout.
*/
ol.geom.Geometry.prototype.getLayout = function() {
return this.layout;
@@ -202,7 +202,7 @@ ol.geom.Geometry.prototype.getType = goog.abstractMethod;
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @protected
*/
@@ -215,7 +215,7 @@ ol.geom.Geometry.prototype.setFlatCoordinatesInternal =
/**
* @param {ol.geom.Layout|undefined} layout Layout.
* @param {ol.geom.GeometryLayout|undefined} layout Layout.
* @param {Array} coordinates Coordinates.
* @param {number} nesting Nesting.
* @protected
@@ -230,7 +230,7 @@ ol.geom.Geometry.prototype.setLayout =
var i;
for (i = 0; i < nesting; ++i) {
if (coordinates.length === 0) {
this.layout = ol.geom.Layout.XY;
this.layout = ol.geom.GeometryLayout.XY;
this.stride = 2;
return;
} else {

View File

@@ -9,7 +9,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawLinearRing} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.LinearRing = function(coordinates, opt_layout) {
goog.base(this);
@@ -46,7 +46,7 @@ ol.geom.LinearRing.prototype.getType = function() {
/**
* @param {ol.geom.RawLinearRing} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.LinearRing.prototype.setCoordinates =
function(coordinates, opt_layout) {

View File

@@ -9,7 +9,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawLineString} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.LineString = function(coordinates, opt_layout) {
goog.base(this);
@@ -46,12 +46,12 @@ ol.geom.LineString.prototype.getType = function() {
/**
* @param {ol.geom.RawLineString} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.LineString.prototype.setCoordinates =
function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
this.setFlatCoordinates(ol.geom.Layout.XY, null);
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
} else {
this.setLayout(opt_layout, coordinates, 1);
if (goog.isNull(this.flatCoordinates)) {
@@ -65,7 +65,7 @@ ol.geom.LineString.prototype.setCoordinates =
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
*/
ol.geom.LineString.prototype.setFlatCoordinates =

View File

@@ -10,7 +10,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawMultiLineString} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.MultiLineString = function(coordinates, opt_layout) {
@@ -70,12 +70,12 @@ ol.geom.MultiLineString.prototype.getType = function() {
/**
* @param {ol.geom.RawMultiLineString} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.MultiLineString.prototype.setCoordinates =
function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
this.setFlatCoordinates(ol.geom.Layout.XY, null, this.ends_);
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.ends_);
} else {
this.setLayout(opt_layout, coordinates, 2);
if (goog.isNull(this.flatCoordinates)) {
@@ -90,7 +90,7 @@ ol.geom.MultiLineString.prototype.setCoordinates =
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array.<number>} ends Ends.
*/

View File

@@ -10,7 +10,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawMultiPoint} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.MultiPoint = function(coordinates, opt_layout) {
goog.base(this);
@@ -53,12 +53,12 @@ ol.geom.MultiPoint.prototype.getType = function() {
/**
* @param {ol.geom.RawMultiPoint} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.MultiPoint.prototype.setCoordinates =
function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
this.setFlatCoordinates(ol.geom.Layout.XY, null);
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
} else {
this.setLayout(opt_layout, coordinates, 1);
if (goog.isNull(this.flatCoordinates)) {
@@ -72,7 +72,7 @@ ol.geom.MultiPoint.prototype.setCoordinates =
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
*/
ol.geom.MultiPoint.prototype.setFlatCoordinates =

View File

@@ -10,7 +10,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawMultiPolygon} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.MultiPolygon = function(coordinates, opt_layout) {
@@ -115,12 +115,12 @@ ol.geom.MultiPolygon.prototype.getType = function() {
/**
* @param {ol.geom.RawMultiPolygon} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.MultiPolygon.prototype.setCoordinates =
function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
this.setFlatCoordinates(ol.geom.Layout.XY, null, this.endss_);
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.endss_);
} else {
this.setLayout(opt_layout, coordinates, 3);
if (goog.isNull(this.flatCoordinates)) {
@@ -139,7 +139,7 @@ ol.geom.MultiPolygon.prototype.setCoordinates =
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array.<Array.<number>>} endss Endss.
*/

View File

@@ -11,7 +11,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawPoint} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.Point = function(coordinates, opt_layout) {
goog.base(this);
@@ -52,11 +52,11 @@ ol.geom.Point.prototype.getType = function() {
/**
* @param {ol.geom.RawPoint} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
this.setFlatCoordinates(ol.geom.Layout.XY, null);
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null);
} else {
this.setLayout(opt_layout, coordinates, 0);
if (goog.isNull(this.flatCoordinates)) {
@@ -70,7 +70,7 @@ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
*/
ol.geom.Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) {

View File

@@ -10,7 +10,7 @@ goog.require('ol.geom.flat');
* @constructor
* @extends {ol.geom.Geometry}
* @param {ol.geom.RawPolygon} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.Polygon = function(coordinates, opt_layout) {
@@ -114,11 +114,11 @@ ol.geom.Polygon.prototype.getType = function() {
/**
* @param {ol.geom.RawPolygon} coordinates Coordinates.
* @param {ol.geom.Layout=} opt_layout Layout.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
*/
ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
this.setFlatCoordinates(ol.geom.Layout.XY, null, this.ends_);
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.ends_);
} else {
this.setLayout(opt_layout, coordinates, 2);
if (goog.isNull(this.flatCoordinates)) {
@@ -135,7 +135,7 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
/**
* @param {ol.geom.Layout} layout Layout.
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Array.<number>} ends Ends.
*/