Allow geometries to have null coordinates and add setFlatCoordinates
This commit is contained in:
@@ -3,6 +3,13 @@ goog.provide('ol.test.geom.LineString');
|
||||
|
||||
describe('ol.geom.LineString', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
var lineString = new ol.geom.LineString(null);
|
||||
lineString = lineString; // suppress gjslint warning
|
||||
}).not.to.throwException();
|
||||
});
|
||||
|
||||
describe('construct empty', function() {
|
||||
|
||||
var lineString;
|
||||
|
||||
@@ -3,6 +3,13 @@ goog.provide('ol.test.geom.MultiLineString');
|
||||
|
||||
describe('ol.geom.MultiLineString', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
var multiLineString = new ol.geom.MultiLineString(null);
|
||||
multiLineString = multiLineString; // suppress gjslint warning
|
||||
}).not.to.throwException();
|
||||
});
|
||||
|
||||
describe('construct empty', function() {
|
||||
|
||||
var multiLineString;
|
||||
|
||||
@@ -3,6 +3,13 @@ goog.provide('ol.test.geom.MultiPoint');
|
||||
|
||||
describe('ol.geom.MultiPoint', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
var multiPoint = new ol.geom.MultiPoint(null);
|
||||
multiPoint = multiPoint; // suppress gjslint warning
|
||||
}).not.to.throwException();
|
||||
});
|
||||
|
||||
describe('construct empty', function() {
|
||||
|
||||
var multiPoint;
|
||||
|
||||
16
test/spec/ol/geom/multipolygon.test.js
Normal file
16
test/spec/ol/geom/multipolygon.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
goog.provide('ol.test.geom.MultiPolygon');
|
||||
|
||||
|
||||
describe('ol.geom.MultiPolygon', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
var multiPolygon = new ol.geom.MultiPolygon(null);
|
||||
multiPolygon = multiPolygon; // suppress gjslint warning
|
||||
}).not.to.throwException();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
@@ -3,6 +3,13 @@ goog.provide('ol.test.geom.Point');
|
||||
|
||||
describe('ol.geom.Point', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
var point = new ol.geom.Point(null);
|
||||
point = point; // suppress gjslint warning
|
||||
}).not.to.throwException();
|
||||
});
|
||||
|
||||
describe('construct with 2D coordinates', function() {
|
||||
|
||||
var point;
|
||||
|
||||
@@ -5,6 +5,13 @@ goog.provide('ol.test.geom.Polygon');
|
||||
|
||||
describe('ol.geom.Polygon', function() {
|
||||
|
||||
it('can be constructed with a null geometry', function() {
|
||||
expect(function() {
|
||||
var polygon = new ol.geom.Polygon(null);
|
||||
polygon = polygon; // suppress gjslint warning
|
||||
}).not.to.throwException();
|
||||
});
|
||||
|
||||
describe('construct empty', function() {
|
||||
|
||||
var polygon;
|
||||
|
||||
Reference in New Issue
Block a user