Allow geometries to have null coordinates and add setFlatCoordinates

This commit is contained in:
Tom Payne
2013-12-03 16:59:52 +01:00
parent 580f7d2022
commit 1a9d19a2fb
13 changed files with 216 additions and 26 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View 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');

View File

@@ -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;

View File

@@ -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;