Toward natural JavaScript syntax
This commit is contained in:
@@ -44,7 +44,7 @@ ol.geom.flat.orient.linearRingIsClockwise =
|
||||
*/
|
||||
ol.geom.flat.orient.linearRingsAreOriented =
|
||||
function(flatCoordinates, offset, ends, stride, opt_right) {
|
||||
var right = ol.isDef(opt_right) ? opt_right : false;
|
||||
var right = opt_right !== undefined ? opt_right : false;
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
var end = ends[i];
|
||||
@@ -106,7 +106,7 @@ ol.geom.flat.orient.linearRingssAreOriented =
|
||||
*/
|
||||
ol.geom.flat.orient.orientLinearRings =
|
||||
function(flatCoordinates, offset, ends, stride, opt_right) {
|
||||
var right = ol.isDef(opt_right) ? opt_right : false;
|
||||
var right = opt_right !== undefined ? opt_right : false;
|
||||
var i, ii;
|
||||
for (i = 0, ii = ends.length; i < ii; ++i) {
|
||||
var end = ends[i];
|
||||
|
||||
@@ -149,8 +149,7 @@ ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
||||
this.layout != ol.geom.GeometryLayout.XYZM) {
|
||||
return null;
|
||||
}
|
||||
var extrapolate = ol.isDef(opt_extrapolate) ?
|
||||
/** @type {boolean} */ (opt_extrapolate) : false;
|
||||
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
||||
return ol.geom.flat.lineStringCoordinateAtM(this.flatCoordinates, 0,
|
||||
this.flatCoordinates.length, this.stride, m, extrapolate);
|
||||
};
|
||||
|
||||
@@ -136,10 +136,8 @@ ol.geom.MultiLineString.prototype.getCoordinateAtM =
|
||||
this.flatCoordinates.length === 0) {
|
||||
return null;
|
||||
}
|
||||
var extrapolate = ol.isDef(opt_extrapolate) ?
|
||||
/** @type {boolean} */ (opt_extrapolate) : false;
|
||||
var interpolate = ol.isDef(opt_interpolate) ?
|
||||
/** @type {boolean} */ (opt_interpolate) : false;
|
||||
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
||||
var interpolate = opt_interpolate !== undefined ? opt_interpolate : false;
|
||||
return ol.geom.flat.lineStringsCoordinateAtM(this.flatCoordinates, 0,
|
||||
this.ends_, this.stride, m, extrapolate, interpolate);
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ ol.geom.MultiPolygon.prototype.getArea = function() {
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.getCoordinates = function(opt_right) {
|
||||
var flatCoordinates;
|
||||
if (ol.isDef(opt_right)) {
|
||||
if (opt_right !== undefined) {
|
||||
flatCoordinates = this.getOrientedFlatCoordinates().slice();
|
||||
ol.geom.flat.orient.orientLinearRingss(
|
||||
flatCoordinates, 0, this.endss_, this.stride, opt_right);
|
||||
|
||||
@@ -170,7 +170,7 @@ ol.geom.Polygon.prototype.getArea = function() {
|
||||
*/
|
||||
ol.geom.Polygon.prototype.getCoordinates = function(opt_right) {
|
||||
var flatCoordinates;
|
||||
if (ol.isDef(opt_right)) {
|
||||
if (opt_right !== undefined) {
|
||||
flatCoordinates = this.getOrientedFlatCoordinates().slice();
|
||||
ol.geom.flat.orient.orientLinearRings(
|
||||
flatCoordinates, 0, this.ends_, this.stride, opt_right);
|
||||
|
||||
Reference in New Issue
Block a user