Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix types in grid, streetview, geolocation and format #4560

Merged
merged 5 commits into from
Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions contribs/gmf/examples/xsdattributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function MainController($timeout, gmfThemes, gmfXSDAttributes) {
this.xsdAttributes_ = gmfXSDAttributes;

/**
* @type {?Array.<Attribute>}
* @type {?Array.<import('ngeo/format/Attribute.js').Attribute>}
* @export
*/
this.attributes = null;
Expand Down Expand Up @@ -109,7 +109,7 @@ MainController.prototype.getSetLayers = function(value) {


/**
* @param {Array.<Attribute>} attributes Attributes.
* @param {Array.<import('ngeo/format/Attribute.js').Attribute>} attributes Attributes.
* @export
*/
MainController.prototype.setAttributes_ = function(attributes) {
Expand Down
6 changes: 2 additions & 4 deletions contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,9 @@ export function AbstractAppController(config, map, $scope, $injector) {
const ngeoFeatures = $injector.get('ngeoFeatures');

/**
* @type {import("ngeo/map/FeatureOverlay.js").default}
* @export
* @type {import("ngeo/map/FeatureOverlay.js").FeatureOverlay}
*/
this.drawFeatureLayer = $injector.get('ngeoFeatureOverlayMgr')
.getFeatureOverlay();
this.drawFeatureLayer = $injector.get('ngeoFeatureOverlayMgr').getFeatureOverlay();
this.drawFeatureLayer.setFeatures(ngeoFeatures);

/**
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/drawing/drawFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ Controller.prototype.handleMapContextMenu_ = function(evt) {
/**
* @param {?Array.<number>} vertexInfo Vertex information, in case a
* vertex was clicked using the right button.
* @param {!MenuEvent} evt Event.
* @param {!import('ngeo/filter/ruleComponent.js').MenuEvent} evt Event.
* @private
*/
Controller.prototype.handleMenuActionClick_ = function(vertexInfo, evt) {
Expand Down Expand Up @@ -756,7 +756,7 @@ Controller.prototype.handleTranslateEnd_ = function(evt) {


/**
* @param {!RotateEvent} evt Event.
* @param {!import('ngeo/interaction/Rotate.js').RotateEvent} evt Event.
* @private
*/
Controller.prototype.handleRotateEnd_ = function(evt) {
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/editing/XSDAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ EditingXSDAttributeService.prototype.getAttributes = function(id) {

/**
* @param {angular.IHttpResponse} resp Ajax response.
* @return {Array.<Attribute>} List of attributes.
* @return {Array.<import('ngeo/format/Attribute.js').Attribute>} List of attributes.
* @export
*/
EditingXSDAttributeService.prototype.handleGetAttributes_ = function(resp) {
Expand Down
10 changes: 5 additions & 5 deletions contribs/gmf/src/editing/editFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ function Controller($element, $q, $scope, $timeout,
this.listenerKeys_ = [];

/**
* @type {?Array.<!Attribute>}
* @type {?Array.<!import('ngeo/format/Attribute.js').Attribute>}
* @export
*/
this.attributes = null;
Expand Down Expand Up @@ -840,7 +840,7 @@ Controller.prototype.handleEditFeature_ = function(resp) {


/**
* @param {!Array.<Attribute>} attributes Attributes.
* @param {!Array.<import('ngeo/format/Attribute.js').Attribute>} attributes Attributes.
* @private
*/
Controller.prototype.setAttributes_ = function(attributes) {
Expand Down Expand Up @@ -1251,7 +1251,7 @@ Controller.prototype.handleFeatureGeometryChange_ = function() {


/**
* @param {MenuEvent} evt Event.
* @param {import('ngeo/filter/ruleComponent.js').MenuEvent} evt Event.
* @private
*/
Controller.prototype.handleMenuActionClick_ = function(evt) {
Expand All @@ -1273,7 +1273,7 @@ Controller.prototype.handleMenuActionClick_ = function(evt) {


/**
* @param {MenuEvent} evt Event.
* @param {import('ngeo/filter/ruleComponent.js').MenuEvent} evt Event.
* @private
*/
Controller.prototype.handleMenuVertexActionClick_ = function(evt) {
Expand Down Expand Up @@ -1303,7 +1303,7 @@ Controller.prototype.handleTranslateEnd_ = function(evt) {


/**
* @param {!RotateEvent} evt Event.
* @param {!import('ngeo/interaction/Rotate.js').RotateEvent} evt Event.
* @private
*/
Controller.prototype.handleRotateEnd_ = function(evt) {
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/src/filters/filterselectorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Controller {
this.ngeoNotification_ = ngeoNotification;

/**
* @type {!import("ngeo/map/FeatureOverlay.js").default}
* @type {!import("ngeo/map/FeatureOverlay.js").FeatureOverlay}
* @export
*/
this.featureOverlay = ngeoFeatureOverlayMgr.getFeatureOverlay();
Expand Down Expand Up @@ -725,8 +725,8 @@ class Controller {

/**
* @typedef {Object} RuleCacheItem
* @property {Array.<ngeo.rule.Rule>} customRules
* @property {Array.<ngeo.rule.Rule>} directedRules
* @property {Array.<import('ngeo/rule/Rule.js').default>} customRules
* @property {Array.<import('ngeo/rule/Rule.js').default>} directedRules
*/


Expand Down
2 changes: 0 additions & 2 deletions contribs/gmf/src/lidarprofile/Plot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/**
*/
import olFeature from 'ol/Feature.js';
import olGeomPoint from 'ol/geom/Point.js';
import olStyleCircle from 'ol/style/Circle.js';
Expand Down
11 changes: 4 additions & 7 deletions contribs/gmf/src/permalink/Permalink.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,22 @@ export function PermalinkService($q, $timeout, $rootScope, $injector, ngeoDeboun
$injector.get('ngeoFeatureOverlayMgr') : null;

/**
* @type {?import("ngeo/map/FeatureOverlay.js").default}
* @type {?import("ngeo/map/FeatureOverlay.js").FeatureOverlay}
* @private
*/
this.featureOverlay_ = ngeoFeatureOverlayMgr ?
ngeoFeatureOverlayMgr.getFeatureOverlay() : null;
this.featureOverlay_ = ngeoFeatureOverlayMgr ? ngeoFeatureOverlayMgr.getFeatureOverlay() : null;

/**
* @type {?import("ngeo/misc/FeatureHelper.js").FeatureHelper}
* @private
*/
this.featureHelper_ = $injector.has('ngeoFeatureHelper') ?
$injector.get('ngeoFeatureHelper') : null;
this.featureHelper_ = $injector.has('ngeoFeatureHelper') ? $injector.get('ngeoFeatureHelper') : null;

/**
* @type {?import("ngeo/query/Querent.js").Querent}
* @private
*/
this.ngeoQuerent_ = $injector.has('ngeoQuerent') ?
$injector.get('ngeoQuerent') : null;
this.ngeoQuerent_ = $injector.has('ngeoQuerent') ? $injector.get('ngeoQuerent') : null;

/**
* The options to configure the gmf permalink service with.
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/profile/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function Controller($scope, $http, $element, $filter, gettextCatalog, ngeoFeatur
this.gettextCatalog_ = gettextCatalog;

/**
* @type {import("ngeo/map/FeatureOverlay.js").default}
* @type {import("ngeo/map/FeatureOverlay.js").FeatureOverlay}
* @private
*/
this.pointHoverOverlay_ = ngeoFeatureOverlayMgr.getFeatureOverlay();
Expand Down Expand Up @@ -695,7 +695,7 @@ Controller.prototype.downloadCsv = function() {
return;
}

/** @type {Array.<GridColumnDef>} */
/** @type {Array.<import('ngeo/download/Csv.js').GridColumnDef>} */
const headers = [];
let hasDistance = false;
const firstPoint = this.profileData[0];
Expand Down
9 changes: 4 additions & 5 deletions contribs/gmf/src/query/gridComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ngeoDownloadService from 'ngeo/download/service.js';

import ngeoGridComponent from 'ngeo/grid/component.js';

import ngeoGridConfig, {getRowUid, GridConfig} from 'ngeo/grid/Config.js';
import ngeoGridConfig, {getRowUid} from 'ngeo/grid/Config.js';
import ngeoMapFeatureOverlayMgr from 'ngeo/map/FeatureOverlayMgr.js';

import ngeoQueryMapQuerent from 'ngeo/query/MapQuerent.js';
Expand Down Expand Up @@ -49,7 +49,6 @@ const module = angular.module('gmfQueryGridComponent', [
ngeoDownloadCsv.name,
ngeoDownloadService.name,
ngeoGridComponent.name,
ngeoGridConfig.name,
ngeoMapFeatureOverlayMgr.name,
ngeoQueryMapQuerent.name,
]);
Expand Down Expand Up @@ -694,16 +693,16 @@ Controller.prototype.getGridConfiguration_ = function(data) {
delete clone.ol_uid;
const columns = Object.keys(clone);

/** @type {Array.<GridColumnDef>} */
/** @type {Array.<import('ngeo/download/Csv.js').GridColumnDef>} */
const columnDefs = [];
columns.forEach((column) => {
columnDefs.push(/** @type {GridColumnDef} */ ({
columnDefs.push(/** @type {import('ngeo/download/Csv.js').GridColumnDef} */ ({
name: column
}));
});

if (columnDefs.length > 0) {
return new GridConfig(data, columnDefs);
return new ngeoGridConfig(data, columnDefs);
} else {
// no columns, do not show grid
return null;
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class SearchController {
this.coordinatesProjections;

/**
* @type {import("ngeo/map/FeatureOverlay.js").default}
* @type {import("ngeo/map/FeatureOverlay.js").FeatureOverlay}
* @private
*/
this.featureOverlay_ = ngeoFeatureOverlayMgr.getFeatureOverlay();
Expand Down
4 changes: 2 additions & 2 deletions examples/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function MainController($http, $timeout, $scope) {
this.timeout_ = $timeout;

/**
* @type {?Array.<Attribute>}
* @type {?Array.<import('ngeo/format/Attribute.js').Attribute>}
* @export
*/
this.attributes = null;
Expand Down Expand Up @@ -87,7 +87,7 @@ function MainController($http, $timeout, $scope) {

/**
* @param {angular.IHttpResponse} resp Ajax response.
* @return {Array.<Attribute>} List of attributes.
* @return {Array.<import('ngeo/format/Attribute.js').Attribute>} List of attributes.
* @private
*/
MainController.prototype.handleXSDAttributeGet_ = function(resp) {
Expand Down
3 changes: 0 additions & 3 deletions examples/elevationProfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
*/

import './elevationProfile.css';
import angular from 'angular';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
Expand Down
4 changes: 0 additions & 4 deletions examples/grid.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/**
*/

import './grid.css';
import angular from 'angular';
import ngeoGridConfig from 'ngeo/grid/Config.js';

import ngeoGridModule from 'ngeo/grid/module.js';


Expand Down
3 changes: 0 additions & 3 deletions examples/modifycircle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
*/

import './modifycircle.css';
import angular from 'angular';
import ngeoFormatFeatureProperties from 'ngeo/format/FeatureProperties.js';
Expand Down
3 changes: 0 additions & 3 deletions examples/modifyrectangle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
*/

import './modifyrectangle.css';
import angular from 'angular';
import ngeoInteractionModifyRectangle from 'ngeo/interaction/ModifyRectangle.js';
Expand Down
2 changes: 1 addition & 1 deletion examples/permalink.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ MapComponentController.prototype.$onInit = function() {
view.on('propertychange',
this.ngeoDebounce_(
/**
* @param {import("ol/Object/Event.js").default} e Object event.
* @param {import("ol/events/Event.js").default} e Object event.
*/
(e) => {
const center = view.getCenter();
Expand Down
3 changes: 0 additions & 3 deletions examples/rotate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
*/

import './rotate.css';
import angular from 'angular';
import ngeoInteractionRotate from 'ngeo/interaction/Rotate.js';
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@types/bootstrap": "4.2.1",
"@types/cesium": "1.47.3",
"@types/d3": "5.7.0",
"@types/googlemaps": "3.30.16",
"@types/jquery": "3.3.29",
"@types/jquery.ui.datetimepicker": "0.3.29",
"@types/jqueryui": "1.12.6",
Expand Down
8 changes: 4 additions & 4 deletions src/datasource/DataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*
* @typedef {Object} DataSourceOptions
* @property {Array.<Attribute>} [attributes] The attributes of the data source.
* @property {Array.<import('ngeo/format/Attribute.js').Attribute>} [attributes] The attributes of the data source.
* @property {import('ngeo/datasource/OGC.js').DimensionsFiltersConfig} [dimensionsFiltersConfig] The dimensions filters configuration,
* which determines dimensions supported by this data source using filters and give the corresponding field
* and whether they should use a static value or the one defined in the dimensions.
Expand Down Expand Up @@ -75,7 +75,7 @@ class DataSource {
* Note: `attributes` is not using the conventionnal getter/setter due
* to: See: https://github.com/google/closure-compiler/issues/1089
*
* @type {?Array.<Attribute>}
* @type {?Array.<import('ngeo/format/Attribute.js').Attribute>}
* @export
*/
this.attributes = options.attributes || null;
Expand Down Expand Up @@ -123,15 +123,15 @@ class DataSource {
// =======================================

/**
* @return {?Array.<Attribute>} Attributes
* @return {?Array.<import('ngeo/format/Attribute.js').Attribute>} Attributes
* @export
*/
getAttributes() {
return this.attributes;
}

/**
* @param {?Array.<Attribute>} attributes Attributes
* @param {?Array.<import('ngeo/format/Attribute.js').Attribute>} attributes Attributes
* @export
*/
setAttributes(attributes) {
Expand Down
2 changes: 1 addition & 1 deletion src/datasource/OGC.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const WMSInfoFormat = {
* @property {string} [wmsUrl] The URL to use for (WMS) requests.
* @property {string} [wmtsLayer] The layer name to use for the (WMTS) requests.
* @property {string} [wmtsUrl] The URL to use for (WMTS) requests.
* @property {Array.<Attribute>} [attributes] (DataSourceOptions)
* @property {Array.<import('ngeo/format/Attribute.js').Attribute>} [attributes] (DataSourceOptions)
* @property {DimensionsFiltersConfig} [dimensionsFiltersConfig] (DataSourceOptions)
* @property {number} id (DataSourceOptions)
* @property {string} [identifierAttribute] (DataSourceOptions)
Expand Down
2 changes: 1 addition & 1 deletion src/draw/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ DrawController.prototype.registerInteraction = function(
* Called when any of the draw or measure interaction active property changes.
* Set the active property of this directive accordingly, i.e. if at least
* one of the draw or measure is active then the active property is set to true.
* @param {import("ol/Object/Event.js").default} event Event.
* @param {import("ol/events/Event.js").default} event Event.
* @export
*/
DrawController.prototype.handleActiveChange = function(event) {
Expand Down
6 changes: 3 additions & 3 deletions src/editing/attributesComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ngeoAttributesTemplateUrl($attrs, ngeoAttributesTemplateUrl) {
* ngeo-attributes-feature="::ctrl.feature">
* </ngeo-attributes>
*
* @htmlAttribute {Array.<Attribute>} ngeo-attributes-attributes The
* @htmlAttribute {Array.<import('ngeo/format/Attribute.js').Attribute>} ngeo-attributes-attributes The
* list of attributes to use.
* @htmlAttribute {boolean} ngeo-attributes-disabled Whether the fieldset should
* be disabled or not.
Expand Down Expand Up @@ -86,7 +86,7 @@ function Controller($scope, ngeoEventHelper) {

/**
* The list of attributes to create the form with.
* @type {Array.<Attribute>}
* @type {Array.<import('ngeo/format/Attribute.js').Attribute>}
* @export
*/
this.attributes;
Expand Down Expand Up @@ -177,7 +177,7 @@ Controller.prototype.$onDestroy = function() {


/**
* @param {import("ol/Object/Event.js").default} evt Event.
* @param {import("ol/events/Event.js").default} evt Event.
* @private
*/
Controller.prototype.handleFeaturePropertyChange_ = function(evt) {
Expand Down