Commit 3eb7247f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

jsdoc updated to specify types

parent efc2bee4
......@@ -882,7 +882,7 @@ AbstractCustomMap.prototype.setElement = function (element) {
*
* @param {Point} coordinates
* new center point on map
* @returns {PromiseLike}
* @returns {Promise|PromiseLike}
*/
AbstractCustomMap.prototype.setCenter = function (coordinates) {
if (!(coordinates instanceof Point)) {
......@@ -916,6 +916,7 @@ AbstractCustomMap.prototype.getBounds = function () {
*
* @param {number} zoom
* new zoom level on map
* @return {Promise|PromiseLike}
*/
AbstractCustomMap.prototype.setZoom = function (zoom) {
var self = this;
......
......@@ -348,7 +348,7 @@ OpenLayerCanvas.prototype.fitBounds = function (bounds) {
};
OpenLayerCanvas.prototype.setCenter = function (center) {
this.getOpenLayersMap().getView().setCenter(this.fromPointToProjection(center));
return Promise.resolve(this.getOpenLayersMap().getView().setCenter(this.fromPointToProjection(center)));
};
/**
......
......@@ -58,11 +58,11 @@ var Promise = require("bluebird");
* @property {function(): Array} removeAllListeners
* @property {(function(*=): Promise<Array|never>)} getHighlightedBioEntities
* @property {(function(*=): Promise<any|never>)} hideBioEntity
* @property {(function(*): PromiseLike)} setCenter
* @property {(function({modelId: number, x: number, y: number}): Promise|PromiseLike)} setCenter
* @property {(function(*): Point)} getCenter
* @property {(function(*): Bounds)} getBounds
* @property {(function(*): void)} fitBounds
* @property {(function(*): *)} setZoom
* @property {(function({modelId: number, zoom: number}): Promise|PromiseLike)} setZoom
* @property {(function(*): number)} getZoom
* @property {(function(*): PromiseLike)} openMap
* @property {function({dbOverlayName: string, [query]:string, [perfect]: boolean, [fitBounds]:boolean, [coordinates]:Point}): Promise|PromiseLike} triggerSearch
......@@ -466,7 +466,7 @@ function createProjectMap(options) {
*
* @return {PromiseLike|Promise}
*/
clear: function (param) {
clear: function () {
map.getServerConnector().getSessionData(map.getProject()).setShowComments(false);
return Promise.all([map.clearDbOverlays(), map.refreshComments()]);
},
......@@ -693,6 +693,15 @@ function createProjectMap(options) {
return map.getOverlayByName(pluginId).removeSurface(surfaceElements);
});
},
/**
*
* @param {Object} params
* @param {number} params.modelId
* @param {number} params.x
* @param {number} params.y
* @return {Promise|PromiseLike}
*/
setCenter: function (params) {
var submap = map.getSubmapById(params.modelId);
if (submap === null) {
......@@ -723,6 +732,14 @@ function createProjectMap(options) {
var p2 = new Point(params.x2, params.y2);
return submap.getMapCanvas().fitBounds(new Bounds(p1, p2));
},
/**
*
* @param {Object} params
* @param {number} params.modelId
* @param {number} params.zoom
* @return {Promise|PromiseLike}
*/
setZoom: function (params) {
var submap = map.getSubmapById(params.modelId);
if (submap === null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment