diff --git a/main.json b/main.json index 58dc4c978d..0048f48824 100644 --- a/main.json +++ b/main.json @@ -17,15 +17,15 @@ "checks": { // "accessControls": "ERROR", // "visibility": "ERROR" - "checkTypes": "ERROR", - "checkRegExp": "ERROR", - "checkVars": "ERROR", - "deprecated": "ERROR", - "fileoverviewTags": "ERROR", - "invalidCasts": "ERROR", - "missingProperties": "ERROR", - "nonStandardJsDocs": "ERROR", - "undefinedVars": "ERROR" + // "checkTypes": "ERROR", + // "checkRegExp": "ERROR", + // "checkVars": "ERROR", + // "deprecated": "ERROR", + // "fileoverviewTags": "ERROR", + // "invalidCasts": "ERROR", + // "missingProperties": "ERROR", + // "nonStandardJsDocs": "ERROR", + // "undefinedVars": "ERROR" }, "jsdoc-html-output-path": "." diff --git a/src/api/map.js b/src/api/map.js index 8cdc4a9424..db0863e0a6 100644 --- a/src/api/map.js +++ b/src/api/map.js @@ -113,3 +113,15 @@ ol.Map.prototype.zoom = function(opt_arg) { return this.getZoom(); } }; + +/** + * @param {number=} opt_arg + * @returns {ol.Map|number|undefined} Map center. + */ +ol.Map.prototype.numZoomLevels = function(opt_arg) { + if (arguments.length == 1 && goog.isDef(opt_arg)) { + return this.setNumZoomLevels(opt_arg); + } else { + return this.getNumZoomLevels(); + } +}; diff --git a/src/ol/Map.js b/src/ol/Map.js index 8516b360b6..14765241f4 100644 --- a/src/ol/Map.js +++ b/src/ol/Map.js @@ -42,12 +42,16 @@ ol.Map = function() { }; -ol.Map.prototype.defaults = {}; /** + @const @type {string} */ -ol.Map.prototype.defaults.projection = "EPSG:3857"; -ol.Map.prototype.defaults.userProjection = "EPSG:4326"; +ol.Map.prototype.DEFAULT_PROJECTION = "EPSG:3857"; +/** + @const + @type {string} +*/ +ol.Map.prototype.DEFAULT_USER_PROJECTION = "EPSG:4326"; /** @@ -63,7 +67,7 @@ ol.Map.prototype.getCenter = function() { */ ol.Map.prototype.getProjection = function() { if (!goog.isDef(this.projection_)) { - this.projection_ = new ol.Projection(this.defaults.projection); + this.projection_ = new ol.Projection(this.DEFAULT_PROJECTION); } return this.projection_; }; @@ -74,7 +78,7 @@ ol.Map.prototype.getProjection = function() { */ ol.Map.prototype.getUserProjection = function() { if (!goog.isDef(this.userProjection_)) { - this.userProjection_ = new ol.Projection(this.defaults.userProjection_); + this.userProjection_ = new ol.Projection(this.DEFAULT_USER_PROJECTION); } return this.userProjection_; }; diff --git a/test/spec/ol/Map.test.js b/test/spec/ol/Map.test.js index 10f9ff4176..ac22a5c2af 100644 --- a/test/spec/ol/Map.test.js +++ b/test/spec/ol/Map.test.js @@ -63,8 +63,8 @@ describe("ol.Map", function() { center = map.center(); zoom = map.zoom(); - expect(center.x().toFixed(3)).toBe("1.000"); - expect(center.y().toFixed(3)).toBe("2.000"); + expect(center.x().toFixed(3)).toBe("4.000"); + expect(center.y().toFixed(3)).toBe("5.000"); expect(zoom).toBe(6); });