From 98340c55ce506445c31f30b6ea77110d24b238a5 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 15 Oct 2012 19:11:02 +0200 Subject: [PATCH 1/4] Don't use goog.* functions in examples --- examples/side-by-side.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/side-by-side.js b/examples/side-by-side.js index 1a8f82fbae..61e9fdb3a5 100644 --- a/examples/side-by-side.js +++ b/examples/side-by-side.js @@ -39,7 +39,7 @@ var webglMap = new ol.Map({ renderer: ol.RendererHint.WEBGL, target: 'webglMap' }); -if (!goog.isNull(webglMap)) { +if (webglMap !== null) { webglMap.bindTo('center', domMap); webglMap.bindTo('layers', domMap); webglMap.bindTo('resolution', domMap); From b45c2ca4bc6d8ace796896f684423d107fa64476 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 15 Oct 2012 19:11:51 +0200 Subject: [PATCH 2/4] Add optional argument to @exportSymbol --- bin/generate-exports | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/generate-exports b/bin/generate-exports index 4239c8eed7..49360b47d7 100755 --- a/bin/generate-exports +++ b/bin/generate-exports @@ -114,9 +114,10 @@ class ObjectLiteral(Exportable): class Symbol(Exportable): - def __init__(self, name, export_symbol): + def __init__(self, name, export_symbol, export_as=None): Exportable.__init__(self, name) self.export_symbol = export_symbol + self.export_as = export_as or self.name self.props = set() __repr__ = simplerepr @@ -124,7 +125,7 @@ class Symbol(Exportable): def export(self): lines = [] if self.export_symbol: - lines.append('\n\ngoog.exportSymbol(\n \'%s\',\n %s);\n' % (self.name, self.name)) + lines.append('\n\ngoog.exportSymbol(\n \'%s\',\n %s);\n' % (self.name, self.export_as)) lines.extend('goog.exportProperty(\n %s,\n \'%s\',\n %s.%s);\n' % (self.name, prop, self.name, prop) for prop in sorted(self.props)) return ''.join(lines) @@ -193,14 +194,16 @@ def main(argv): objects[name] = symbol symbol.props.add(prop) continue - m = re.match(r'@exportSymbol\s+(?P\S+)\Z', line) + m = re.match(r'@exportSymbol\s+(?P\S+)(?:\s+(?P\S+))?\Z', line) if m: name = m.group('name') if name in objects: raise RuntimeError(line) # Name already defined - symbol = Symbol(name, True) + export_as = m.group('export_as') + symbol = Symbol(name, True, export_as) objects[name] = symbol - requires.add(name) + if not export_as: + requires.add(name) continue raise RuntimeError(line) From f9302ab0301a74ccc2f0505534eabfbf768d289d Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 15 Oct 2012 19:12:06 +0200 Subject: [PATCH 3/4] Export goog.require as goog.nullFunction --- src/ol/exports.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ol/exports.txt b/src/ol/exports.txt index cea5105990..6b6d09418c 100644 --- a/src/ol/exports.txt +++ b/src/ol/exports.txt @@ -1,3 +1,5 @@ +@exportSymbol goog.require goog.nullFunction + @exportProperty ol.MapBrowserEvent.prototype.getCoordinate @exportSymbol ol.Collection From f7adc1ae753b1e05f026d54691becb1727443b45 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 15 Oct 2012 19:12:55 +0200 Subject: [PATCH 4/4] Use identical code in compiled and standalone examples --- .../standalone/full-screen-standalone.html | 14 +-- .../overlay-and-popup-standalone.html | 36 +------- .../standalone/side-by-side-standalone.html | 88 +------------------ 3 files changed, 3 insertions(+), 135 deletions(-) diff --git a/examples/standalone/full-screen-standalone.html b/examples/standalone/full-screen-standalone.html index b44f01358a..afb0f97f38 100644 --- a/examples/standalone/full-screen-standalone.html +++ b/examples/standalone/full-screen-standalone.html @@ -18,18 +18,6 @@
- + diff --git a/examples/standalone/overlay-and-popup-standalone.html b/examples/standalone/overlay-and-popup-standalone.html index efd99db820..e1293b1c54 100644 --- a/examples/standalone/overlay-and-popup-standalone.html +++ b/examples/standalone/overlay-and-popup-standalone.html @@ -77,40 +77,6 @@ - + diff --git a/examples/standalone/side-by-side-standalone.html b/examples/standalone/side-by-side-standalone.html index 425dfb6409..e28c0425a7 100644 --- a/examples/standalone/side-by-side-standalone.html +++ b/examples/standalone/side-by-side-standalone.html @@ -66,92 +66,6 @@

Notes: The two maps share the same center, resolution, rotation and layers.

- +