diff --git a/main.json b/main.json index 6177730616..5e5a6efe1f 100644 --- a/main.json +++ b/main.json @@ -1,7 +1,10 @@ { "id": "ol", - "inputs": "src/ol.js", + "inputs": [ + "src/ol.js", + "src/ol.export.js" + ], "paths": [ "src" ], @@ -20,9 +23,9 @@ "pretty-print": true, "debug": true, - "experimental-compiler-options": { - "generateExports": true - }, + // "experimental-compiler-options": { + // "generateExports": true + // }, "checks": { // acceptable values are "ERROR", "WARNING", and "OFF" diff --git a/src/api/geom/geometry.js b/src/api/geom/geometry.js index d3fbb0508d..6a636cc839 100644 --- a/src/api/geom/geometry.js +++ b/src/api/geom/geometry.js @@ -10,3 +10,17 @@ ol.geom.geometry = function(){ var g = new ol.geom.Geometry(); return g; }; + +/** + * @export + * @param {ol.Bounds=} opt_arg new Bounds. + * @return {ol.geom.Geometry|ol.Bounds|undefined} either a Geometry (when used as + * setter) or a Bounds/undefined (if used as getter). + */ +ol.geom.Geometry.prototype.bounds = function(opt_arg) { + if (arguments.length == 1 && goog.isDef(opt_arg)) { + return this.setBounds(opt_arg); + } else { + return this.getBounds(); + } +}; diff --git a/src/ol.export.js b/src/ol.export.js index 2440e88f68..20098968d9 100644 --- a/src/ol.export.js +++ b/src/ol.export.js @@ -1,14 +1,9 @@ -goog.require("ol.loc"); -goog.require("ol.feature"); -goog.require("ol.projection"); -goog.require('ol.bounds'); -goog.require("ol.map"); -goog.require("ol.layer.xyz"); -goog.require("ol.layer.osm"); +goog.require("ol"); // ol.map goog.exportSymbol('ol.map', ol.map ); goog.exportSymbol('ol.Map', ol.Map ); +goog.exportProperty( ol.Map.prototype, 'renderTo', ol.Map.prototype.renderTo ); goog.exportProperty( ol.Map.prototype, 'center', ol.Map.prototype.center ); goog.exportProperty( ol.Map.prototype, 'projection', ol.Map.prototype.projection ); goog.exportProperty( ol.Map.prototype, 'userProjection', ol.Map.prototype.userProjection ); @@ -18,7 +13,6 @@ goog.exportProperty( ol.Map.prototype, 'resolutions', ol.Map.prototype.resolutio goog.exportProperty( ol.Map.prototype, 'layers', ol.Map.prototype.layers ); goog.exportProperty( ol.Map.prototype, 'controls', ol.Map.prototype.controls ); goog.exportProperty( ol.Map.prototype, 'maxExtent', ol.Map.prototype.maxExtent ); -goog.exportProperty( ol.Map.prototype, 'maxRes', ol.Map.prototype.maxRes ); goog.exportProperty( ol.Map.prototype, 'destroy', ol.Map.prototype.destroy ); // ol.loc @@ -46,6 +40,14 @@ goog.exportProperty( ol.Bounds.prototype, 'minY', ol.Bounds.prototype.minY ); goog.exportProperty( ol.Bounds.prototype, 'maxX', ol.Bounds.prototype.maxX ); goog.exportProperty( ol.Bounds.prototype, 'maxY', ol.Bounds.prototype.maxY ); +// ol.layer.xyz +goog.exportSymbol('ol.layer.xyz', ol.layer.xyz); +goog.exportSymbol('ol.layer.XYZ', ol.layer.XYZ); + +// ol.layer.osm +goog.exportSymbol('ol.layer.osm', ol.layer.osm); +goog.exportSymbol('ol.layer.OSM', ol.layer.OSM); + // ol.feature goog.exportSymbol('ol.feature', ol.feature); goog.exportSymbol('ol.Feature', ol.Feature); @@ -53,10 +55,27 @@ goog.exportProperty(ol.Feature.prototype, 'set', ol.Feature.prototype.set); goog.exportProperty(ol.Feature.prototype, 'get', ol.Feature.prototype.get); goog.exportProperty(ol.Feature.prototype, 'geometry', ol.Feature.prototype.geometry); +// ol.geometry +goog.exportSymbol('ol.geom.geometry', ol.geom.geometry); +goog.exportSymbol('ol.geom.Geometry', ol.geom.Geometry); +goog.exportProperty(ol.geom.Geometry.prototype, 'bounds', ol.geom.Geometry.prototype.bounds); + +// ol.geom.collection +goog.exportSymbol('ol.geom.collection', ol.geom.collection); +goog.exportSymbol('ol.geom.Collection', ol.geom.Collection); +goog.exportProperty(ol.geom.Collection.prototype, 'components', ol.geom.Collection.prototype.components); +goog.exportProperty(ol.geom.Collection.prototype, 'add', ol.geom.Collection.prototype.add); +goog.exportProperty(ol.geom.Collection.prototype, 'addAll', ol.geom.Collection.prototype.addAll); +goog.exportProperty(ol.geom.Collection.prototype, 'remove', ol.geom.Collection.prototype.remove); + // ol.geom.point goog.exportSymbol('ol.geom.point', ol.geom.point); goog.exportSymbol('ol.geom.Point', ol.geom.Point); goog.exportProperty(ol.geom.Point.prototype, 'x', ol.geom.Point.prototype.x); goog.exportProperty(ol.geom.Point.prototype, 'y', ol.geom.Point.prototype.y); -goog.exportPropertz(ol.geom.Point.prototzpe, 'z', ol.geom.Point.prototzpe.z); +goog.exportProperty(ol.geom.Point.prototype, 'z', ol.geom.Point.prototype.z); goog.exportProperty(ol.geom.Point.prototype, 'projection', ol.geom.Point.prototype.projection); + +// LOOKUP FOR DYNMICALLY REGISTERED CONTROLS DOES NOT RUN WELL NOW IN THE ADVANCED MODE +// HACK TO PUSH COMPILER TO NOT STRIP THE NAVIGATION CONTROL. TO BE FIXED. +ol.control.addControl('navigation', ol.control.Navigation); diff --git a/src/ol/geom/Geometry.js b/src/ol/geom/Geometry.js index 4e03a04daf..b24e76d1ed 100644 --- a/src/ol/geom/Geometry.js +++ b/src/ol/geom/Geometry.js @@ -17,10 +17,6 @@ ol.geom.Geometry = function() { this.bounds_ = undefined; }; - - - - /** * @return {ol.Bounds|undefined} The ol.Bounds. */ @@ -36,17 +32,3 @@ ol.geom.Geometry.prototype.setBounds = function(bounds) { this.bounds_ = bounds; return this; }; - -/** - * @export - * @param {ol.Bounds=} opt_arg new Bounds. - * @return {ol.geom.Geometry|ol.Bounds|undefined} either a Geometry (when used as - * setter) or a Bounds/undefined (if used as getter). - */ -ol.geom.Geometry.prototype.bounds = function(opt_arg){ - if (arguments.length == 1 && goog.isDef(opt_arg)) { - return this.setBounds(opt_arg); - } else { - return this.getBounds(); - } -}; \ No newline at end of file diff --git a/test/ol.html b/test/ol.html index 8548676ea3..a2c8d47632 100644 --- a/test/ol.html +++ b/test/ol.html @@ -29,12 +29,12 @@ hostResult = hostRegex.exec(l.href), modeResult = modeRegex.exec(l.href), host = (hostResult && hostResult[1]) - ? hostResult[1] + ? decodeURIComponent(hostResult[1]) : (l.host) ? l.host + ':9810' : 'localhost:9810', mode = (modeResult && modeResult[1]) - ? modeResult[1] + ? decodeURIComponent(modeResult[1]) : 'SIMPLE', // Create the script tag which includes the derived variables from above @@ -89,6 +89,7 @@ +