Merge pull request #3401 from tschaub/geojson-orientation

Allow GeoJSON to be serialized according to the right-hand rule.
This commit is contained in:
Tim Schaub
2015-03-26 08:44:57 -06:00
10 changed files with 427 additions and 36 deletions
+20 -2
View File
@@ -1538,7 +1538,8 @@ olx.format;
/**
* @typedef {{dataProjection: ol.proj.ProjectionLike,
* featureProjection: ol.proj.ProjectionLike}}
* featureProjection: ol.proj.ProjectionLike,
* rightHanded: (boolean|undefined)}}
* @api
*/
olx.format.ReadOptions;
@@ -1567,7 +1568,8 @@ olx.format.ReadOptions.prototype.featureProjection;
/**
* @typedef {{dataProjection: ol.proj.ProjectionLike,
* featureProjection: ol.proj.ProjectionLike}}
* featureProjection: ol.proj.ProjectionLike,
* rightHanded: (boolean|undefined)}}
* @api
*/
olx.format.WriteOptions;
@@ -1593,6 +1595,22 @@ olx.format.WriteOptions.prototype.dataProjection;
olx.format.WriteOptions.prototype.featureProjection;
/**
* When writing geometries, follow the right-hand rule for linear ring
* orientation. This means that polygons will have counter-clockwise exterior
* rings and clockwise interior rings. By default, coordinates are serialized
* as they are provided at construction. If `true`, the right-hand rule will
* be applied. If `false`, the left-hand rule will be applied (clockwise for
* exterior and counter-clockwise for interior rings). Note that not all
* formats support this. The GeoJSON format does use this property when writing
* geometries.
*
* @type {boolean|undefined}
* @api
*/
olx.format.WriteOptions.prototype.rightHanded;
/**
* @typedef {{defaultDataProjection: ol.proj.ProjectionLike,
* geometryName: (string|undefined)}}