diff --git a/src/api/map.js b/src/api/map.js index fa8d967551..8cdc4a9424 100644 --- a/src/api/map.js +++ b/src/api/map.js @@ -19,9 +19,16 @@ ol.MapLike; */ ol.map = function(opt_arg){ + /** @type {ol.Loc|undefined} */ var center; - var target; + /** @type {number|undefined} */ var zoom; + /** @type {number|undefined} */ + var numZoomLevels; + /** @type {ol.Projection|undefined} */ + var projection; + /** @type {ol.Projection|undefined} */ + var userProjection; if (arguments.length == 1) { if (opt_arg instanceof ol.Map) { @@ -29,8 +36,10 @@ ol.map = function(opt_arg){ } else if (goog.isObject(opt_arg)) { center = opt_arg['center']; - target = opt_arg['target']; zoom = opt_arg['zoom']; + numZoomLevels = opt_arg['numZoomLevels']; + projection = opt_arg['projection']; + userProjection = opt_arg['userProjection']; } else { throw new Error('ol.map'); @@ -44,6 +53,15 @@ ol.map = function(opt_arg){ if (goog.isDef(zoom)) { map.setZoom(zoom); } + if (goog.isDef(numZoomLevels)) { + map.setNumZoomLevels(numZoomLevels); + } + if (goog.isDef(projection)) { + map.setProjection(projection); + } + if (goog.isDef(projection)) { + map.setUserProjection(projection); + } return map; }; diff --git a/src/ol/Map.js b/src/ol/Map.js index b80ff36932..8516b360b6 100644 --- a/src/ol/Map.js +++ b/src/ol/Map.js @@ -117,7 +117,7 @@ ol.Map.prototype.setProjection = function(projection) { /** - * @param {ol.Projection} projection set the user projection. + * @param {ol.Projection} userProjection set the user projection. * @return {ol.Map} This. */ ol.Map.prototype.setUserProjection = function(userProjection) {