Skip to content

Commit

Permalink
Correct indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
servetg committed Sep 19, 2015
1 parent 0888de1 commit 54f5c00
Show file tree
Hide file tree
Showing 14 changed files with 943 additions and 489 deletions.
472 changes: 472 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions src/formats/geojson/GeoJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
/**
* @exports GeoJSON
*/
define([
'../../error/ArgumentError',
define(['../../error/ArgumentError',
'../../util/Color',
'./GeoJSONConstants',
'./GeoJSONFeature',
Expand Down Expand Up @@ -570,7 +569,7 @@ define([
for (var pointsIndex = 0, points = geometry.coordinates; pointsIndex < points.length; pointsIndex++) {
var longitude = points[pointsIndex][0],
latitude = points[pointsIndex][1],
//altitude = points[pointsIndex][2] ? points[pointsIndex][2] : 0,
//altitude = points[pointsIndex][2] ? points[pointsIndex][2] : 0,
position;
position = new Location(latitude, longitude);
positions.push(position);
Expand Down Expand Up @@ -620,7 +619,7 @@ define([
for (var positionIndex = 0, points = lines[linesIndex]; positionIndex < points.length; positionIndex++) {
var longitude = points[positionIndex][0],
latitude = points[positionIndex][1],
//altitude = points[positionIndex][2] ? points[positionIndex][2] : 0,
//altitude = points[positionIndex][2] ? points[positionIndex][2] : 0,
position;
position = new Location(latitude, longitude);
positions.push(position);
Expand Down Expand Up @@ -671,7 +670,7 @@ define([
for (var positionIndex = 0, points = boundaries[boundariesIndex]; positionIndex < points.length; positionIndex++) {
var longitude = points[positionIndex][0],
latitude = points[positionIndex][1],
//altitude = points[positionIndex][2] ? points[positionIndex][2] : 0,
//altitude = points[positionIndex][2] ? points[positionIndex][2] : 0,
position;
position = new Location(latitude, longitude);
positions.push(position);
Expand Down Expand Up @@ -724,8 +723,8 @@ define([
for (var positionIndex = 0, points = polygons[polygonsIndex][boundariesIndex]; positionIndex < points.length; positionIndex++) {
var longitude = points[positionIndex][0],
latitude = points[positionIndex][1],
//altitude = points[positionIndex][2] ? points[positionIndex][2] : 0,;
position = new Location(latitude, longitude);
//altitude = points[positionIndex][2] ? points[positionIndex][2] : 0,;
position = new Location(latitude, longitude);
positions.push(position);
}
boundaries.push(positions);
Expand Down
131 changes: 65 additions & 66 deletions src/formats/geojson/GeoJSONCRS.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,77 @@
/**
* @exports GeoJSONCRS
*/
define([
'../../error/ArgumentError',
'./GeoJSONConstants',
'../../util/Logger'
], function(
ArgumentError,
GeoJSONConstants,
Logger
){
"use strict";
define(['../../error/ArgumentError',
'./GeoJSONConstants',
'../../util/Logger'
],
function (ArgumentError,
GeoJSONConstants,
Logger){
"use strict";

/**
* Constructs a GeoJSON CRS object. Applications typically do not call this constructor. It is called by
* {@link GeoJSONGeometry} ,{@link GeoJSONFeature} or {@link GeoJSONGeometry}.
* @alias GeoJSONCRS
* @constructor
* @classdesc Contains the data associated with a GeoJSON Coordinate Reference System object.
* @param {String} type A string, indicating the type of CRS object.
* @param {Object} properties An object containing the properties of CRS object.
* @throws {ArgumentError} If the specified type or properties are null or undefined.
*/
var GeoJSONCRS = function (type, properties) {
/*
The coordinate reference system (CRS) of a GeoJSON object is determined by its "crs" member (referred to as the CRS object below).
If an object has no crs member, then its parent or grandparent object's crs member may be acquired.
If no crs member can be so acquired, the default CRS shall apply to the GeoJSON object.
The default CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of decimal degrees.
/**
* Constructs a GeoJSON CRS object. Applications typically do not call this constructor. It is called by
* {@link GeoJSONGeometry} ,{@link GeoJSONFeature} or {@link GeoJSONGeometry}.
* @alias GeoJSONCRS
* @constructor
* @classdesc Contains the data associated with a GeoJSON Coordinate Reference System object.
* @param {String} type A string, indicating the type of CRS object.
* @param {Object} properties An object containing the properties of CRS object.
* @throws {ArgumentError} If the specified type or properties are null or undefined.
*/
var GeoJSONCRS = function (type, properties) {
/*
The coordinate reference system (CRS) of a GeoJSON object is determined by its "crs" member (referred to as the CRS object below).
If an object has no crs member, then its parent or grandparent object's crs member may be acquired.
If no crs member can be so acquired, the default CRS shall apply to the GeoJSON object.
The default CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of decimal degrees.
*/

if (!type) {
throw new ArgumentError(
Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONCRS", "constructor",
"missingType"));
}
if (!type) {
throw new ArgumentError(
Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONCRS", "constructor",
"missingType"));
}

if (!properties) {
throw new ArgumentError(
Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONCRS", "constructor",
"missingProperties"));
}
if (!properties) {
throw new ArgumentError(
Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONCRS", "constructor",
"missingProperties"));
}

// Documented in defineProperties below.
this._type = type;
// Documented in defineProperties below.
this._type = type;

// Documented in defineProperties below.
this._properties = properties;
};
// Documented in defineProperties below.
this._properties = properties;
};

Object.defineProperties(GeoJSONCRS.prototype, {
/**
* The GeoJSON CRS object type as specified to this GeoJSON CRS's constructor.
* @memberof GeoJSONCRS.prototype
* @type {String}
* @readonly
*/
type: {
get: function () {
return this._type;
}
},
/**
* The GeoJSON CRS object properties as specified to this GeoJSON CRS's constructor.
* @memberof GeoJSONCRS.prototype
* @type {String}
* @readonly
*/
properties: {
get: function () {
return this._properties;
Object.defineProperties(GeoJSONCRS.prototype, {
/**
* The GeoJSON CRS object type as specified to this GeoJSON CRS's constructor.
* @memberof GeoJSONCRS.prototype
* @type {String}
* @readonly
*/
type: {
get: function () {
return this._type;
}
},
/**
* The GeoJSON CRS object properties as specified to this GeoJSON CRS's constructor.
* @memberof GeoJSONCRS.prototype
* @type {String}
* @readonly
*/
properties: {
get: function () {
return this._properties;
}
}
}
});
});

return GeoJSONCRS;
});
return GeoJSONCRS;
}
);
66 changes: 33 additions & 33 deletions src/formats/geojson/GeoJSONConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@
/**
* @exports GeoJSONConstants
*/
define([
], function(
){
"use strict";
define([],
function() {
"use strict";

/**
* Provides GeoJSON string constants.
* @alias GeoJSONConstants
* @constructor
* @classdesc Contains some GeoJSON string constants.
*/
var GeoJSONConstants = function () {};
/**
* Provides GeoJSON string constants.
* @alias GeoJSONConstants
* @constructor
* @classdesc Contains some GeoJSON string constants.
*/
var GeoJSONConstants = function () {};

GeoJSONConstants.FIELD_TYPE = "type";
GeoJSONConstants.FIELD_CRS = "crs";
GeoJSONConstants.FIELD_NAME = "name";
GeoJSONConstants.FIELD_BBOX = "bbox";
GeoJSONConstants.FIELD_COORDINATES = "coordinates";
GeoJSONConstants.FIELD_GEOMETRIES = "geometries";
GeoJSONConstants.FIELD_GEOMETRY = "geometry";
GeoJSONConstants.FIELD_PROPERTIES = "properties";
GeoJSONConstants.FIELD_FEATURES = "features";
GeoJSONConstants.FIELD_ID = "id";
GeoJSONConstants.FIELD_TYPE = "type";
GeoJSONConstants.FIELD_CRS = "crs";
GeoJSONConstants.FIELD_NAME = "name";
GeoJSONConstants.FIELD_BBOX = "bbox";
GeoJSONConstants.FIELD_COORDINATES = "coordinates";
GeoJSONConstants.FIELD_GEOMETRIES = "geometries";
GeoJSONConstants.FIELD_GEOMETRY = "geometry";
GeoJSONConstants.FIELD_PROPERTIES = "properties";
GeoJSONConstants.FIELD_FEATURES = "features";
GeoJSONConstants.FIELD_ID = "id";

GeoJSONConstants.TYPE_POINT = "Point";
GeoJSONConstants.TYPE_MULTI_POINT = "MultiPoint";
GeoJSONConstants.TYPE_LINE_STRING = "LineString";
GeoJSONConstants.TYPE_MULTI_LINE_STRING = "MultiLineString";
GeoJSONConstants.TYPE_POLYGON = "Polygon";
GeoJSONConstants.TYPE_MULTI_POLYGON = "MultiPolygon";
GeoJSONConstants.TYPE_GEOMETRY_COLLECTION = "GeometryCollection";
GeoJSONConstants.TYPE_FEATURE = "Feature";
GeoJSONConstants.TYPE_FEATURE_COLLECTION = "FeatureCollection";
GeoJSONConstants.TYPE_POINT = "Point";
GeoJSONConstants.TYPE_MULTI_POINT = "MultiPoint";
GeoJSONConstants.TYPE_LINE_STRING = "LineString";
GeoJSONConstants.TYPE_MULTI_LINE_STRING = "MultiLineString";
GeoJSONConstants.TYPE_POLYGON = "Polygon";
GeoJSONConstants.TYPE_MULTI_POLYGON = "MultiPolygon";
GeoJSONConstants.TYPE_GEOMETRY_COLLECTION = "GeometryCollection";
GeoJSONConstants.TYPE_FEATURE = "Feature";
GeoJSONConstants.TYPE_FEATURE_COLLECTION = "FeatureCollection";

GeoJSONConstants.WGS84_CRS = "urn:ogc:def:crs:OGC:1.3:CRS84";
GeoJSONConstants.WGS84_CRS = "urn:ogc:def:crs:OGC:1.3:CRS84";

return GeoJSONConstants;
});
return GeoJSONConstants;
}
);


Loading

0 comments on commit 54f5c00

Please sign in to comment.