Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Getting the nanometer precision we deserve with web mercator

  • Loading branch information...
commit 216d30ddc1a948b469ab884f6bd15cf1d6e03db9 1 parent 3cf3ef6
Tim Schaub tschaub authored
2  src/ol/geom/linearring.js
View
@@ -1,7 +1,7 @@
goog.provide('ol.geom.LinearRing');
goog.require('goog.asserts');
-goog.require('goog.vec.Float32Array');
+goog.require('goog.vec.Float64Array');
goog.require('ol.geom.CoordinateArray');
goog.require('ol.geom.LineString');
6 src/ol/geom/linestring.js
View
@@ -1,7 +1,7 @@
goog.provide('ol.geom.LineString');
goog.require('goog.asserts');
-goog.require('goog.vec.Float32Array');
+goog.require('goog.vec.Float64Array');
goog.require('ol.geom.CoordinateArray');
goog.require('ol.geom.Geometry');
@@ -21,9 +21,9 @@ ol.geom.LineString = function(coordinates) {
length = count * dimension;
/**
- * @type {Float32Array}
+ * @type {Float64Array}
*/
- this.coordinates = new Float32Array(length);
+ this.coordinates = new Float64Array(length);
for (var i = 0; i < count; ++i) {
goog.asserts.assert(coordinates[i].length === dimension);
this.coordinates.set(coordinates[i], i * dimension);
6 src/ol/geom/point.js
View
@@ -1,7 +1,7 @@
goog.provide('ol.geom.Point');
goog.require('goog.asserts');
-goog.require('goog.vec.Float32Array');
+goog.require('goog.vec.Float64Array');
goog.require('ol.geom.Coordinate');
goog.require('ol.geom.Geometry');
@@ -15,9 +15,9 @@ goog.require('ol.geom.Geometry');
ol.geom.Point = function(coordinates) {
/**
- * @type {Float32Array}
+ * @type {Float64Array}
*/
- this.coordinates = new Float32Array(coordinates);
+ this.coordinates = new Float64Array(coordinates);
/**
* @type {number}
2  src/ol/geom/polygon.js
View
@@ -1,7 +1,7 @@
goog.provide('ol.geom.Polygon');
goog.require('goog.asserts');
-goog.require('goog.vec.Float32Array');
+goog.require('goog.vec.Float64Array');
goog.require('ol.geom.CoordinateArray');
goog.require('ol.geom.Geometry');
goog.require('ol.geom.LinearRing');
4 test/spec/ol/geom/linearring.test.js
View
@@ -17,9 +17,9 @@ describe('ol.geom.LinearRing', function() {
describe('coordinates', function() {
- it('is a Float32Array', function() {
+ it('is a Float64Array', function() {
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
- expect(ring.coordinates).toBeA(Float32Array);
+ expect(ring.coordinates).toBeA(Float64Array);
expect(ring.coordinates.length).toBe(4);
expect(ring.coordinates[0]).toBe(10);
4 test/spec/ol/geom/linestring.test.js
View
@@ -17,9 +17,9 @@ describe('ol.geom.LineString', function() {
describe('coordinates', function() {
- it('is a Float32Array', function() {
+ it('is a Float64Array', function() {
var line = new ol.geom.LineString([[10, 20], [30, 40]]);
- expect(line.coordinates).toBeA(Float32Array);
+ expect(line.coordinates).toBeA(Float64Array);
expect(line.coordinates.length).toBe(4);
expect(line.coordinates[0]).toBe(10);
4 test/spec/ol/geom/point.test.js
View
@@ -17,9 +17,9 @@ describe('ol.geom.Point', function() {
describe('coordinates', function() {
- it('is a Float32Array', function() {
+ it('is a Float64Array', function() {
var point = new ol.geom.Point([10, 20]);
- expect(point.coordinates).toBeA(Float32Array);
+ expect(point.coordinates).toBeA(Float64Array);
expect(point.coordinates.length).toBe(2);
expect(point.coordinates[0]).toBe(10);
Please sign in to comment.
Something went wrong with that request. Please try again.