From 30736fbe88324dc58e4fb8511fbce97f05ea200d Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Fri, 20 Dec 2013 16:41:53 +0100 Subject: [PATCH 1/3] Don't attempt to fit views to empty extents --- src/ol/view2d.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ol/view2d.js b/src/ol/view2d.js index e2c07f90b4..057337f514 100644 --- a/src/ol/view2d.js +++ b/src/ol/view2d.js @@ -416,10 +416,12 @@ ol.View2D.prototype.getZoom = function() { * @todo stability experimental */ ol.View2D.prototype.fitExtent = function(extent, size) { - this.setCenter(ol.extent.getCenter(extent)); - var resolution = this.getResolutionForExtent(extent, size); - resolution = this.constrainResolution(resolution, 0, 0); - this.setResolution(resolution); + if (!ol.extent.isEmpty(extent)) { + this.setCenter(ol.extent.getCenter(extent)); + var resolution = this.getResolutionForExtent(extent, size); + resolution = this.constrainResolution(resolution, 0, 0); + this.setResolution(resolution); + } }; From ead127aaec40d74ab96f0372da60acfb39a1549c Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Sat, 21 Dec 2013 09:23:40 +0100 Subject: [PATCH 2/3] Export ol.proj.Projection#getUnits Fixes #1365 --- src/ol/proj.exports | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ol/proj.exports b/src/ol/proj.exports index 18aa42ab25..79616aca0a 100644 --- a/src/ol/proj.exports +++ b/src/ol/proj.exports @@ -1,6 +1,7 @@ @exportSymbol ol.proj.Projection @exportProperty ol.proj.Projection.prototype.getCode @exportProperty ol.proj.Projection.prototype.getExtent +@exportProperty ol.proj.Projection.prototype.getUnits @exportSymbol ol.proj.Units @exportProperty ol.proj.Units.DEGREES From e9984334a6d421619c8f4dc28416b9457c5ecbea Mon Sep 17 00:00:00 2001 From: Peter Robins Date: Sun, 29 Dec 2013 12:00:43 -0500 Subject: [PATCH 3/3] Make build.py compatible with Python 2.6 --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index c001fd0f2d..053b20cd2b 100755 --- a/build.py +++ b/build.py @@ -159,7 +159,7 @@ def report_sizes(t): gzipfile.close() rawsize = os.stat(t.name).st_size gzipsize = len(stringio.getvalue()) - savings = '{:.2%}'.format((rawsize - gzipsize)/float(rawsize)) + savings = '{0:.2%}'.format((rawsize - gzipsize)/float(rawsize)) t.info('uncompressed: %8d bytes', rawsize) t.info(' compressed: %8d bytes, (saved %s)', gzipsize, savings)